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: disallow optional chaining #10919

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

sxzz
Copy link
Member

@sxzz sxzz commented May 12, 2024

Disallow the use of optional chaining (a?.b, a?.()), except when running on Node.js.

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 90.7 kB 34.5 kB 31.1 kB
vue.global.prod.js 148 kB 53.7 kB 48 kB

Usages

Name Size Gzip Brotli
createApp 50.8 kB 19.9 kB 18.1 kB
createSSRApp 54.1 kB 21.2 kB 19.3 kB
defineCustomElement 53.1 kB 20.6 kB 18.8 kB
overall 64.5 kB 24.9 kB 22.6 kB

@sodatea sodatea added the 🧹 p1-chore Priority 1: this doesn't change code behavior. label May 20, 2024
@sodatea
Copy link
Member

sodatea commented May 28, 2024

But after minification it is not that verbose: https://esbuild.github.io/try/#dAAwLjIxLjQALS10YXJnZXQ9ZXMyMDE2IC0tbWluaWZ5AGE/LmI

@sxzz
Copy link
Member Author

sxzz commented May 28, 2024

See #4882 (comment)
Additionally, in the case of a?.b?.c, it will be larger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 p1-chore Priority 1: this doesn't change code behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants