smapiot / piral

🚀 Framework for next generation web apps using micro frontends. ⭐️ Star to support our work!
https://piral.io
MIT License
1.68k stars 125 forks source link

Ignore Unresolved Inherited Shared Dependencies #633

Closed FlorianRappl closed 11 months ago

FlorianRappl commented 11 months ago

New Feature Proposal

For more information, see the CONTRIBUTING guide.

Description

All dependencies from the importmap are resolved to find their entry point - this is done even though some dependency might not even be used and therefore not installed. Right now this leads to problems - forcing the user to install these (unused) inherited shared dependencies.

We should ignore those dependencies. While dependencies of the importmap that are explicitly (i.e., not inherited) specified there should still throw if unresolved, these other (implicit) dependencies should just be ignored.

Background

We've seen these in some projects that have a lot of (centrally) shared dependencies. Now, teams that create pilets for those app shells are quite often only using a subset of the available dependencies. To optimize this a bit they usually drop the shared dependencies from their package.json.

Discussion

Should we print something when we ignore a shared dependency? I think a warning would be wrong - after all, since nothing is installed this is supposingly anyway wanted. If not, then an error would be thrown during bundling anyway... However, I think a small info (ignoring inherited dependency "") would still be good.

Any thoughts on this?