-
Notifications
You must be signed in to change notification settings - Fork 157
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
[refactor] overhaul bundle
& run
cli commands
#58
[refactor] overhaul bundle
& run
cli commands
#58
Conversation
Changes * adds configurable favicon.ico * add build date and WASM4 version metadata * add configurable title * add configurable description * runtime/web can now optionally (see build:inline) inline wasm4.js, wasm4.css and the cartridge * faster HTML loading time when inlining the cartridge. References * https://v8.dev/blog/cost-of-javascript-2019#json * script[type="application/json"] -> https://www.youtube.com/watch?v=ff4fgQxPaO0 * https://underscorejs.org/#template * https://lodash.com/docs/4.17.15#template
✔️ Deploy Preview for wasm4 ready! 🔨 Explore the source changes: ad9d29b 🔍 Inspect the deploy log: https://app.netlify.com/sites/wasm4/deploys/61335cd28544ce00083aef79 😎 Browse the preview: https://deploy-preview-58--wasm4.netlify.app/embed |
I think we should avoid adding webpack as a dependency to the CLI. Webpack is a necessary evil for building the JS runtime, but I'd like to keep the CLI as small and dependency-free as possible. Adding |
I'd like to add configurable description, title & favicon but manipulating html with regex can be really problematic. Is cheerio ok? Alternatives? |
I wonder if it wouldn't be better to include a separate html file for the bundle template. It could be rendered using something like mustache. That might involve duplicating some parts of index.html, but I feel like it would be much simpler... As an extra, maybe we can move the gamepad divs and other elements that are currently in index.html into the runtime JS to remove duplication. About the favicon, is it possible to base64 an image data URL to use as the favicon? That would be pretty cool if so! |
Other changes: * fix aduros#67 * perf: improve html parsing speed See also aduros#58 References: * https://mathiasbynens.be/notes/etago#html5 * https://html.spec.whatwg.org/multipage/parsing.html#script-data-end-tag-open-state * https://handlebarsjs.com/guide/ * https://v8.dev/blog/cost-of-javascript-2019#json * script[type="application/json"] -> https://www.youtube.com/watch?v=ff4fgQxPaO0
Description
This is an ongoing effort to overhaul
run
andbundle
commands.Goals
run
&bundle
should reuse the same config provided byruntimes/web/webpack.config.js
.bundle
.To do
runtimes/web/webpack.config.js
runtimes/web/webpack.config.js
incli/lib/bundle.js
.runtimes/web/webpack.config.js
incli/lib/server.js
.bundle
optionsdescription
title
favicon
.