You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if we could have a new attribute for the <Page> element called import that lets us specify a module name to require/import, instead of it searching for a filename.
This will be very helpful in implementing a clean directory structure.
Also an extension on #1667; codeFile breaks in bundlers like webpack since bundles are by definition single-file. import fixes this by importing with global.loadModule.
@enchev, IIRC you were talking about turning CSS into modules for webpack and this could lend itself to that too by doing the same with a new stylesheet attribute -- with module.exports being a string.
I like the idea. It looks like we can deprecate the codeFile feature as import seems to do the same thing in a more flexible way. For example, you could use it to "import" a platform-specific my-page.android.js file, if needed.
Activity
NickIliev commentedon Oct 31, 2016
Hi @vbresults thank you for your feature suggestion!
Everyone who has an opinion on that matter can write it down in this thread.
Ping @hshristov , @enchev , @hdeshev
[-]Enhancement: codeFile module lookup[/-][+]Enhancement: Page Imports[/+]hdeshev commentedon Nov 1, 2016
I like the idea. It looks like we can deprecate the
codeFilefeature asimportseems to do the same thing in a more flexible way. For example, you could use it to "import" a platform-specificmy-page.android.jsfile, if needed.lock commentedon Aug 29, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.