Skip to content

feat(core/core-sse): migrate to #platform/* imports#38206

Open
deyaaeldeen wants to merge 1 commit intomainfrom
platform-imports/core-sse
Open

feat(core/core-sse): migrate to #platform/* imports#38206
deyaaeldeen wants to merge 1 commit intomainfrom
platform-imports/core-sse

Conversation

@deyaaeldeen
Copy link
Copy Markdown
Member

@deyaaeldeen deyaaeldeen commented Apr 18, 2026

Migrate @azure/core-sse to #platform/* conditional imports:

  • #platform/types — platform-specific types for IncomingMessage, NodeJSReadableStream, and stream cancellation
  • Extracted browser/RN type stubs into types-browser.mts and types-react-native.mts
  • Per-platform tsconfigs under config/, updated eslint/vitest/warp configs

@deyaaeldeen deyaaeldeen force-pushed the platform-imports/core-sse branch 13 times, most recently from 81e9ce2 to 54547d9 Compare April 20, 2026 04:58
@deyaaeldeen deyaaeldeen marked this pull request as ready for review April 20, 2026 19:17
@deyaaeldeen deyaaeldeen requested a review from a team as a code owner April 20, 2026 19:17
Copilot AI review requested due to automatic review settings April 20, 2026 19:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/types with 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/NodeJSReadableStream as never outside 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.

Comment thread sdk/core/core-sse/eslint.config.mjs Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@deyaaeldeen deyaaeldeen force-pushed the platform-imports/core-sse branch from 54547d9 to da636ae Compare April 20, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants