Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dts): Fix build dts error (fix #520) #521

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

0x-jerry
Copy link
Contributor

@0x-jerry 0x-jerry commented Nov 8, 2024

Before this PR, build dts for CameraControls/MapControls/OrbitControls components will failed because of error TS7056, this should fix issue #520.

src/core/controls/OrbitControls.vue:797:1 - error TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.

797 export default (await import('vue')).defineComponent({
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
798 setup() {
    ~~~~~~~~~
... 
805 props: {} as __VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_PublicProps>, typeof __VLS_withDefaultsArg>,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
806 });

After this PR, the error TS7056 will disappear.

@0x-jerry 0x-jerry requested a review from alvarosabu as a code owner November 8, 2024 03:09
Copy link

netlify bot commented Nov 8, 2024

Deploy Preview for cientos-tresjs ready!

Name Link
🔨 Latest commit 225edac
🔍 Latest deploy log https://app.netlify.com/sites/cientos-tresjs/deploys/677652e572096200082ea0e6
😎 Deploy Preview https://deploy-preview-521--cientos-tresjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@0x-jerry 0x-jerry force-pushed the fix/520-fix-build-dts-error branch from f26d7f2 to 35ed8f3 Compare November 8, 2024 05:59
Copy link
Member

@alvarosabu alvarosabu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @0x-jerry thanks for solving this, I was losing my mind with this issue never imagined that was actually a problem of using a ref instead of a shallowRef for returning the instance, it make sense, the controls are probably really complex objects with tons of nested properties that was making the the ts compiler cry a little.

OrbitControls is a stateful class that manages its own updates
We don't need reactivity for its internal properties
We're already handling updates through the change, start, and end events
It's more performant since we're not creating unnecessary reactive wrappers

Thanks

@alvarosabu alvarosabu merged commit c16c6e5 into Tresjs:main Jan 3, 2025
5 checks passed
@alvarosabu alvarosabu added p4-important-bug Violate documented behavior or significantly improve performance (priority) bug Something isn't working labels Jan 3, 2025
@alvarosabu alvarosabu self-assigned this Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p4-important-bug Violate documented behavior or significantly improve performance (priority)
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants