question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Standalone mechanism for dynamic import of widget feature modules

See original GitHub issue

πŸš€ feature request

Relevant Package

?

Description

There are cases where we need to be able to lazy-load components from a module that may not fit into a router paradigm; for instance, a component that gets loaded into a popover as a menu button is clicked (this is the exact scenario I’m facing).

Describe the solution you’d like

There are third-party solutions such as hero-loader that solve this problem, but a built-in solution would be preferred, especially since there shouldn’t much additional code beyond the router’s implementation to make this happen with dynamic imports in a reusable way. Please provide some kind of directive that could be placed on an ng-container that would allow me to target a module, and preferably a component within it. Alternatively, the boostrapped component approach done by hero-loader could be acceptable when there’s one and only one expected component available.

Describe alternatives you’ve considered

hero-loader

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mheverycommented, Aug 20, 2019

If I understand your issue you would like to load a component lazy but to do so now requires you to load the module and that get the factory from there. The steps are non-trivial. With ivy a simple import(...) will work just fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Navigate with feature modules - Android Developers
Navigating to an include-dynamic navigation graph​​ The include-dynamic mechanism enables the base app module to include a nested navigationΒ ...
Read more >
ESNext: Dynamically import ES modules with β€œdynamic import()”
Dynamic import () introduces a new function-like form of import , which allows one to import on demand. It returns a promise for...
Read more >
Create a microfrontend app using module federation and ...
Let's see how it is possible to create a microfrontend app by leveraging Webpack 5 module federation with a widget-based custom remoteΒ ...
Read more >
All Modules | Qt 6.4 - Qt Documentation
Classes to make network programming easier and more portable. Qt QML, Classes for QML and JavaScript languages. Qt Quick, A declarative framework for...
Read more >
Docs β€’ Svelte
Variables declared (or imported) at the top level are 'visible' from the ... If you export a const , class or function ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found