stefan,
@stefan@gardenstate.social avatar

Is it possible to build a react app with plugin support? Like could an app, given an arbitrary cdn url load it, get the component, pass it props and render it without needing to know about it at build time? I feel like it should be possible but I've never seen an example of that. Perhaps for good reasons as maybe xxs stops that idea from working.

bcdavid,
@bcdavid@hachyderm.io avatar

@stefan Yes, it's possible to do this. Wepback's module federation is an example of a tool that enables this, but it could also be as simple as using a dynamic ESM import. I believe where you import from is still constrained by things like CORS and other security mechanisms, but it is conceptually possible.

stefan,
@stefan@gardenstate.social avatar

@bcdavid good keyword to search. do you know an article that describes those things?

bcdavid,
@bcdavid@hachyderm.io avatar

@stefan Don't have any articles off the top of my head (outside of things like Webpack documentation), but this approach of dynamically importing and running arbitrary modules as a way to inject independent apps at run time is one approach used for micro-frontends, so that's another keyword to look into and which probably will get you more hits on search engines and podcasts.

stefan,
@stefan@gardenstate.social avatar

@bcdavid thanks! very helpful.

jprestonian,
@jprestonian@thegem.city avatar

@stefan
This seed could find no purchase in the rocky soil of his mind.

stefan,
@stefan@gardenstate.social avatar

@jprestonian so poetic.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • webdev
  • rosin
  • magazineikmin
  • GTA5RPClips
  • khanakhh
  • InstantRegret
  • Youngstown
  • mdbf
  • slotface
  • thenastyranch
  • everett
  • osvaldo12
  • kavyap
  • cubers
  • DreamBathrooms
  • megavids
  • Durango
  • modclub
  • ngwrru68w68
  • vwfavf
  • ethstaker
  • tester
  • cisconetworking
  • tacticalgear
  • Leos
  • provamag3
  • normalnudes
  • anitta
  • JUstTest
  • All magazines