[ALOY-1048] Alloy: A warning appears in index.xml file while creating default Alloy project
GitHub Issue | n/a |
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-06-18T13:53:42.000+0000 |
Affected Version/s | Alloy 1.4.0, Alloy 1.3.1 |
Fix Version/s | Alloy 1.5.0, Alloy 1.4.0 |
Components | Samples & Templates |
Labels | qe-3.3.0, qe-testadded |
Reporter | Pragya Rastogi |
Assignee | Feon Sua Xin Miao |
Created | 2014-06-09T09:22:54.000+0000 |
Updated | 2014-07-17T18:37:11.000+0000 |
Description
A warning sign appears on index.js for default alloy project saying {color:red}"The id 'label' is not referenced in any style rules"{color}
Refer !AlloyWarning.png!
*Steps to replicate:*
1. Create a default alloy project
+Actual+: Observe there appears a warning sign on project name. Expand the project and observe that index.xml throws the error "The id 'label' is not referenced in any style rules"
+Expected+: No warning must appear on default project
{color: green}Workaround:
Adding code "#label":{} in index.tss file removes the warning.{color}
Attachments
[~skypanther] Not positive if this is a bug, but sounds like we should change the Alloy template for now.
Make sure to also confirm that no such warnings appear with the Two-tab template while we're at it.
No warning signs for Two-tab template.
PR: https://github.com/appcelerator/alloy/pull/449 Functional Test: 1. Create a default Alloy project 2. No warning sign appears next to
PR merged
{color:red}Reopening this issue as *NOT FIXED* for the build:{color} || *Component* || *Version*|| |OS | OSX 10.9.3 , Ubuntu 12.04, Windows 8.1| |Xcode | 5.1.1 | |Titanium Studio | 3.3.0.201406171608 | |Appcelerator Studio | 3.3.0.201406171619 | |SDK | 3.3.0.v20140617161713 | |acs | 1.0.14 | |alloy | 1.4.0-rc | |npm | 1.3.2 | |titanium | 3.3.0-rc | |titanium-code-processor | 1.1.1 |
I believe so, but I think we should also cherry-pick the change to 1.4.0 unless it's risky. It's not a great user experience.
The fix was for the 1.5.0 branch. Failure on 1.4.0-rc should have been expected. I attempted to cherry-pick the change into the 1_4_X branch, but git reported the commit was now empty. So, I manually back-ported the fix New PR https://github.com/appcelerator/alloy/pull/455 Merged
Verified fixed. TiSDk 3.3.0.v20140620104112 Appcelerator Studio 3.3.0.201406171619 CLI 3.3.0-rc2 Alloy 1.4.0-rc2 Closing.
Mmm, today was the release of 3.3.0 I always update in one of my machines when this happens. So I open my project (in Windows 64bit) with the new release and... all my .xml files are full of warnings about "is not referenced in any styles rules". I can compile anyway, but... is fixed or not?
This fix here was an invalid template, where there actually was something wrong. Can you give an example of where you have a valid XML and TSS but it still gives you a warning?
Well, it's supposed that any XML without TSS is valid (the "no use" of TSS is allowed, isn't) But any case it's easy to make an example: 1. Create new project: Basic Alloy 2. Go to index.tss and delete the "#label" reference 3. Close index.XML (so IDE can reload it in the next step) 4. Open index.XML: you have now the error there.
Manuel, the fix was relative to the Alloy default templates, where the following code has been included:
In those cases, referencing the object by its ID won't show the warning. For now, if you create an object in the XML without referencing it from the Styles .tss, Studio is displaying a warning - in case you wanted to use the object ID also from the Styles .tss files. The code would be still valid, as you can use the ID just for referencing the object from the controller .JS files of course. You can disable all Alloy warnings from Studio from "Preferences->Studio->Validation" and disable "Alloy View Validator" option. We appreciate a lot your feedback. This item behavior is actually still under discussion internally and might be subject of changes (personally I see your point and would eventually either remove the warnings for ID objects not being referenced in the .TSS or give a specific option of hiding them).
Federico, thank you very much for your comment, I will deactivate it with the option you shown me (I was looking for some option like that, but didn't find it). And personally I will set that option "deactivated by default", because it is very very common to call objects by id in the JS file, but do not have any specific style for it in TSS, so too much people will find this warnings.