René's URL Explorer Experiment


Title: Build the formatter as a WebAssembly module for the playground by abashev · Pull Request #196 · openjavaformat/open-java-format · GitHub

Open Graph Title: Build the formatter as a WebAssembly module for the playground by abashev · Pull Request #196 · openjavaformat/open-java-format

X Title: Build the formatter as a WebAssembly module for the playground by abashev · Pull Request #196 · openjavaformat/open-java-format

Description: Before this PR #21 asks for a playground on openjavaformat.dev that formats code in the browser, with no server and nothing sent anywhere. Nothing the project builds runs in a browser. cobr123/open-java-format-wasm-demo showed that GraalVM's Web Image backend can compile the formatter to WebAssembly, and its author offered it for the site. After this PR ==COMMIT_MSG== Every GitHub release carries open-java-format-wasm-.zip: the formatter compiled to WebAssembly, for the playground on openjavaformat.dev. ==COMMIT_MSG== Part of #21. The page itself: openjavaformat/docs#10. What open-java-format-wasm, a subproject built only with -Pwasm=true. WasmMain publishes globalThis.openJavaFormat.format(source), which runs FormatFileCallable with the command line's default options: the result is what open-java-format - writes, or its line:column: error: diagnostics. version is the release. A wasm job in release.yml. Oracle GraalVM 25.0.4, Binaryen version_133 checked by SHA-256, Node 24. It runs the tests and hands the zip to github-release, which signs it and lists it in checksums_sha256.txt like every other file. publish does not wait for it: a failed build holds back only the draft GitHub release. Nothing in ci.yml builds the module. README: a "WebAssembly module" section, and the zip in the GitHub Releases row. What the trial build found No change to the formatter was needed. Build-time initialization was: javac's message bundles and the diagnostic keys made from them, which Web Image keeps in the image heap, and Trees. Trees creates MethodHandles in its static initializer. At run time those bring in float and double compare-and-set, which Web Image fails to compile (unhandled compare in WasmGCSingleThreadedAtomicsPhase). The demo got around this by initializing much more at build time; here each class was found by building. The native image's reachability metadata carries over as it is. org.graalvm.webimage.api is a JDK module of Oracle GraalVM, not a Maven artifact. That is why the subproject stays out of the build without the flag: even its compileJava needs that JDK. -H:-AutoRunVM keeps the wrapper from starting the module itself. The page calls GraalVM.run and learns from its promise whether loading failed. Package.getImplementationVersion() is null in the module, so the version comes in as -Dopen-java-format.version. Size: 19.0 MB, 7.9 MB gzipped (the demo's is 24 to 28 MB). The zip is 8.0 MB. Speed: start-up takes 0.3 to 0.9 s. The site's example formats in 80 to 150 ms the first time and 6 to 35 ms after that. Tests wasmTest in Node. The native image's smoke cases: unformatted, formatted, broken, and the Java 25 compact source file. Every input of test-cases/**/*.case (915 of them) through the module and through the runnable jar of the same build. They agree byte for byte. A spoiled jar output fails the test. Browsers: Chromium 134, Firefox 135 and WebKit 18.4 run the module on the dev page (wasmDev), through Playwright. So do Node 24.22 and 25.8. JReleaser: jreleaserConfig -PreleaseTarget=github lists the zip. Without -PwasmModule the build stops with a message that names it. Rest of the build: ./gradlew test passes without the flag (1482 tests). Workflow: zizmor passes, and act --dryrun --job wasm resolves every step. Not run yet: the wasm job on a GitHub runner. Like github-release, it runs only on a tag, so the next release is its first real run. To build it locally you need Oracle GraalVM 25 behind GRAALVM_HOME and wasm-opt on the PATH: ./gradlew -Pwasm=true :open-java-format-wasm:wasmTest ./gradlew -Pwasm=true :open-java-format-wasm:wasmDev && jwebserver -d "$PWD/open-java-format-wasm/build/wasm-dev" Possible downsides? The toolchain. The module is built on Oracle GraalVM, free under the GFTC but not the community build, because GraalVM Community has no Web Image. The build itself is public, a workflow run from the tag. The native images stay on GraalVM Community. A failed wasm job leaves the version on Maven Central without a draft GitHub release, until "Re-run failed jobs" builds the module again. Pinned GraalVM. Web Image is experimental. The GraalVM version is pinned to the patch, and moving it is a deliberate change.

Open Graph Description: Before this PR #21 asks for a playground on openjavaformat.dev that formats code in the browser, with no server and nothing sent anywhere. Nothing the project builds runs in a browser. cobr123/open...

X Description: Before this PR #21 asks for a playground on openjavaformat.dev that formats code in the browser, with no server and nothing sent anywhere. Nothing the project builds runs in a browser. cobr123/open...

