feat(core/core-sse): migrate to #platform/* imports#38206
Open
deyaaeldeen wants to merge 1 commit intomainfrom
Open
feat(core/core-sse): migrate to #platform/* imports#38206deyaaeldeen wants to merge 1 commit intomainfrom
deyaaeldeen wants to merge 1 commit intomainfrom
Conversation
81e9ce2 to
54547d9
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates @azure/core-sse to use #platform/* conditional imports so that Node-only types and stream cancellation logic can be expressed in a platform-safe way across Node, browser, and React Native builds.
Changes:
- Introduces
#platform/typeswith per-platform implementations (types.ts,types-browser.mts,types-react-native.mts) and updates SSE utilities to consume it. - Splits build/test TypeScript configuration into per-platform
config/tsconfigs and updates warp/vitest/eslint to match. - Updates the public API reports to reflect the platform-specific typing differences (e.g.,
NodeIncomingMessage/NodeJSReadableStreamasneveroutside Node).
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/core/core-sse/warp.config.yml | Switches to an explicit multi-target warp config pointing at per-platform tsconfigs. |
| sdk/core/core-sse/vitest.browser.config.ts | Re-exports the shared browser vitest config from eng/vitestconfigs. |
| sdk/core/core-sse/tsconfig.test.node.json | Deletes old root-level test tsconfig (moved under config/). |
| sdk/core/core-sse/tsconfig.test.json | Deletes old root-level composite test references (now in tsconfig.json + config/). |
| sdk/core/core-sse/tsconfig.src.json | Deletes old root-level src tsconfig (replaced by per-platform ones). |
| sdk/core/core-sse/tsconfig.snippets.json | Deletes old root-level snippets tsconfig (moved under config/). |
| sdk/core/core-sse/tsconfig.samples.json | Deletes old root-level samples tsconfig (moved under config/). |
| sdk/core/core-sse/tsconfig.json | Updates project references to new per-platform tsconfigs under config/. |
| sdk/core/core-sse/tsconfig.browser.config.json | Deletes old browser config tsconfig (replaced by config/tsconfig.test.browser.json). |
| sdk/core/core-sse/src/utils.ts | Switches Node stream typing/cancellation to #platform/types and factors cancel logic into cancelNodeStream. |
| sdk/core/core-sse/src/types.ts | Adds Node implementation of NodeIncomingMessage, NodeJSReadableStream, and cancelNodeStream. |
| sdk/core/core-sse/src/types-react-native.mts | Adds RN stubs for missing DOM types + defines Node types as never and a no-op canceller. |
| sdk/core/core-sse/src/types-browser.mts | Adds browser stubs defining Node types as never and a no-op canceller. |
| sdk/core/core-sse/src/sse.ts | Replaces IncomingMessage with NodeIncomingMessage from #platform/types and inlines PartialSome. |
| sdk/core/core-sse/src/models.ts | Re-exports platform-specific NodeIncomingMessage/NodeJSReadableStream types from #platform/types. |
| sdk/core/core-sse/src/index.ts | Exports NodeIncomingMessage publicly alongside existing types. |
| sdk/core/core-sse/review/core-sse-react-native.api.diff.md | Adds RN API diff showing Node-only types become never. |
| sdk/core/core-sse/review/core-sse-node.api.md | Updates Node API report to use/export NodeIncomingMessage. |
| sdk/core/core-sse/review/core-sse-browser.api.diff.md | Adds browser API diff showing Node-only types become never. |
| sdk/core/core-sse/package.json | Adds imports mapping for #platform/types and updates scripts to use new config/ tsconfigs. |
| sdk/core/core-sse/eslint.config.mjs | Adopts config-array style and points ESLint parser at config/tsconfig.lint.json. |
| sdk/core/core-sse/config/tsconfig.test.react-native.json | New RN test tsconfig extending eng/tsconfigs/test.react-native.json. |
| sdk/core/core-sse/config/tsconfig.test.browser.json | New browser test tsconfig extending eng/tsconfigs/test.browser.json. |
| sdk/core/core-sse/config/tsconfig.src.react-native.json | New RN src tsconfig extending eng/tsconfigs/src.react-native.json. |
| sdk/core/core-sse/config/tsconfig.src.browser.json | New browser src tsconfig extending eng/tsconfigs/src.browser.json. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
54547d9 to
da636ae
Compare
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-sseto#platform/*conditional imports:#platform/types— platform-specific types forIncomingMessage,NodeJSReadableStream, and stream cancellationtypes-browser.mtsandtypes-react-native.mtsconfig/, updated eslint/vitest/warp configs