Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ESBuild instead of Webpack #1672

Open
nojaf opened this issue Mar 23, 2022 · 11 comments · May be fixed by #1684
Open

Use ESBuild instead of Webpack #1672

nojaf opened this issue Mar 23, 2022 · 11 comments · May be fixed by #1684
Labels
infrastructure Problems related to building, contributing to Ionide etc.

Comments

@nojaf
Copy link
Contributor

nojaf commented Mar 23, 2022

Hello, as webpack is no longer what the cool kids use, I'm wondering if you would be open to swapping it for esbuild?

@cartermp
Copy link
Contributor

I'm not opposed in theory, but my experience with js build systems is rooted in much pain and so I wonder how much effort it would be to make the change.

@baronfel
Copy link
Contributor

Yeah, it's just an effort question to me. The current setup has worked for a while and it's the part of the codebase I'm least-comfortable with, so I'm change-averse.

@AngelMunoz
Copy link
Contributor

I might give it a try this weekend, one can know if it'll work under a couple of hours so if I face anything weird I'll report back

@nojaf
Copy link
Contributor Author

nojaf commented Mar 25, 2022

Nice! Would be great if we could get a fable and esbuild watch kind of thing going on.

@baronfel
Copy link
Contributor

@nojaf
Copy link
Contributor Author

nojaf commented Mar 25, 2022

Interesting! But I think you still want esbuild > webpack, it really is a lot faster to compile to the target JS.

@baronfel
Copy link
Contributor

oh certainly esbuild would be a net benefit - I was just hoping to 🎣 snag someone into doing hot reload while they were at it ;)

@AngelMunoz
Copy link
Contributor

I went out and checked (with vite as opposed to raw esbuild) and after some inspection and looking after the code I have a few questions:

  • What is the main reason webpack is/was being used?
  • Do we even want webpack/esbuild/vite at all?

I can only think webpack was there to transpile back early fable code where electron didn't support esm, and perhaps even some ES201X features, this is no longer the case the recent node/electron versions support all of the features that fable transpile as far as I'm aware, we could ditch it entirely to be honest.

The only reason I can think to have an extra build/bundling tool would be if extensions need to have bundled javascript files rather than transpiled and minified source code.

I think we should be able to just run fable in watch mode in the back and then just launch the extension with the direct output of fable there would be some work to be done in regards imported members without extensions but I think over all it could be worth exploring

thoughts?

@baronfel
Copy link
Contributor

That's an interesting idea for sure. I don't think we do anything special - as long as we can emit source maps that should be all we need. The VSCode docs highly suggest bundling for a perf benefit, but realistically our extension isn't really that large at all. Perhaps shipping an unbundled version would be better for debugging?

@nojaf
Copy link
Contributor Author

nojaf commented Mar 26, 2022

I would still bundle for production as the docs say, you don't know upfront what target (desktop/browser) you are dealing with so you want maximum coverage.
It would be super cool if while developing you would only need Fable (in watch mode) and can have that extension reload working. That would really be the sweet spot I think.

@nojaf nojaf linked a pull request Apr 5, 2022 that will close this issue
@AngelMunoz
Copy link
Contributor

Hey Sorry I forgot to report back here
I just committed my attempt on my fork I know it worked but I didn't test it too much (hence why no PR) in case anyone wants to check it out

main...AngelMunoz:main

@Krzysztof-Cieslak Krzysztof-Cieslak added the infrastructure Problems related to building, contributing to Ionide etc. label Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Problems related to building, contributing to Ionide etc.
Development

Successfully merging a pull request may close this issue.

5 participants