Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(android): implement top-level-await and native import support #12347

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

garymathews
Copy link
Contributor

@garymathews garymathews commented Dec 15, 2020

  • Implement support for top-level-await
  • Javascript is now parsed and executed as a module, including imported modules
    • This provides native export support
  • Removed wrapping of modules as workaround for module execution context
  • import has been implemented natively, although it currently still piggybacks off our require 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
TODO
  • Fix core JS methods (console.log, setTimeout, etc...)
  • Modernize our runtime/common/src/js/*.js files
  • Create destructor to clean-up moduleContexts
  • Remove unused runAsScript
  • Tidy exceptions from module
  • Fix reference to internal data types (Object, String, etc...)
  • Update node-titanium-sdk to allow for native import/export and top-level-await support

TIMOB-28286

@build
Copy link
Contributor

build commented Dec 15, 2020

Warnings
⚠️ 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
⚠️

🔍 Can't find junit reports at ./junit.*.xml, skipping generating JUnit Report.

Messages
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.

Generated by 🚫 dangerJS against c07991a

@sgtcoolguy
Copy link
Contributor

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).

@sgtcoolguy
Copy link
Contributor

@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 garymathews force-pushed the TIMOB-28265 branch 3 times, most recently from 6e03e15 to 64baf14 Compare January 29, 2021 04:01
@garymathews garymathews force-pushed the TIMOB-28265 branch 3 times, most recently from 6b00b5f to 238605c Compare January 29, 2021 05:51
@hansemannn
Copy link
Collaborator

@garymathews Is there a possibility to finish this pull request? 😇 It would be an amazing improvement!

@hansemannn hansemannn modified the milestones: 10.1.0, 10.2.0 Mar 21, 2022
@hansemannn hansemannn modified the milestones: 11.0.0, 11.1.0 May 27, 2022
@hansemannn hansemannn modified the milestones: 11.1.0, 12.0.0 Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants