[TIMOB-27150] Add ability to alias required modules in Titanium
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-07-08T16:45:21.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 8.1.0 |
Components | n/a |
Labels | n/a |
Reporter | Brenton House |
Assignee | Christopher Williams |
Created | 2019-06-14T17:41:02.000+0000 |
Updated | 2019-07-16T10:16:38.000+0000 |
Description
With 8.0.X versions of the SDK, I could include a bootstrap file with my package before I published it to npm which then allowed me to define an alias for use with Titanium.
require('/ti.internal/extensions/binding')('axios', '/node_modules/@titanium/axios');
With the 8.1.x releases, the code has changed and is rolled up, which blocks access to the functions necessary to do this.
I will submit a PR that modifies the code to allow it.
Added PR: https://github.com/appcelerator/titanium_mobile/pull/10961
New PR: https://github.com/appcelerator/titanium_mobile/pull/11009
merged to master and 8_1_X. This is an unadvertised/un-documented new "feature" that we use internally to register our Node compatible shims so they get returned by calls to require. Per Brenton's request, the API is now available to users, but I don't know how much we want to advertise this. cc [~emerriman] [~amukherjee] Basically it's now accessed via:
(*) (*) Thank you [~cwilliams] !!! (*) (*)
*Closing ticket*, feature verified in SDK version
8.1.0.v20190715143102
and SDK version8.2.0.v20190712143331
Was able to alias required modules in Titanium using the following test case: *app.js**afile.js*
*Test Environment*