Skip to content

[http-client-java] Remove Node APIs outside Java execution - #12511

Merged
Timothee Guerin (timotheeguerin) merged 2 commits into
microsoft:mainfrom
timotheeguerin:java-browser-cleanup
Nov 6, 2026
Merged

Timothee Guerin (timotheeguerin) merged 2 commits into
microsoft:mainfrom
timotheeguerin:java-browser-cleanup

Conversation

@timotheeguerin

Copy link
Copy Markdown
Member

The Java emitter uses Node-only assertions and filesystem helpers outside the native generator runner. These dependencies complicate running the emitter in the playground and mix portability cleanup into the WASM work.

Use compilerAssert for model invariants and compiler-host APIs for directory creation and resource-path resolution. This separates the runtime-independent cleanup from the Java playground prototype: Azure/typespec-azure#5988.

The runtime-source scan leaves only child_process, used for java -version and launching the generator JAR. Those paths are unchanged and remain for the WASM follow-up; this PR does not enable browser execution by itself.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:java Issue for the Java client emitter: @typespec/http-client-java label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • ✅ @typespec/http-client-java
Show changes

@typespec/http-client-java - internal ✏️

Replace Node.js assertions and filesystem utilities with compiler APIs in the Java emitter, preparing for browser-based generation without changing native Java execution.

@azure-sdk-automation

azure-sdk-automation Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the Java emitter’s compiler-API cleanup.

No open issues 🎉

What changed in this PR

This PR reduces Node.js dependencies in the Java emitter by using TypeSpec compiler APIs outside native Java execution. It prepares for future playground support but does not enable browser execution itself.

Changes:

  • Replace Node assertions with compilerAssert for model invariants.
  • Use compiler-host APIs for directory creation and resource-path resolution.
  • Add an internal changelog entry; native Java process execution remains unchanged.
File Description
packages/​http-client-java/​emitter/​src/​emitter.ts Replace Node filesystem and path helpers with compiler APIs.
packages/​http-client-java/​emitter/​src/​code-model-builder.ts Replace Node assertion failures with compiler assertions.
.chronus/​changes/​http-client-java-browser-safe-utilities.md Document the internal portability cleanup.

Review effort: Balanced

Merged via the queue into microsoft:main with commit 8e3ddc2 Nov 6, 2026
36 checks passed
@timotheeguerin
Timothee Guerin (timotheeguerin) deleted the java-browser-cleanup branch November 6, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:java Issue for the Java client emitter: @typespec/http-client-java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants