Skip to content

fix: Do not generate React Native build targets by default#3943

Open
deyaaeldeen wants to merge 6 commits intomainfrom
fix/remove-react-native-default-targets
Open

fix: Do not generate React Native build targets by default#3943
deyaaeldeen wants to merge 6 commits intomainfrom
fix/remove-react-native-default-targets

Conversation

@deyaaeldeen
Copy link
Copy Markdown
Member

@deyaaeldeen deyaaeldeen commented May 5, 2026

Addresses #3942

Previously, the SDK generator always included React Native build targets for all generated packages. This caused CI failures in the azure-sdk-for-js monorepo because most packages don't need RN support and the RN build infrastructure isn't fully set up.

Changes

Adds a new generateReactNativeTarget option (default: false) that controls whether to include:

  • react-native warp target in warp.config.yml
  • config/tsconfig.src.react-native.json reference in root tsconfig
  • react-native top-level field in package.json
  • react-native condition in package.json exports
  • react-native in package.json imports subpath patterns
  • react-native in tshy esmDialects (for non-monorepo packages)

How to opt-in

Packages that need React Native support can set generateReactNativeTarget: true in emitter options.

Testing

  • All unit tests pass
  • Builds successfully

deyaaeldeen and others added 6 commits May 5, 2026 18:53
Previously, the SDK generator always included React Native build targets
(warp target, tsconfig reference, package.json exports/imports) for all
generated packages. This caused CI failures in the azure-sdk-for-js
monorepo because most packages don't need RN support and the RN build
infrastructure isn't fully set up.

This change:
- Adds a new `generateReactNativeTarget` option (default: false)
- Updates buildWarpConfig to conditionally include the react-native target
- Updates buildTsConfig to conditionally include tsconfig.src.react-native.json
- Updates package.json generation to conditionally include:
  - `react-native` top-level field
  - `react-native` condition in exports
  - `react-native` in imports subpath patterns
  - `react-native` in tshy esmDialects (for non-monorepo packages)
- Updates tests to verify the new default behavior

Packages that need React Native support can opt-in by setting
`generateReactNativeTarget: true` in the emitter options.

Fixes: Azure/azure-sdk-for-js#37XXX

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Updates test fixtures to reflect the new default behavior where
react-native build targets are not generated unless explicitly enabled.

- Updated RLC integration tests (removed react-native tsconfig references)
- Updated smoke tests (removed react-native from package.json)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerated HLC integration tests, RLC integration tests, and
version-tolerance tests with the new codegen that excludes
react-native targets by default.

Note: Smoke tests could not be regenerated locally due to environment
limitations but were manually updated in the previous commit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add generateReactNativeTarget option to AutorestOptions interface and
update packageFileGenerator.ts to conditionally include react-native
targets based on this option (defaults to false).

Regenerated all HLC test fixtures to remove react-native from package.json.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Manual update since regeneration scripts cannot run locally.
These match the expected output from the generators with
generateReactNativeTarget: false (default).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Previous manual update missed react-native entries in sub-exports.
Proper regeneration removes all react-native from all export paths.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant