Repository navigation
fix(windows): break import cycle between view and animation modules - #11581
Open
aleclarson wants to merge 1 commit into
Open
aleclarson wants to merge 1 commit into
aleclarson wants to merge 1 commit into
Conversation
view-common imports Animation from ui/animation, whose Windows index imported _ensureNativeTransforms back from the platform view barrel. When the bundler flattened both modules into one chunk it evaluated the platform View class body — [originXProperty.setNative] and friends — before view-common's property declarations ran, so the app crashed at startup with 'Cannot read properties of undefined (reading setNative)'. Move _ensureNativeTransforms into a leaf module (native-transforms) imported by both files; it only touches WinRT types, so the edge from animation back into the view module disappears. The public re-export from ui/core/view is preserved.
|
View your CI Pipeline Execution ↗ for commit 8c98608
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
This branch has not been deployed
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.
Summary
view-commonimportsAnimationfromui/animation, whose Windows index imported_ensureNativeTransformsback from the platform view barrel (ui/core/view/index) — aview-common → animation → view → view-commoncycle that does not exist on Android (index.android.tshas no such import).Viewclass body —[originXProperty.setNative],[isEnabledProperty.setNative], etc. — beforeview-common's property declarations run, so the app crashes at startup withTypeError: Cannot read properties of undefined (reading 'setNative'). Under plain ESM evaluation the same cycle produces a TDZ error._ensureNativeTransformsinto a leaf module (native-transforms.windows) imported by both files; it only touches WinRT types, so the edge from animation back into the view module disappears. The public re-export fromui/core/viewis preserved (.d.tsunchanged in shape —_ensureNativeTransformsremains exported from the same specifier).Test plan
tsc --noEmit -p packages/core/tsconfig.lib.json— clean@nativescript/core@abae298+ this change applied as a patch): generatedvendor.mjsno longer references the uninitialized binding; the packaged app boots past module evaluationapps/toolboxWindows run