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

modal-prompt.js changes don't get into build #505

Open
asolove opened this issue Jan 21, 2024 · 3 comments
Open

modal-prompt.js changes don't get into build #505

asolove opened this issue Jan 21, 2024 · 3 comments

Comments

@asolove
Copy link
Contributor

asolove commented Jan 21, 2024

Problem

If you have an existing build, make changes to modal-prompt.js, and then run npm run build, in the general case the modal code changes will not be in the resulting build. It appears you have to make changes to some other file (I'm not sure exactly which will work) or completely delete the current build and build from scratch, to ingest the changes.

I would like to figure out a fix because I have a bunch of modal changes I want to finish up and the current dev cycle is too slow and painful to get through them.

Research:

  • Find a quick way to tell whether changes get built (without having to load in browser)
  • Find which files trigger the changes to get into a build and which don't
  • Try to track through the Makefile to understand why.
@jpolitz
Copy link
Member

jpolitz commented Jan 23, 2024

Thanks for writing this down clearly.

There are a few workflows that have existed for a while where I have to write touch src/web/js/beforePyret.js (which is the main webpack entrypoint) before rebuilds trigger. It happens sometimes for the dev Pyret compiler/runtime, too, leading to “Pyret failed to load” until touch and rebuild.

I have tended to give up before figuring out why.

@asolove
Copy link
Contributor Author

asolove commented Jan 24, 2024

Ah! I see. So then I think the relevant chunk is this target in the Makefile:

build/web/js/beforePyret.js: src/web/js/beforePyret.js
	npx webpack

Which means that as far as make knows, it should only re-run webpack when that one file changes. I think that target should include dependencies on every file that gets included by the webpack config, so that it knows to re-run webpack if any of them change.

I can play around with getting the list exactly right.

@blerner
Copy link
Member

blerner commented Apr 30, 2024

Oh that sure sounds like a reasonable culprit! Please do find the right dependency list if you can; I got bitten by this today and forgot how annoying it was to have to guess which file to touch to make the rebuild go through...

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

3 participants