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(ios): support circular require references #11693
Conversation
|
6f3f434
to
0b82717
Compare
590d28e
to
67e379d
Compare
1e43f19
to
8fde716
Compare
8fde716
to
e2b5652
Compare
@sgtcoolguy While running the PR using Xcode, I am getting following error -
|
After new commits, it is working fine. Thanks! |
- retains native require but overrides during app startup to match Node.js/Android - require logic is almost entirely in JS now - expose some extra native methods to implement similarly to Android - fix js core "binding" hack to work on ios in same way as android
* move Script out to separate Module * break out kroll and assets globals to separate modules * introduce Module protocol to unify legacy/new modules * add APIs to convert new style proxies to JSValue* * fix conversion of new style modules via kroll.binding()
* split ti.main and ti.kernel bundling
* begin effort to unify the startup/code between platforms * use split bundling methods to produce proper parts in proper build stages * don't include ti.kernel.js for Android, as it gets baked into C code
* removes the need to pass around context objects everywhere * remove the now-unused AndroidWrapper stuff
d44e877
to
42fa8c1
Compare
match Ti.Local.getString in returning key for non-string default values supplied
…when not a service
42fa8c1
to
1d69030
Compare
JIRA: https://jira.appcelerator.org/browse/TIMOB-27888
Description:
This is a PR to unify our require implementation between iOS and Android. Android had a mostly JS-based implementation based off Node.js. The native layer uses bindings for native/core modules and loading those. But the bulk of loading JS code is actually done in JS. On iOS, the entire flow was native.
This PR has been carefully rebased into meaningful commits to help Code Reviews (look at the individual commits, the full PR is overwhelming!).
The commits generally go as follows:
common
and hijack iOSrequire
to be replaced by it duringti.main.js
load (and then add a test to verify it fixes the circular require issue in an app)require
on iOS and do a refactoring of the code to make the underlying bindings cleaner.common
forti.kernel.js
- equivalent to Android'skroll.js
. This consists of the very core kernel JS scripts to set up the JS environment beforeti.main.js
is loaded.ti.kernel.js
bootstrap function - the most important/relevant thing it defines isModule
- the class that doesrequire
. Then when we're asked to runti.main.js
or a service entry point, we run it thoughModule.runModule()
.common/ti.kernel.js
in place of it's oldkroll.js
. The extensions to titanium APIs are moved out into thecommon/ti.internal/extensions/ti
folder to occur duringti.main.js
.