[ALOY-1690] sourcemaps not being generated for files under lib
GitHub Issue | n/a |
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-06-20T19:13:21.000+0000 |
Affected Version/s | Alloy 1.13.9 |
Fix Version/s | CLI Release 7.1.0, Alloy 1.14.0 |
Components | n/a |
Labels | n/a |
Reporter | Ewan Harris |
Assignee | Ewan Harris |
Created | 2019-05-24T12:22:32.000+0000 |
Updated | 2019-06-24T17:40:05.000+0000 |
Description
Description
Alloy should be generating sourcemaps for files under lib
according to ALOY-616 but this currently is not occurring. It looks like this was broken in ALOY-1262 as it checks whether the target file (i.e the file we're about to write exists) rather than the file we're generating the sourcemap for.
Steps to reproduce
1. Compile kitchensink-v2 \[appc\] alloy compile --config platform=ios
2. Check the sourcemap directory ls ./build/map/Resources/iphone
Expected
There should be actionbar.js.map
, logger.js.map
, and, permissions.js.map
files in that folder
Actual
Those files do not exist
Comments
JSON Source
Looking closer at this, the whole sourcemapping for the lib files seems off. It's setting the filename in the sourcemaps to a non-existent .js file under the build/map directory, however after some reading/looking at controller sourcemapping filename should be the filename for the file the sourcemap represents in the classic code at runtime e.g.
Resources/alloy/logger.js
forapp/lib/logger.js
.Included in ALOY-1612 https://github.com/appcelerator/alloy/pull/893/commits/900be2d4679674fd5d84aa5571cff9bb0a48976e
Note that there is still an unresolved known issue here in that while the external source maps are generated in the build/map folder - the copied file under
Resources/
*does not* have a//# sourcemappingURL=
comment pointing to it, so babel/Studio/Safari/Chrome DevTools aren't aware of it and able to "carry" it forward like files underapp/
are. I think another ticket should be opened to fix that issue as well, otherwise under the debugger for the "source" file you set theResources/<platform>/file.js
path/file rather then the path/file fromapp/lib/file.js
(Additionally, it's entirely possible the source map for the file is wrong due to a post-processing run of the "optimizer". The fix for this is more involved and requires doing the optimizing, source map generation and writing of the copied/generated file all at once, rather than as 3 separate steps.Tested and Verified the Fix on cli 7.1.0-master.22. actionbar.js.map, logger.js.map, and, permissions.js.map files were shown when complied.Works as expected. Closing.