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

chore: remove side effects #4871

Merged
merged 2 commits into from
Oct 23, 2024
Merged

chore: remove side effects #4871

merged 2 commits into from
Oct 23, 2024

Conversation

vikingair
Copy link
Contributor

This would allow bundlers to tree shake the module code when imports are not done via import type.

E.g.,

import { ComponentProps } from 'vue-component-type-helpers';

Also, I would like to know why the code needs to be default exported as a string containing the same TS code again. Is it maybe some artifact from the past and or only relevant to Vue2?

Copy link

pkg-pr-new bot commented Sep 23, 2024

Open in Stackblitz

vue-component-meta

pnpm add https://pkg.pr.new/vuejs/language-tools/vue-component-meta@4871

vue-component-type-helpers

pnpm add https://pkg.pr.new/vuejs/language-tools/vue-component-type-helpers@4871

@vue/language-core

pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-core@4871

@vue/language-plugin-pug

pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-plugin-pug@4871

@vue/language-server

pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-server@4871

@vue/language-service

pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-service@4871

vue-tsc

pnpm add https://pkg.pr.new/vuejs/language-tools/vue-tsc@4871

@vue/typescript-plugin

pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/typescript-plugin@4871

commit: 16ca1fd

KazariEX
KazariEX previously approved these changes Oct 2, 2024
@johnsoncodehk
Copy link
Member

LGTM, Thanks!

Also, I would like to know why the code needs to be default exported as a string containing the same TS code again. Is it maybe some artifact from the past and or only relevant to Vue2?

That's because the code snippet needs to be used as virtual code in vue-component-meta.

@johnsoncodehk johnsoncodehk changed the title component-type-helpers: Remove side effects chore: remove side effects Oct 23, 2024
@johnsoncodehk johnsoncodehk enabled auto-merge (squash) October 23, 2024 07:17
@johnsoncodehk johnsoncodehk merged commit 32aa8a8 into vuejs:master Oct 23, 2024
5 checks passed
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.

3 participants