brownplt / code.pyret.org

Website for serving Pyret to folks.
Other
24 stars 45 forks source link

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

Open asolove opened 8 months ago

asolove commented 8 months ago

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:

jpolitz commented 8 months ago

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 commented 8 months ago

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 commented 5 months ago

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...