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

types(runtime-core): using intersection type in Readonly<...> breaks JSDoc emit #11799

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

johnsoncodehk
Copy link
Member

@johnsoncodehk johnsoncodehk commented Sep 3, 2024

Fix a dts emit regression for v3.5.

Input Component

import { defineComponent } from "vue";

export default defineComponent({
	props: {
		/**
		 * The hello property.
		 */
		hello: {
			type: String,
			default: 'Hello'
		},
	},
});

v3.5.0 emit dts result

declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
    /**
     * The hello property.
     */
    hello: {
        type: StringConstructor;
        default: string;
    };
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
    hello: string;
} & {} & {}>, {
    hello: string;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}>;
export default _default;

PR emit dts result

declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
    /**
     * The hello property.
     */
    hello: {
        type: StringConstructor;
        default: string;
    };
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
    /**
     * The hello property.
     */
    hello: {
        type: StringConstructor;
        default: string;
    };
}>> & Readonly<{}>, {
    hello: string;
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}>;
export default _default;

@johnsoncodehk johnsoncodehk changed the title types(runtime-core): using intersection type in Readonly<> breaks JSDoc emit types(runtime-core): using intersection type in Readonly<...> breaks JSDoc emit Sep 3, 2024
Copy link

github-actions bot commented Sep 3, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB 37.7 kB 33.9 kB
vue.global.prod.js 159 kB 57.5 kB 51.1 kB

Usages

Name Size Gzip Brotli
createApp 55.1 kB 21.2 kB 19.3 kB
createSSRApp 59.1 kB 22.9 kB 20.8 kB
defineCustomElement 59.8 kB 22.7 kB 20.7 kB
overall 68.8 kB 26.3 kB 23.9 kB

Copy link

pkg-pr-new bot commented Sep 3, 2024

Open in Stackblitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@11799

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@11799

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@11799

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@11799

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@11799

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@11799

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@11799

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@11799

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@11799

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@11799

vue

pnpm add https://pkg.pr.new/vue@11799

commit: e885b04

johnsoncodehk added a commit to vuejs/language-tools that referenced this pull request Sep 3, 2024
@johnsoncodehk johnsoncodehk marked this pull request as ready for review September 3, 2024 21:33
@edison1105 edison1105 added ready to merge The PR is ready to be merged. scope: types ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. regression and removed regression labels Sep 4, 2024
@yyx990803
Copy link
Member

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Sep 4, 2024

📝 Ran ecosystem CI: Open

suite result latest scheduled
language-tools failure failure
nuxt success failure
pinia success success
primevue success success
quasar success success
radix-vue success success
router success success
test-utils success success
vant success success
vite-plugin-vue success success
vitepress success success
vue-i18n failure success
vue-macros success success
vuetify success success
vueuse success success
vue-simple-compiler success success

@yyx990803
Copy link
Member

yyx990803 commented Sep 4, 2024

There seems to be a type breakage in vue-18n ecosystem-ci but I don't think we should block the PR on it. Would still be great to investigate though: https://github.com/vuejs/ecosystem-ci/actions/runs/10701509209/job/29667629360

/cc @kazupon

@yyx990803 yyx990803 merged commit 7518bc1 into vuejs:main Sep 4, 2024
13 checks passed
@johnsoncodehk johnsoncodehk deleted the fix-dts-jsdoc branch September 5, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. ready to merge The PR is ready to be merged. scope: types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants