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

Recommend spago's --watch feature in automatic reload instructions #71

Closed
jhrcek opened this issue Mar 5, 2020 · 6 comments
Closed

Comments

@jhrcek
Copy link
Contributor

jhrcek commented Mar 5, 2020

In https://github.com/JordanMartinez/learn-halogen/blob/latestRelease/src/01-Static-HTML/01-Static-HTML.md#automatic-reload there's a recommendation of using watchexec tool for automatic rebuilding of purs source files. Instead of introducing another external tool, it might be better to recommend spago's --watch feature which achieves the same without requiring external tool. I can make a PR if you agree with my proposal.

@jhrcek jhrcek changed the title Recommend spago's --watch feature in Recommend spago's --watch feature in automatic reload instructions Mar 5, 2020
@JordanMartinez
Copy link
Owner

@milesfrain Since you added #63, do you care to comment on this?

@JordanMartinez
Copy link
Owner

@jhrcek If we don't here from milesfrain in 3 days, then go for it. AFAICT, they do the same thing but the watchexec install is not necessary. I think I thought watchexec did more than just recompile the code (e.g. reload the page, too).

@jhrcek
Copy link
Contributor Author

jhrcek commented Mar 6, 2020

When you have parcel serve ... running in one terminal window and run spago build --watch ... in another terminal it reloads the code live in the browser after saving the .purs file in the editor, so to me it feels functionally equivalent to using watchexec.

@JordanMartinez
Copy link
Owner

Functionally equivalent, yes, but the extra terminal window may put off others, too. I think I found that part annoying myself. That could be fixed if there was Spago-integration for Parcel.

@milesfrain
Copy link
Contributor

@jhrcek I agree with your proposal.

I added this note after reading purescript/spago#65, but somehow missed that the --watch flag also works with bundle-app.

A small annoyance with either of these workflows is that there's a fairly noticeable delay between file save and page reload (at least on my slower machine). It may be nice to encourage some other faster options, such as psc-ide + parcel (demonstrated here). Another possibility is to configure this learning repo with purescript-halogen-storybook, so users can jump to the next example without running another rebuild command.

@JordanMartinez
Copy link
Owner

Ok, @jhrcek would you mind submitting a PR that removes watchexec and uses spago with the -w flag instead?

Another possibility is to configure this learning repo with purescript-halogen-storybook, so users can jump to the next example without running another rebuild command.

I like this idea. Let's track this in another issue.

JordanMartinez added a commit that referenced this issue Mar 10, 2020
Recommend spago --watch over watchexec (closes #71)
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

3 participants