Fuse-box: Question: is it feasible to make fuse-box run in a browser?

Created on 1 Nov 2019  路  4Comments  路  Source: fuse-box/fuse-box

Hello,

I'm looking for a way to bundle in a browser environment (not node), and out of all other options it seems that fuse-box has the most approachable codebase (also it is in ts) :)

So I'm trying to assess how much work (for me) it would be to try to hack/abstract away file system and run fuse-box in a browser.

Do you think that there are fundamental assumptions of fuse-box that make it hard/impossible to port to a browser?

Thanks!

4.0.0 question

Most helpful comment

@twop yep, it will be possible with the new fuse-compiler which is in Alpha stage. Basically this compiler is 20x faster than typescript and works with js and ts. Using FuseBox runtime env and dynamic modules it will be possible

  • Transpile the output
  • Register in FuseBox runtime scope

Join slack if you're interested in details

All 4 comments

hi @twop how would you expect it to work? It's possible theoretically but really depends on the environment.

The usecase I have is an online editor (similar to codesanbox, stackblitz) and I want to show the output of the project in an iframe.

What that means is that I have a bunch of js files that might have different module systems.
Example: react(cjs) + code you write(in ts) + some other npm packages (esmodules).

And I want to bundle the sources into something that iframe can understand.
Example: sources (cjs + esmodules) -> bundler -> index.js that I can feed to iframe.

Hope that gives more context.

Note: that I'm potentially ok just bundling with no transpilation, minification etc

@twop yep, it will be possible with the new fuse-compiler which is in Alpha stage. Basically this compiler is 20x faster than typescript and works with js and ts. Using FuseBox runtime env and dynamic modules it will be possible

  • Transpile the output
  • Register in FuseBox runtime scope

Join slack if you're interested in details

Closing as question answered.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

viankakrisna picture viankakrisna  路  5Comments

dlacaille picture dlacaille  路  3Comments

charles-mathieus-jomedia picture charles-mathieus-jomedia  路  4Comments

xdave picture xdave  路  5Comments

nchanged picture nchanged  路  5Comments