From ee55431fef3b17a8eb786d28f79c1c5b08ab7e34 Mon Sep 17 00:00:00 2001 From: Project516 <138796702+Project516@users.noreply.github.com> Date: Sun, 8 Nov 2026 14:52:01 -0600 Subject: [PATCH 1/2] feat: put each JDK module but java.base in its own image file, so a host can leave out the ones its pages never load --- AGENTS.md | 2 +- README.md | 7 ++-- docs/browser.md | 22 ++++++----- docs/development.md | 3 +- scripts/build-web.ts | 81 +++++++++++++++++++++++++++++++++++------ src/browser/http.ts | 57 ++++++++++++++++++++++++++--- src/image.ts | 14 +++---- src/jimage.ts | 4 +- test/http-files.test.ts | 53 ++++++++++++++++++++++++++- test/image.test.ts | 31 +++++++++++++++- 10 files changed, 231 insertions(+), 43 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index f954c84..edce841 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -32,7 +32,7 @@ Node, which is how the tests run. IndexedDB and one VM per about:blank iframe. Keep these working. - The release form is an npm package of the built files only (`java-web.js`, `java-web-worker.js`, `node.js` (the Node entry), `cli.js` (the - `java-web` command), `boot.pack`, `jdk/image.jar`, + `java-web` command), `boot.pack`, the `jdk/*.jar` image files, `jdk/javac.pack`, and OpenJDK's notices in `jdk/legal/`), versioned, with nothing built at install. A GitHub Actions workflow triggered by a release publishes it to npm; never publish by hand. diff --git a/README.md b/README.md index 64b36ba..95daa84 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,9 @@ and its page API matches CheerpJ's, so existing pages can switch. pnpm add @project516/java-web ``` -Serve `node_modules/@project516/java-web/dist/` as static files (on GitHub -Pages, deploy from Actions: a `gh-pages` branch cannot hold the 120 MB -`jdk/image.jar`; on a project site, `/app/` is `user.github.io`, so files are -under `/app//`), then: +Serve `node_modules/@project516/java-web/dist/` as static files (on a GitHub +Pages project site, `/app/` is the site root `user.github.io`, so the page's +files are under `/app//`), then: ```html diff --git a/docs/browser.md b/docs/browser.md index 855e21a..aa245bd 100644 --- a/docs/browser.md +++ b/docs/browser.md @@ -5,15 +5,19 @@ The npm package holds the built files: `java-web.js`, `java-web-worker.js`, and load `java-web.js` with a classic `