Opengraph URL: https://github.com/openjavaformat/open-java-format/pull/196

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:9e9ad555-7a7a-a222-d446-e5b28e8383ae
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA3BA:92094:65D415:8B4C2C:6AFBC691
html-safe-nonceb34da176fa1519a66294455b5581d0fccdb569e2040b1568997665f3cbe3f45b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0JBOjkyMDk0OjY1RDQxNTo4QjRDMkM6NkFGQkM2OTEiLCJ2aXNpdG9yX2lkIjoiNDA4MTY5Njg5NTY2NTk0ODMwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac137ff55ad9373ff08e145bdd58231316d5e422e8dbc6225fc11bee99d56b18bc
hovercard-subject-tagpull_request:5199832143
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/openjavaformat/open-java-format/pull/196/files
twitter:imagehttps://avatars.githubusercontent.com/u/214171?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/214171?s=400&v=4
og:image:altBefore this PR #21 asks for a playground on openjavaformat.dev that formats code in the browser, with no server and nothing sent anywhere. Nothing the project builds runs in a browser. cobr123/open...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned440bda0d812801778b27bfe9f7c1ce9ff22420c73f6f95150c4fcbca311c50b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/openjavaformat/open-java-format git https://github.com/openjavaformat/open-java-format.git
octolytics-dimension-user_id325177626
octolytics-dimension-user_loginopenjavaformat
octolytics-dimension-repository_id1288055459
octolytics-dimension-repository_nwoopenjavaformat/open-java-format
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id214273098
octolytics-dimension-repository_parent_nwopalantir/palantir-java-format
octolytics-dimension-repository_network_root_id214273098
octolytics-dimension-repository_network_root_nwopalantir/palantir-java-format
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2c43021aed8695990c86c0eaaedc600bfeffec36
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/openjavaformat/open-java-format/pull/196/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fpull%2F196%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fpull%2F196%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=openjavaformat%2Fopen-java-format
Reloadhttps://github.com/openjavaformat/open-java-format/pull/196/files
Reloadhttps://github.com/openjavaformat/open-java-format/pull/196/files
Reloadhttps://github.com/openjavaformat/open-java-format/pull/196/files
openjavaformathttps://github.com/openjavaformat
open-java-formathttps://github.com/openjavaformat/open-java-format
Codehttps://github.com/openjavaformat/open-java-format
Issues30 (30)https://github.com/openjavaformat/open-java-format/issues
Pull requests5 (5)https://github.com/openjavaformat/open-java-format/pulls
Discussionshttps://github.com/openjavaformat/open-java-format/discussions
Actionshttps://github.com/openjavaformat/open-java-format/actions
Security and qualityhttps://github.com/openjavaformat/open-java-format/security
Insightshttps://github.com/openjavaformat/open-java-format/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fopenjavaformat%2Fopen-java-format%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fopenjavaformat%2Fopen-java-format%2Fissues%2Fnew%2Fchoose
abashevhttps://github.com/abashev
21.X.Xhttps://github.com/openjavaformat/open-java-format/tree/21.X.X
abashev/try-a-webassembly-build-for-an-in-browser-playgrhttps://github.com/openjavaformat/open-java-format/tree/abashev/try-a-webassembly-build-for-an-in-browser-playgr
Conversation 0 https://github.com/openjavaformat/open-java-format/pull/196
Commits 2 https://github.com/openjavaformat/open-java-format/pull/196/commits
Checks 17 https://github.com/openjavaformat/open-java-format/pull/196/checks
Files changed https://github.com/openjavaformat/open-java-format/pull/196/files
Please reload this pagehttps://github.com/openjavaformat/open-java-format/pull/196/files
Build the formatter as a WebAssembly module for the playground https://github.com/openjavaformat/open-java-format/pull/196/files#top
Show all changes 2 commits https://github.com/openjavaformat/open-java-format/pull/196/files
7a3c122 Build the formatter as a WebAssembly module abashev Nov 7, 2026 https://github.com/openjavaformat/open-java-format/pull/196/commits/7a3c1221dce8b906041693e1d1438b8d412b538f
991f2d1 Attach the WebAssembly module to the GitHub release abashev Nov 7, 2026 https://github.com/openjavaformat/open-java-format/pull/196/commits/991f2d12defe249fc86fd9e53339239b29f1cc0a
Clear filters https://github.com/openjavaformat/open-java-format/pull/196/files
Please reload this pagehttps://github.com/openjavaformat/open-java-format/pull/196/files
Please reload this pagehttps://github.com/openjavaformat/open-java-format/pull/196/files
release.yml https://github.com/openjavaformat/open-java-format/pull/196/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34
README.md https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
open-java-format.release-conventions.gradle https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b419e6c2446d9be0cd4360d3d323377c6e226eab0753f29472acfd4c7abe564e
build.gradle https://github.com/openjavaformat/open-java-format/pull/196/files#diff-e3eb1d56cf3bab31babc4f9c55ae48e2b0334ad0c79900c0e15db5fdc09e713e
index.html https://github.com/openjavaformat/open-java-format/pull/196/files#diff-7a298fe3fc5b0e9f0ba73ce4c627f05cba8e197b91054c37161913604b2cfeb6
WasmMain.java https://github.com/openjavaformat/open-java-format/pull/196/files#diff-375201c50cf8c3fd73d36aa09cf9a0aae8a1f16701a27bc15307cd8d49f12a0a
differential.mjs https://github.com/openjavaformat/open-java-format/pull/196/files#diff-d87d6b317e6be1afb1741168468e7e0eac87bb71b4df9cb68afcf1f9383dda2b
load.mjs https://github.com/openjavaformat/open-java-format/pull/196/files#diff-e020bf2a3fea434bc3715c06b3f9d7782b1efeca98ad7c5fe088624f4aa46588
smoke.mjs https://github.com/openjavaformat/open-java-format/pull/196/files#diff-81815b2e1f1d1e832ca11fd19c2c72f27ecf97674440c574fa1f596d8152e309
settings.gradle https://github.com/openjavaformat/open-java-format/pull/196/files#diff-7f825392aa37acd1cee0c2e7b9bb7366ad6eac64f3e6cdd816e156bcb69d30de
.github/workflows/release.ymlhttps://github.com/openjavaformat/open-java-format/pull/196/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34
View file https://github.com/openjavaformat/open-java-format/blob/991f2d12defe249fc86fd9e53339239b29f1cc0a/.github/workflows/release.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openjavaformat/open-java-format/pull/196/{{ revealButtonHref }}
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34
README.mdhttps://github.com/openjavaformat/open-java-format/pull/196/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
View file https://github.com/openjavaformat/open-java-format/blob/991f2d12defe249fc86fd9e53339239b29f1cc0a/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openjavaformat/open-java-format/pull/196/{{ revealButtonHref }}
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
buildSrc/src/main/groovy/open-java-format.release-conventions.gradlehttps://github.com/openjavaformat/open-java-format/pull/196/files#diff-b419e6c2446d9be0cd4360d3d323377c6e226eab0753f29472acfd4c7abe564e
View file https://github.com/openjavaformat/open-java-format/blob/991f2d12defe249fc86fd9e53339239b29f1cc0a/buildSrc/src/main/groovy/open-java-format.release-conventions.gradle
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openjavaformat/open-java-format/pull/196/{{ revealButtonHref }}
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b419e6c2446d9be0cd4360d3d323377c6e226eab0753f29472acfd4c7abe564e
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b419e6c2446d9be0cd4360d3d323377c6e226eab0753f29472acfd4c7abe564e
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b419e6c2446d9be0cd4360d3d323377c6e226eab0753f29472acfd4c7abe564e
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b419e6c2446d9be0cd4360d3d323377c6e226eab0753f29472acfd4c7abe564e
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b419e6c2446d9be0cd4360d3d323377c6e226eab0753f29472acfd4c7abe564e
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b419e6c2446d9be0cd4360d3d323377c6e226eab0753f29472acfd4c7abe564e
https://github.com/openjavaformat/open-java-format/pull/196/files#diff-b419e6c2446d9be0cd4360d3d323377c6e226eab0753f29472acfd4c7abe564e
open-java-format-wasm/build.gradlehttps://github.com/openjavaformat/open-java-format/pull/196/files#diff-e3eb1d56cf3bab31babc4f9c55ae48e2b0334ad0c79900c0e15db5fdc09e713e
View file https://github.com/openjavaformat/open-java-format/blob/991f2d12defe249fc86fd9e53339239b29f1cc0a/open-java-format-wasm/build.gradle
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openjavaformat/open-java-format/pull/196/{{ revealButtonHref }}
open-java-format-wasm/src/dev/index.htmlhttps://github.com/openjavaformat/open-java-format/pull/196/files#diff-7a298fe3fc5b0e9f0ba73ce4c627f05cba8e197b91054c37161913604b2cfeb6
View file https://github.com/openjavaformat/open-java-format/blob/991f2d12defe249fc86fd9e53339239b29f1cc0a/open-java-format-wasm/src/dev/index.html
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/openjavaformat/open-java-format/pull/196/{{ revealButtonHref }}
Please reload this pagehttps://github.com/openjavaformat/open-java-format/pull/196/files
Please reload this pagehttps://github.com/openjavaformat/open-java-format/pull/196/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.