Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Adds live-reload with LiveReloadPlugin #1027

Merged
merged 5 commits into from
Apr 17, 2018
Merged

Conversation

paganotoni
Copy link
Member

This PR adds live CSS and JS reload by using a different strategy than previous, submitting it for your consideration.

stanislas-m
stanislas-m previously approved these changes Apr 14, 2018
@markbates markbates added this to the 0.11.1 milestone Apr 14, 2018

<%= if( env == "development") { %>
<!-- For buffalo to do live js/css reload -->
<script src="http://localhost:35729/livereload.js"></script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we have javascriptTag automatically generate <script src="http://localhost:35729/livereload.js"> </script> too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems the plugin provides a way to inject this script in the header without putting it here, so i removed this portion of the changes :)

@markbates
Copy link
Member

@paganotoni @stanislas-m I know not of the magical ways for live reloading. :) is there a way to get this to trigger if a template has changed too?

@paganotoni
Copy link
Member Author

I don't see an option on the plugin for the HTML, but i will continue looking for alternatives :)

@paganotoni
Copy link
Member Author

paganotoni commented Apr 17, 2018

Ok, here is an update on reloading when HTML changes, i ended up writing a webpack plugin that is a mix between webpack-livereload-plugin and a filewatch with chokidar.

It works, but at this point, I wonder if we should just write our own Livereload websocket in Go and have refresh notify us on the change of some files that we would then send to the frontend.

cc @markbates @stanislas-m

@paganotoni
Copy link
Member Author

@markbates i'll add HTML reload support in another PR, I have a solution for it but I don't feel comfortable with it, I would like to take a bit more time reviewing alternatives.

@paganotoni paganotoni merged commit 48b485d into development Apr 17, 2018
@paganotoni paganotoni deleted the feature-livereload branch April 17, 2018 14:35
This was referenced Apr 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants