Skip to content

Split createRequestHandler into smaller functions - #5187

Merged
Joel Hendrix (jhendrixMSFT) merged 1 commit into
Azure:mainfrom
jhendrixMSFT:go-request-handler
Aug 7, 2026
Merged

Split createRequestHandler into smaller functions#5187
Joel Hendrix (jhendrixMSFT) merged 1 commit into
Azure:mainfrom
jhendrixMSFT:go-request-handler

Conversation

@jhendrixMSFT

Copy link
Copy Markdown
Member

Moved most inline lambdas to discrete functions and added doc comments. The small ones used in one place were replaced with inline code.

No functional changes.

@jhendrixMSFT
Joel Hendrix (jhendrixMSFT) requested a balanced review from Copilot August 7, 2026 21:28
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:go Issues for @azure-tools/typespec-go emitter label Aug 7, 2026

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.

Pull request overview

Refactors Go request-handler generation by extracting inline lambdas into documented helper functions.

Changes:

  • Extracts parameter, header, path, query, and body helpers.
  • Adds an internal Chronus change entry.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/typespec-go/src/codegen/core/request-handler.ts Refactors request-generation logic.
.chronus/changes/main-2026-7-7-14-22-54.md Records the internal refactor.

Comment thread packages/typespec-go/src/codegen/core/request-handler.ts Outdated
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @azure-tools/typespec-go
Show changes

@azure-tools/typespec-go - internal ✏️

Split createRequestHandler into smaller functions.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📦 Package size report

✅ No notable package size changes compared to the base branch.

13 package(s) with no notable change
Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-go 244.29 KB → 244.79 KB +510 B (+0.2%) 1.24 MB → 1.25 MB +2.70 KB (+0.2%)
@azure-tools/typespec-java 13.51 MB → 13.51 MB -175 B (-0.0%) 15.03 MB → 15.03 MB
@azure-tools/azure-http-specs 146.21 KB → 146.21 KB 1.16 MB → 1.16 MB
@azure-tools/typespec-autorest 80.93 KB → 80.93 KB 395.06 KB → 395.06 KB
@azure-tools/typespec-autorest-canonical 7.42 KB → 7.42 KB 26.00 KB → 26.00 KB
@azure-tools/typespec-azure-core 128.11 KB → 128.11 KB 696.78 KB → 696.78 KB
@azure-tools/typespec-azure-portal-core 42.40 KB → 42.40 KB 192.87 KB → 192.87 KB
@azure-tools/typespec-azure-resource-manager 171.29 KB → 171.29 KB 1.04 MB → 1.04 MB
@azure-tools/typespec-azure-rulesets 5.15 KB → 5.15 KB 31.73 KB → 31.73 KB
@azure-tools/typespec-client-generator-core 226.23 KB → 226.23 KB 1.22 MB → 1.22 MB
@azure-tools/typespec-metadata 15.91 KB → 15.91 KB 62.26 KB → 62.26 KB
@azure-tools/typespec-python 46.21 KB → 46.21 KB 180.83 KB → 180.83 KB
@azure-tools/typespec-ts 524.66 KB → 524.66 KB 2.53 MB → 2.53 MB

Packed = gzipped .tgz published to npm. Unpacked = total extracted size. 🆕 added, 🗑️ removed. Packages from the core/ submodule are not included.
🔴 grew · 🟢 shrank — only changes of at least 512 B and 0.5% are marked.

@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-go@5187

commit: 932714d

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

Moved most inline lambdas to discrete functions and added doc comments.
The small ones used in one place were replaced with inline code.
@jhendrixMSFT
Joel Hendrix (jhendrixMSFT) added this pull request to the merge queue Aug 7, 2026
Merged via the queue into Azure:main with commit fdd7448 Aug 7, 2026
38 checks passed
@jhendrixMSFT
Joel Hendrix (jhendrixMSFT) deleted the go-request-handler branch August 7, 2026 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:go Issues for @azure-tools/typespec-go emitter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants