[TIMOB-26729] TiAPI: Ship baseline polyfills in built SDK
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-02-27T19:01:13.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 8.1.0 |
Components | TiAPI |
Labels | n/a |
Reporter | Christopher Williams |
Assignee | Christopher Williams |
Created | 2019-01-15T17:38:04.000+0000 |
Updated | 2019-06-13T12:50:29.000+0000 |
Description
As part of our ES6/7/8 support we now use babel transpilation via preset-env and polyfills. Currently, we are injecting polyfills based on usage during the transpiration process. The avoids unnecessary polyfills, but may lead to the same polyfills being required across many files.
We can potentially move the polyfills into the app bootstrapping core js code we ship in the SDK itself so that the polyfills are required only once at startup.
Pros:
- potential speed boost when making use of polyfills by only loading them once (though also a potential startup perf hit!)
- make use of polyfills in our core js bootstrap code
- remove special polyfill copying done in node-titanium-sdk during app builds
Cons:
- shipping polyfills twice in built SDK right now (under node-titanium-sdk and in the bootstrap code) - can be fixed by removing from node-titanium-sdk
- no gain (but instead a perf hit!) if these polyfills are't actually being used
Merged to master for 8.1.0 eventual release. Also includes upgrade to node-titanium-sdk 3.0.0.
Here's the relevant PR: https://github.com/appcelerator/titanium_mobile/pull/10567
Closing ticket, tested against KitchenSink-v2 using
8.1.0.v20190612160220
and8.2.0.v20190612155743
Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/10567