Skip to content
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.

Does hot reloading push? #45

Open
shmish111 opened this issue Jan 17, 2019 · 4 comments
Open

Does hot reloading push? #45

shmish111 opened this issue Jan 17, 2019 · 4 comments

Comments

@shmish111
Copy link

I don't quite understand how you do hot reloading. When I use webpack with purescript and I change my code, webpack will recompile the code and then push the changes over a websocket to page I have open. If you use ibazel surely this is not possible? Wouldn't it restart the server every time?

Or do you have 2 processes running at the same time (in 2 terminals), ibazel to recompile the code and then a webpack sever that watches the result of that?

@fwouts
Copy link
Owner

fwouts commented Jan 17, 2019

Hi David, the key mechanism is a special tag added here which ensures that the webpack dev server does not get killed. Instead it watches the transpiled directory (see this script, sorry it's a bit hard to follow!).

There are indeed two processes running at the same time, but in a single terminal as ibazel takes care of them:

  • ibazel run ..._server will build all dependencies and start running Webpack dev server
  • on code changes, ibazel does not kill Webpack dev server (because of the special tags mentioned above) but does rebuild all dependencies, which Webpack dev server notices because it has hot reloading enabled.

Does that somewhat make sense?

@shmish111
Copy link
Author

oh, the tags, cool thanks

@shmish111
Copy link
Author

Does this in theory work with any other rule that produces javascript? Is there a type of provider that my rule would need to use to work with this? At the moment my fork of rules_purescript produces many javascript files but it could be bundled into a single file using another layer of bundling which would produce a single javascript file to provide to your bundler. Would this make sense? Can your bundler already deal with a rule that produces many javascript files?

I tried to use rules_rollup but it seemed it couldn't handle my results.

@fwouts
Copy link
Owner

fwouts commented Jan 18, 2019

That's a good question. These rules weren't designed with this kind of usage in mind, but we might be able to tweak it to allow that. I think @enriched had some ideas about this too.

It'd be helpful if you had a very small example with rules_rollup that we could debug from.

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

No branches or pull requests

2 participants