[TIMOB-27888] iOS: circular references in require don't work
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2021-01-13T16:11:56.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 10.0.0 |
Components | iOS |
Labels | engSchedule |
Reporter | Christopher Williams |
Assignee | Christopher Williams |
Created | 2020-05-07T15:53:01.000+0000 |
Updated | 2021-01-29T17:11:53.000+0000 |
Description
While Android's require implementation is able to handle circular references - iOS is not.
This is due to the underlying implementations - where Android is written in JS and mimics Node.js, while iOS is native. There's multiple possible solutions here:
- Use rollup under the hood on apps as part of our build process.
- Migrate iOS to use a shared require implementation with Android
I personally prefer the second, but it'd take some re-architecting of how iOS starts up - and it's unclear to me how we'd tweak Android to use a require implementation under common rather than the one baked into the the runtime (the JS is baked in as bytes and executed early).
Merged to master (along with large refactor to help unify require implementations cross-platform). Unit tests confirm the fix.
*Closing ticket*, verified in SDK version
10.0.0.v20210126123332
. *+Test case:+* app.jsb.js
*+Test Environment+*