← 输入框|github.com|刷新
Skip to content

fix(vite): Android release bundles keep the class names the binding generator reads - #11516

Merged
NathanWalker merged 1 commit into
mainfrom
fix/vite-sbg-names
Oct 12, 2026
Merged

NathanWalker merged 1 commit into
mainfrom
fix/vite-sbg-names

Conversation

@NathanWalker

Copy link
Copy Markdown
Contributor

The Android static binding generator reads the name in extend('name', {...}) and JavaProxy('name') only from a quoted string, and finds a decorated class only from its own X = __decorate([JavaProxy('name')], X) statement. Minified release output broke both: Oxc prints every string as a template literal, and compression folds those statements into comma sequences. NativeScriptActivity, FragmentClass, OnBackPressedCallback and the lifecycle and component callbacks were then left out of the APK and generated by the runtime at launch, which works only where dex injection into the app class loader succeeds.

Android release builds now compress without sequences, and a final pass requotes the names of substitution-free extend/JavaProxy template literals (same length, so source maps stay valid). Compression and mangling stay on; bundles grow about 5%. Workers get the same treatment.

…enerator reads

The Android static binding generator reads the name in `extend('name', {...})`
and `JavaProxy('name')` only from a quoted string, and finds a decorated class
only from its own `X = __decorate([JavaProxy('name')], X)` statement. Minified
release output broke both: Oxc prints every string as a template literal, and
compression folds those statements into comma sequences. NativeScriptActivity,
FragmentClass, OnBackPressedCallback and the lifecycle and component callbacks
were then left out of the APK and generated by the runtime at launch, which
works only where dex injection into the app class loader succeeds.

Android release builds now compress without sequences, and a final pass
requotes the names of substitution-free `extend`/`JavaProxy` template literals
(same length, so source maps stay valid). Compression and mangling stay on;
bundles grow about 5%. Workers get the same treatment.
@nx-cloud

nx-cloud Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 1ab23d1

Command Status Duration Result
nx run-many -t build -p core,webpack5,vite ✅ Succeeded 10s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-10 04:35:10 UTC

@pkg-pr-new

pkg-pr-new Bot commented Oct 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11516
npm i https://pkg.pr.new/@nativescript/vite@11516
npm i https://pkg.pr.new/@nativescript/webpack@11516

commit: 1ab23d1

@NathanWalker
NathanWalker merged commit 414b8bf into main Oct 12, 2026
9 of 10 checks passed
@NathanWalker
NathanWalker deleted the fix/vite-sbg-names branch October 12, 2026 20:41
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