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

Revamp of the dev server & builder #182

Open
617a7aa opened this issue Sep 26, 2021 Discussed in #181 · 4 comments
Open

Revamp of the dev server & builder #182

617a7aa opened this issue Sep 26, 2021 Discussed in #181 · 4 comments

Comments

@617a7aa
Copy link

617a7aa commented Sep 26, 2021

Discussed in #181

Originally posted by 0xAsteria September 26, 2021
Yo!

I want to propose we switch from Webpack + wrangler dev to esbuild and Miniflare.

Why?

Speed, mostly. Flareact's dev server is painfully slow when using wrangler dev. I've managed to switch to using Miniflare and it's significantly faster, however still painfully slow to develop on due to Webpack being slow.

Switching to Miniflare over wrangler dev was relatively easy, instead of yarn dev pointing at flareact dev, it runs miniflare --watch which speeds it up a bunch and has more features by running it locally.

Switching to esbuild over Webpack is probably going to be a lot harder and I haven't managed to do it yet. esbuild is the only thing really holding Flareact back from perhaps becoming faster than Next.js in both production and development.

Screenshot 2021-09-26 at 11 57 04

If we had 0.37s build times or less via esbuild instead of the 5-15s I have to wait for Webpack to fully rebuild everything, Flareact would be a beauty to develop on. The only thing holding it back right now (imo) is how slow DX is.

Not sure how we'd do it, but happy to help where I can. Have a think about it!

@tj-kev
Copy link
Contributor

tj-kev commented Sep 27, 2021

Hi,
I've been looking at miniflare recently as an alternative to the normal dev environment but not had a chance to try it out. Good to hear you managed to get it working.

I was thinking of providing both options. Would you be willing to do a pull request adding support for it?

For the esbuild, its not something I have used before. Looks like its still under active development but could be something we look at in the future?

@subhendukundu
Copy link
Contributor

I have been using vitedge for a while. Love esbuild for sure.
But esbuild has few significant support issues on most of the popular open source packages?

@traffisco
Copy link
Contributor

Definitely agree. Dev is painfully slow.

@shaunm
Copy link

shaunm commented Jan 11, 2022

EDIT: Solved

Running on Mac with Apple Silicon, one needs to call yarn run build and then miniflare after.

How were you able to get miniflare to work properly?

I face the following error:

$ miniflare --watch
node:fs:585
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open '/out/_flareact/static/build-manifest.json'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants