feat(core/core-amqp): migrate to #platform/* imports#38198
Merged
deyaaeldeen merged 3 commits intomainfrom Apr 24, 2026
Merged
Conversation
703ca08 to
3003129
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates @azure/core-amqp to #platform/* conditional imports to select platform-specific implementations (browser/react-native vs node), and updates the package’s build/test/lint configuration to support per-platform outputs.
Changes:
- Introduces
#platform/*conditional imports for HMAC-SHA256, network connectivity checks, and runtime info, wired viapackage.json#imports. - Migrates to per-platform
tsconfigfiles undersdk/core/core-amqp/config/and updates Warp + ESLint configuration accordingly. - Updates Vitest browser configuration and removes
@azure-tools/vite-plugin-browser-test-mapfrom this package’s devDependencies (with lockfile updates).
Reviewed changes
Copilot reviewed 22 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/core/core-amqp/warp.config.yml | Points Warp targets to new per-platform tsconfigs under ./config/. |
| sdk/core/core-amqp/vitest.browser.config.ts | Switches browser Vitest config to shared eng/vitestconfigs/browser.config.ts and drops browser test map plugin usage. |
| sdk/core/core-amqp/tsconfig.test.node.json | Removed legacy test tsconfig in favor of config/ equivalents. |
| sdk/core/core-amqp/tsconfig.test.json | Removed legacy solution-style test references config. |
| sdk/core/core-amqp/tsconfig.src.json | Removed legacy src tsconfig in favor of per-platform tsconfigs. |
| sdk/core/core-amqp/tsconfig.snippets.json | Removed legacy snippets tsconfig in favor of config/tsconfig.snippets.json. |
| sdk/core/core-amqp/tsconfig.samples.json | Removed legacy samples tsconfig (now handled via new config layout). |
| sdk/core/core-amqp/tsconfig.json | Updates project references to per-platform config/tsconfig.*.json files. |
| sdk/core/core-amqp/tsconfig.browser.config.json | Removed legacy browser test tsconfig mapping dist paths. |
| sdk/core/core-amqp/src/util/react-native.d.ts | Removes local react-native module typing shim. |
| sdk/core/core-amqp/src/util/hmacSha256-web.mts | Adds web entrypoint re-export for HMAC signing. |
| sdk/core/core-amqp/src/util/hmacSha256-react-native.mts | Removes react-native polyfill file (now selected via #platform/*). |
| sdk/core/core-amqp/src/util/checkNetworkConnection-web.mts | Updates web/RN connectivity check implementation to use globalThis.navigator.onLine. |
| sdk/core/core-amqp/src/util/checkNetworkConnection-react-native.mts | Removes react-native polyfill file (now selected via #platform/*). |
| sdk/core/core-amqp/src/util/checkNetworkConnection-browser.mts | Removes browser polyfill file (now selected via #platform/*). |
| sdk/core/core-amqp/src/retry.ts | Switches to #platform/checkNetworkConnection import. |
| sdk/core/core-amqp/src/auth/tokenProvider.ts | Switches to #platform/hmacSha256 import. |
| sdk/core/core-amqp/src/ConnectionContextBase.ts | Switches to #platform/runtimeInfo import. |
| sdk/core/core-amqp/package.json | Adds imports mappings for #platform/*, updates test scripts, removes vite-plugin-browser-test-map devDependency. |
| sdk/core/core-amqp/eslint.config.mjs | Updates ESLint flat config to use config/tsconfig.lint.json for TS-aware linting. |
| sdk/core/core-amqp/config/tsconfig.test.react-native.json | Adds new RN test tsconfig under config/. |
| sdk/core/core-amqp/config/tsconfig.test.browser.json | Adds new browser test tsconfig under config/. |
| sdk/core/core-amqp/config/tsconfig.src.react-native.json | Adds new RN build tsconfig under config/. |
| sdk/core/core-amqp/config/tsconfig.src.browser.json | Adds new browser build tsconfig under config/. |
| pnpm-lock.yaml | Updates lockfile to reflect @azure-tools/vite-plugin-browser-test-map removal from this package. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
sdk/core/core-amqp/src/util/checkNetworkConnection-web.mts:11
globalThis.navigator.onLineis accessed unconditionally here. In environments wherenavigatoris missing (notably some React Native runtimes or non-DOM JS contexts), this will throw at runtime even though the type assertion compiles. Consider guarding forglobalThis.navigator/onLineand returning a safe default when unavailable.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3003129 to
9ee7beb
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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-amqpto#platform/*conditional imports:#platform/hmacSha256— platform-specific HMAC-SHA256 (Web Crypto vs Node crypto)#platform/checkNetworkConnection— platform-specific network checkconfig/, updated eslint/vitest/warp configs@azure-tools/vite-plugin-browser-test-mapremoval)