Skip to content

types: add UMD global declaration #8545

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

Closed
wants to merge 1 commit into from
Closed

types: add UMD global declaration #8545

wants to merge 1 commit into from

Conversation

sxzz
Copy link
Member

@sxzz sxzz commented Jun 12, 2023

closes #2932

@sxzz sxzz added the ready to merge The PR is ready to be merged. label Jul 11, 2023
Copy link
Member

Choose a reason for hiding this comment

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

Vue 3 only has the namespace object when using the global build. In ESM builds there are only named exports. This will be appended to the main dts file, and affect non-global build usage.

We need a separate d.ts file in dist, e.g. dist/vue.global.d.ts

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not necessary. TypeScript will emit an error if users used the global object in the module file.

See https://www.typescriptlang.org/docs/handbook/modules.html#umd-modules
image

@sxzz sxzz removed the ready to merge The PR is ready to be merged. label Jul 12, 2023
@sxzz sxzz requested a review from yyx990803 July 17, 2023 15:56
@sxzz sxzz added ready to merge The PR is ready to be merged. ready for review This PR requires more reviews and removed ready to merge The PR is ready to be merged. labels Aug 13, 2023
@github-actions
Copy link

github-actions bot commented Sep 21, 2023

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 90.9 kB 34.6 kB 31.1 kB
vue.global.prod.js 148 kB 53.8 kB 48.1 kB

Usages

Name Size Gzip Brotli
createApp 50.9 kB 19.9 kB 18.1 kB
createSSRApp 54.2 kB 21.3 kB 19.3 kB
defineCustomElement 53.2 kB 20.6 kB 18.8 kB
overall 64.7 kB 24.9 kB 22.6 kB

@sxzz sxzz closed this May 30, 2024
@sxzz sxzz deleted the feat/umd branch May 30, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review This PR requires more reviews
Projects
Status: Rejected
Development

Successfully merging this pull request may close these issues.

export umd namespace
2 participants