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

[Feature] Support dynamic requires (imports) in DOM-Router. #2041

Closed
5 of 6 tasks
vkryukov76 opened this issue Mar 12, 2018 · 1 comment
Closed
5 of 6 tasks

[Feature] Support dynamic requires (imports) in DOM-Router. #2041

vkryukov76 opened this issue Mar 12, 2018 · 1 comment
Labels

Comments

@vkryukov76
Copy link

vkryukov76 commented Mar 12, 2018


DOM-Router is very useful pattern.

But it has one small flaw - all routes always bundled into one file that loads on every page, even when most routes will never be fired.

Webpack has a great feature called dynamic imports.

Unfortunately current implementation of DOM-Router works only with regular modules, not the dynamic ones.

Dynamic approach to routes can help to split some heavy routes into separate chunks that loads on-demand through only one trigger - a classname of body tag.

I already made some changes in DOM-Router class to support require.ensured and import()ed modules (not supported in current sage's build system now).

vkryukov76@9b41139

If upstream and community will find it useful I will be glad to submit a PR.

@vkryukov76 vkryukov76 changed the title Support dynamic requires (imports) in DOM-Router. [Feature] Support dynamic requires (imports) in DOM-Router. Mar 20, 2018
@Log1x
Copy link
Member

Log1x commented Jun 18, 2019

#2190

@Log1x Log1x closed this as completed Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants