Skip to content

Migrate web-pubsub packages to #platform/* imports#38390

Draft
deyaaeldeen wants to merge 5 commits intomainfrom
platform-imports-web-pubsub
Draft

Migrate web-pubsub packages to #platform/* imports#38390
deyaaeldeen wants to merge 5 commits intomainfrom
platform-imports-web-pubsub

Conversation

@deyaaeldeen
Copy link
Copy Markdown
Member

Summary

Migrates all web-pubsub SDK packages to use the new #platform/* wildcard import subpaths pattern, replacing the old polyfillSuffix approach.

Packages Migrated

Package Platform Support Changes
@azure/web-pubsub Node-only tsconfig migration, imports field for future use
@azure/web-pubsub-client Node + Browser + React Native Full migration with #platform/* imports
@azure/web-pubsub-client-protobuf Node-only tsconfig migration, removed unused browser/RN targets
@azure/web-pubsub-express Node-only tsconfig migration, removed unused browser/RN targets

Key Changes

  • Add config/ directory with tsconfig files extending eng/tsconfigs/
  • Update warp.config.yml to extend base config
  • Add imports field in package.json for #platform/* resolution
  • Add eslint.config.mjs with projectService: false for import resolution
  • Update vitest.browser.config.ts to use eng/vitestconfigs/browser.config.ts
  • Add tsc -b --noEmit to test scripts
  • Create React Native platform files where needed
  • Remove old tsconfig files from package roots

Testing

All packages build and pass tests:

  • @azure/web-pubsub: 26 node tests
  • @azure/web-pubsub-client: 90 node tests, 90 browser tests
  • @azure/web-pubsub-client-protobuf: 26 node tests
  • @azure/web-pubsub-express: 49 node tests

deyaaeldeen and others added 5 commits May 1, 2026 23:47
- Updated warp.config.yml to extend base config
- Created config/ directory with modular tsconfig files
- Updated eslint.config.mjs with projectService: false
- Updated vitest.browser.config.ts to use source-based browser testing
- Updated scripts in package.json
- Deleted old tsconfig files from package root

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add config/ directory with ESM, CJS, browser, react-native tsconfigs
- Add imports field in package.json for #platform/* wildcard resolution
- Create websocketClient-react-native.mts platform file
- Update source imports to use #platform/websocket/websocketClient
- Update warp.config.yml to extend base config
- Add eslint.config.mjs with projectService: false for import resolution
- Update vitest.browser.config.ts to use eng/vitestconfigs/browser.config.ts
- Remove old tsconfig files (tsconfig.src.json, tsconfig.test.json, etc.)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tsconfig structure

- Add config/ directory with ESM, CJS, browser, react-native, test, samples, snippets, and lint tsconfigs
- Update tsconfig.json references to point to config/ directory
- Update api-extractor.json with explicit tsconfigFilePath
- Update test:node script to use --node-config flag
- Remove old tsconfig files from package roots

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
These packages don't support browser/react-native:
- web-pubsub-express: Express middleware (server-side only)
- web-pubsub-client-protobuf: Only supports Node.js per README

Changes:
- Override warp targets to only build esm/commonjs
- Remove react-native devDependency
- Remove imports field (not needed without platform files)
- Remove unused browser/react-native tsconfig files
- Warp auto-cleaned exports to remove browser/react-native entries

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant