Deep dependencies (auto resolve?)
See original GitHub issueHey there,
Firstly - this package is a godsend. Thanks for building it!
We’ve got fairly complex components that require deep dependencies, i.e. @material-ui/core/Paper where @material-ui/core is the package.
One solution is to manually type of each of those - though when you bring @material-ui/icons/${iconName} into the mix that can get quickly out of control with 1000+ components.
I noticed that createRequires takes a function - is there a way that I can automatically check which packages my remote component needs and pass in the corresponding package? i.e.
const mui = require('@material-ui/core');
const requires = createRequires({
'@material-ui/core/Paper': mui.Paper
})
...
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to install npm peer dependencies automatically?
Older Answer. The automatic install of peer dependencies was explicitly removed with npm 3, as it cause more problems than it tried to...
Read more >How to Automatically Eliminate Dependency Hell - ActiveState
Wrestling with Dependency Hell? Understand how the ActiveState Platform can help you automatically resolve dependency conflicts.
Read more >Auto-installing peer dependencies in npm@7. #289 - GitHub
I have a question about auto-installing peer dependencies. In this PR @isaacs mentions that: ... Could not resolve dependency: npm ERR!
Read more >Autodiscovery & Dependency Mapping | Resolve Systems
Resolve Insights automatically discovers complex, distributed applications and then maps dependencies to the underlying infrastructure components that support ...
Read more >Introduction to the Dependency Mechanism - Apache Maven
Dependency mediation - this determines what version of an artifact will be chosen when multiple versions are encountered as dependencies. Maven ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

This is something I would have to play with. But the Manual Configuration section has some details on using a custom
requires. The docs on this are light, but it should just be a function that takes a string and returns a module. You can do some custom processing inside that.I’ll be improving the docs on that section shortly. But since it’s December, things are slow.
But I can say improvements in this area are on the near horizon 👍
The
requiresshould be created in the web application. I haven’t tested, but something like this:This should match an import of
@material-ui/core/Papertorequire("@material-ui/core").Paper