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

Replace live-server with browser-sync #299

Closed
mourner opened this issue Sep 6, 2018 · 6 comments · Fixed by #303
Closed

Replace live-server with browser-sync #299

mourner opened this issue Sep 6, 2018 · 6 comments · Fixed by #303

Comments

@mourner
Copy link
Member

mourner commented Sep 6, 2018

Batfish depends on https://github.com/tapio/live-server, which seems unmaintained — it hasn't received any updates for a year. It also causes issues when installing Batfish on Node v10 because of an old chokidar dependency (which in turn depends on an old fsevents version which doesn't compile). cc @davidtheclark

@davidtheclark
Copy link
Contributor

Thanks for tracking down the Node 10 problem, @mourner. We'll look into alternatives. I'd love to avoid having to write a bunch of custom code for this (as budo does),and would also love to use a generic dependency instead of webpack-dev-server; but we're having trouble finding robust generic options that aren't (like browser-sync) way more than we need. And we have users who will protest strongly if we drop the live-reloading feature.

@kepta can you look into alternatives and figure out what looks best? We'd want to use the same thing for Batfish and for Underreact.

@kepta
Copy link
Contributor

kepta commented Sep 13, 2018

I tried to find a perfect replacement for live-server, but it looks like there is no perfect solution.

We'll look into alternatives. I'd love to avoid having to write a bunch of custom code for this (as budo does),

@davidtheclark I am not sure if by ^^ you mean - budo authors choice to ditch tiny-lr see mattdesl/budo#194. From what I get reading the ticket and this code here, they ended up ditching tiny-lr but are still using the livereload script by injecting it in their HTML response.

I think a pragmatic solution would be to create a new package which uses tiny-lr and a static file server as a replacement for live-server. tiny-lr is quite popular and is used by big projects like gitbook , ember-cli, ionic, facebook/Docusaurus and even documentation.js. So I guess we can consider it to be fairly reliable.

One downside, also mentioned in mattdesl/budo#194, tiny-lr is a bit old and feature development is not very active.

What do you guys think?

@davidtheclark
Copy link
Contributor

@kepta How long do you think it would take to create a timeboxed proof of concept? That might be a place to start.

@kepta
Copy link
Contributor

kepta commented Oct 2, 2018

As per our last discussion, we have decided to move towards webpack-dev-server as a replacement for live-server. This might be easy for certain projects, but not exactly sure how much of a lift it would be for batfish.

@jseppi
Copy link
Contributor

jseppi commented Oct 18, 2018

Since yesterday, I have been seeing Error: Cannot find module 'opn' when running batfish build.

I get that error during the batfish build. I can reproduce consistently by running: rm -rf node_modules && npm install && npm run build

The error gets resolved if I do a second npm install and npm run build.

opn is a dependency of live-server, which is a dependency of batfish. It was happening a bunch yesterday, then stopped for a bit, and now it is back again.

I also tried adding opn directly to my project's package.json, which fixed that specific Cannot find module error, but then the same error happened for a different live-server dependency.

Edit: The Cannot find module errors happen on Node v6.11.1, but do not happen on Node v8.x

@davidtheclark
Copy link
Contributor

I think that we should revert to using browser-sync. Although it's an unnecessarily large dependency, we don't have a viable alternative. I will change the title of this issue to be specific about that.

@davidtheclark davidtheclark changed the title Find a replacement for live-server Replace live-server with browser-sync Oct 25, 2018
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

Successfully merging a pull request may close this issue.

4 participants