feat(core/core-rest-pipeline): migrate to #platform/* imports#38205
Merged
deyaaeldeen merged 4 commits intomainfrom Apr 24, 2026
Merged
feat(core/core-rest-pipeline): migrate to #platform/* imports#38205deyaaeldeen merged 4 commits intomainfrom
deyaaeldeen merged 4 commits intomainfrom
Conversation
b65314b to
a3cb68f
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates @azure/core-rest-pipeline to internal #platform/* conditional imports to provide per-runtime implementations (browser / react-native / node) while keeping a unified public API surface.
Changes:
- Introduce
#platform/*conditional imports for user agent generation, AbortSignal wrapping, andFilecreation (with package.jsonimportsmappings). - Replace Node/browser stream & buffer types with
NodeReadableStream/NodeBuffer/WebReadableStreamfrom@typespec/ts-http-runtimeand update API reports accordingly. - Restructure build/test configuration to use per-platform tsconfigs under
config/, align eslint/vitest configs, and add a react-native Vitest config entrypoint + test script.
Reviewed changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/core/core-rest-pipeline/warp.config.yml | Points warp targets at per-platform tsconfigs under ./config/. |
| sdk/core/core-rest-pipeline/vitest.react-native.config.ts | Adds RN Vitest config re-export from eng/vitestconfigs. |
| sdk/core/core-rest-pipeline/vitest.browser.config.ts | Switches browser Vitest config to eng/vitestconfigs/browser.config.ts. |
| sdk/core/core-rest-pipeline/tsconfig.json | Updates project references to the new config/ tsconfigs. |
| sdk/core/core-rest-pipeline/tsconfig.test.node.json | Removed in favor of config/tsconfig.test.node.json. |
| sdk/core/core-rest-pipeline/tsconfig.test.json | Removed in favor of explicit config/ references. |
| sdk/core/core-rest-pipeline/tsconfig.src.json | Removed in favor of per-platform config/tsconfig.src.*.json. |
| sdk/core/core-rest-pipeline/tsconfig.snippets.json | Removed in favor of config/tsconfig.snippets.json. |
| sdk/core/core-rest-pipeline/tsconfig.samples.json | Removed in favor of config/tsconfig.samples.json. |
| sdk/core/core-rest-pipeline/tsconfig.browser.config.json | Removed in favor of config/tsconfig.test.browser.json. |
| sdk/core/core-rest-pipeline/test/util.ts | Uses @azure/core-util stringToUint8Array when collecting stream chunks. |
| sdk/core/core-rest-pipeline/test/internal/node/userAgentPlatform.spec.ts | Removes the “empty process.versions” test case. |
| sdk/core/core-rest-pipeline/test/internal/formDataPolicy.spec.ts | Adjusts arrayBuffer() access typing to avoid relying on Blob narrowing. |
| sdk/core/core-rest-pipeline/test/internal/browser/userAgentPlatform.spec.ts | Updates to import platform impl via #platform/userAgent and adds header-name assertion. |
| sdk/core/core-rest-pipeline/src/util/wrapAbortSignal-rn.mts | Adds RN-specific AbortSignal shim implementation. |
| sdk/core/core-rest-pipeline/src/util/userAgentPlatform.ts | Updates Node platform detection typing via global augmentation of NodeJS.ProcessVersions. |
| sdk/core/core-rest-pipeline/src/util/userAgentPlatform-browser.mts | Refactors browser user agent data typing and Edge runtime handling. |
| sdk/core/core-rest-pipeline/src/util/userAgent.ts | Switches to #platform/userAgent conditional import. |
| sdk/core/core-rest-pipeline/src/util/react-native.d.ts | Removes custom react-native module typing (now relying on RN types). |
| sdk/core/core-rest-pipeline/src/util/file.ts | Migrates stream/buffer types to ts-http-runtime aliases; adds createRawFile; routes createFile via #platform/createFile. |
| sdk/core/core-rest-pipeline/src/util/createFile.ts | Adds Node/default createFile implementation via createRawFile. |
| sdk/core/core-rest-pipeline/src/util/createFile-browser.mts | Adds browser/RN createFile implementation using native File. |
| sdk/core/core-rest-pipeline/src/policies/wrapAbortSignalLikePolicy.ts | Switches to #platform/wrapAbortSignal import. |
| sdk/core/core-rest-pipeline/src/interfaces.ts | Replaces Buffer/NodeJS.ReadableStream/ReadableStream types with ts-http-runtime aliases. |
| sdk/core/core-rest-pipeline/src/index.ts | Removes DOM stubs and re-exports ts-http-runtime stream/buffer types. |
| sdk/core/core-rest-pipeline/src/defaultHttpClient.ts | Switches to #platform/wrapAbortSignal import. |
| sdk/core/core-rest-pipeline/review/core-rest-pipeline-react-native.api.diff.md | Captures RN API diffs vs node baseline. |
| sdk/core/core-rest-pipeline/review/core-rest-pipeline-node.api.md | Updates node API report for new stream/buffer types and re-exports. |
| sdk/core/core-rest-pipeline/package.json | Adds imports mappings for #platform/*; updates scripts to use new config/ tsconfigs and adds RN test run. |
| sdk/core/core-rest-pipeline/eslint.config.mjs | Aligns eslint config shape with other core packages; points parser project to ./config/tsconfig.lint.json. |
| sdk/core/core-rest-pipeline/config/tsconfig.*.json | Adds per-platform src/test/samples/snippets/lint tsconfigs extending eng/tsconfigs. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
a3cb68f to
7c19ac8
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jeremymeng
reviewed
Apr 24, 2026
jeremymeng
approved these changes
Apr 24, 2026
This was referenced May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate
@azure/core-rest-pipelineto#platform/*conditional imports:#platform/userAgent— platform-specific user agent string generation#platform/wrapAbortSignal— React Native AbortSignal compatibility shim#platform/createFile— platform-specific File creation (Node raw content vs browser native)NodeJS.ReadableStream/Buffer/ReadableStreamwithNodeReadableStream/NodeBuffer/WebReadableStreamfrom@typespec/ts-http-runtimeconfig/, updated eslint/vitest/warp configs