Description
SDK 9 removes the implicit global scope in app.js. We tried to handle this in ALOY-1633, but there was an oversight that the Alloy global can be used in styles which does not get touched by the babel plugin.
We need to either figure out how we can inject Alloy if needed, or just fallback to forcing the Alloy global to exist
Steps to reproduce
1. Copy the below contents to the right files
Alloy.Globals.color = 'blue'
<Alloy>
<Window id="win" onClick="onClick">
<Label text="foo"/>
</Window>
</Alloy>
function onClick() {
$.UI.create('Window');
}
$.win.open();
'Window': {
backgroundColor: Alloy.Globals.color
}
2. Build for any platform/device
3. Tap the window
Actual
Runtime error
Expected
Blue window with the label foo
https://github.com/appcelerator/alloy/pull/955
Alloy PR merged, should be in a preprod CLI (expecting 8.0.0-master.10) in around an hour
Verified the fix in CLI 8.0.0-master.10. Closing. Studio Ver: 6.0.0.201911251516 SDK Ver: 9.0.0.v20200224113949 OS Ver: 10.14.5 Xcode Ver: Xcode 11.3.1 Appc NPM: 5.0.0-2 Appc CLI: 8.0.0-master.10 Daemon Ver: 3.2.0 Ti CLI Ver: 5.2.2 Alloy Ver: 1.14.6 Node Ver: 12.13.1 NPM Ver: 6.12.1 Java Ver: 11.0.1 Android Devices: ⇨ google Pixel (Android 10) IOS Simulator: ⇨ iPhone 11 Pro iOS 13.3