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
Faster, simpler and more robust debug/bench build setup #3019
Conversation
@anandthakker we used Budo before, but @lucaswoj dropped it as a part of #2231. I still prefer |
It's worth noting that the main reason I split the servers back is that the debug server becomes ultra-fast — it starts from scratch in just a few seconds (the first watchify build takes ~1.7s). The benchmark server, which is needed less often, starts up with a build in ~15s. However with this setup, I can actually change the scripts so that |
I'm sold 👍 |
"build-token": "browserify debug/access-token-src.js --debug -t envify > debug/access-token.js", | ||
"watch-bench": "watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v", | ||
"download-bench-data": "node bench/download-data.js", | ||
"start-server": "st --no-cache --localhost --port 9966 --index index.html .", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mourner is there an easy way to increment the port until an open one is found? Asking because budo
by default uses the same one, and I've definitely run into collisions while developing on gl-js.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know of an easy way but I could do a PR to st
or make a wrapper in a Node script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened an st
issue isaacs/st#81, will follow-up with a PR if the idea is approved.
This looks great! I love how this simplifies our debug server into small, sharp, and composable tools. Mixing generated and source files in the same directory adds clutter and is potentially confusing (e.g. The previous URL structure was cleaner. I appreciate that it's tricky to recreate without using a more sophisticated server like |
I agree about generated files — would it suffice to move What are your concerns about the new url structure? I find it cleaner than the previous one because it's explicit and predictable, without "magic" — for every referenced URL, it's clear where it comes from. The original |
Just to be clear, I'd like to land this PR as soon as possible because the current situation is severely crippling my ability to work on GL JS productively, and it's hard to appreciate the elegance of the URL design when every page request takes half a minute. We can flesh out the nuances in follow-up PRs. |
Switched to |
Closes #3014.
Greatly improves our debug and benchmark setup by using a set of NPM scripts that rely on
watchify
andst
, removing the customserver.js
script withexpress
andbrowserify-middleware
.Introduces 3 independent server scripts:
npm run start-debug
watches gl-js code and runs a static server for debug pages in parallel; you access them throughlocalhost:9966/debug/
npm run start-bench
downloads bench data, watches all benchmark-related code and runs a static server; you access benchmarks throughlocalhost:9966/bench/
; append#fps
to run the FPS benchmark, etc.npm start
combines the two aboveWith this setup, any code change is updated on the pages in 200-300ms instead of 20 seconds, making GL JS development pleasant again. It's also much simpler and more reliable.