CEXT-6573: ship production React build for Admin UI SDK apps (gate StrictMode to development) - #635
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 56fbe57 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
mariam21arauj
approved these changes
Aug 17, 2026
oshmyheliuk
approved these changes
Aug 18, 2026
…n exec error handling
Merged
Collaborator
Author
|
/snapshot |
Contributor
📦 Alpha packages published
Install: npm install @adobe/aio-commerce-lib-admin-ui@1.0.1-alpha-20260819113253
npm install @adobe/aio-commerce-lib-auth@1.1.3-alpha-20260819113253
npm install @adobe/aio-commerce-lib-app@1.10.1-alpha-20260819113253
npm install @adobe/aio-commerce-sdk@1.4.2-alpha-20260819113253
npm install @adobe/aio-commerce-lib-api@1.3.1-alpha-20260819113253
npm install @adobe/aio-commerce-lib-config@1.6.1-alpha-20260819113253
npm install @adobe/aio-commerce-lib-events@1.3.1-alpha-20260819113253
npm install @adobe/aio-commerce-lib-webhooks@1.2.1-alpha-20260819113253You can also install by just specifying the tag: npm install @adobe/aio-commerce-sdk@alphaBut note that the tag will always point to the latest |
11 tasks
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.
Description
aio app buildnever sets Parcel'smodeorNODE_ENV, so Admin UI SDK apps ship React's development build to production:<StrictMode>double-invokes renders/effects and the bundle is ~18% larger and slower. This is an interim, SDK-side fix (works on all currentaioCLI versions) made of two coordinated changes:@adobe/aio-commerce-lib-appnow setsNODE_ENVin the app.envvia its build hooks so the web bundler produces the matching React build:pre-app-build(backend-ui/2) writesNODE_ENV=production.pre-app-dev/pre-app-runhooks resetNODE_ENV=development, soaio app dev/aio app runkeep serving the development build (no stale value leaks between commands — verified, since dev/run run a single extension and never re-runpre-app-build).setNodeEnvhelper to the internalscripting-utils.@adobe/aio-commerce-lib-admin-uigates<StrictMode>onprocess.env.NODE_ENV !== "production", so the wrapper is dead-code-eliminated from production bundles (and retained in development).The cleaner long-term fix lives upstream in the
aiobuild pipeline (aio-lib-web / aio-cli-plugin-app passing Parcelmode: 'production'for builds and'development'for dev/run), which would setNODE_ENVand activate export conditions natively. That only helps after a newaioCLI ships, so it is out of scope here.Related Issue
Motivation and Context
Automated systems that build and deploy apps run
aio app buildwithout--web-optimizeand without settingNODE_ENV, so the deployed browser bundle uses React's development build. That causes StrictMode's double-invocation in production and a materially larger/slower bundle. Making production builds setNODE_ENV=productionfixes both at once (production React build + StrictMode inert), and the admin-ui gate additionally strips the<StrictMode>wrapper from production output.How Has This Been Tested?
aio-lib-webuses:modedevelopment,shouldOptimize: false), against a copy of a real Admin UI SDK app:NODE_ENV(plainaio app build) → bundle ships React's dev build and keeps<StrictMode>..envNODE_ENV=production→ bundle ships React's production build (Minified React errorpresent, dev-only strings gone) and the<StrictMode>wrapper is dead-code-eliminated.bin/cli.mjs:pre-app-buildwritesNODE_ENV=production;pre-app-dev/pre-app-runflip it back todevelopmentin place (no stale leak).setNodeEnv;pnpm typecheckclean across all packages;scripting-utils(148),aio-commerce-lib-app(1022) andaio-commerce-lib-admin-ui(212) test suites pass.Types of changes
Checklist:
🤖 Generated with Claude Code