titanium-sdk
titanium-sdk copied to clipboard
feat(android): implement top-level-await and native import support
- Implement support for top-level-await
- Requires changes to node-titanium-sdk/lib/jsanalyze.js - In progress
- Javascript is now parsed and executed as a module, including imported modules
- This provides native
export
support
- This provides native
- Removed wrapping of modules as workaround for module execution context
-
import
has been implemented natively, although it currently still piggybacks off ourrequire
implementation as it parses paths and handles native modules well - Remove lots of redundant code from previous module loading implementation
- Updated V8 to
8.7.220.29
- Compile using C++14 as a requirement for new changes in
v8.h
- Compile using C++14 as a requirement for new changes in
TODO
- [x] Fix core JS methods (console.log, setTimeout, etc...)
- [x] ~Modernize our
runtime/common/src/js/*.js
files~ - [x] Create destructor to clean-up
moduleContexts
- [x] Remove unused
runAsScript
- [x] Tidy exceptions from module
- [x] Fix reference to internal data types (Object, String, etc...)
- [ ] Update
node-titanium-sdk
to allow for nativeimport/export
and top-level-await support
Warnings | |
---|---|
:warning: | This PR has milestone set to 10.1.0, but the version defined in package.json is 10.0.0 Please either: - Update the milestone on the PR - Update the version in package.json - Hold the PR to be merged later after a release and version bump on this branch |
:warning: |
:mag: Can't find junit reports at |
Messages | |
---|---|
:book: | :fist: The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready. |
Generated by :no_entry_sign: dangerJS against c07991ad88de0ccac46677f6b5f13a6a8ef0f2ee
So, this is very much related to #11693 - we're hitting the same basic code path.
My PR attempts to move iOS to match Android's require/Module implementation and move all JS code into a new ti.kernel.js that we load on both platforms. (So startup becomes more like Android's 2-pass system where you load the kernel/kroll.js equivalent to bootstrap the Module
code and then use that to load ti.main.js
).
@garymathews Can we break out the V8 update/C++14 change to a separate PR we can land earlier? I assume that'd be fairly straight-forward to do and CR to get landed. Also, I'd expect that this will keep shifting as a target since we're going to want to ensure the absolute latest stable V8 release prior to feature freeze (which I'd anticipate would like end up 8.8 for this cycle?)
@garymathews Is there a possibility to finish this pull request? 😇 It would be an amazing improvement!