🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
by vuejsLast 12 weeks · 91 commits
3 of 6 standards met
Vue version v3.5.18 Link to minimal reproduction https://stackblitz.com/edit/vitejs-vite-nhmrulst?file=src%2Fmain.js Steps to reproduce I'm creating a custom datepicker control. Similar to the native `value` property that aren't valid dates. An easy solution would be to subclass the custom element: However, this doesn't work: What is expected? DerivedCustomElement.myProp's setter should be called, and should not pass the new value into the component. What is actually happening? The setter is never called, because it is overridden when the component is mounted. This is done in apiCustomElement:_resolveProps. The comment, "// defining getter/setters on prototype", makes me think this is a bug. An alternative solution for my use case would be to enforce prop validation in apiCustomElement, and not call _setProp if validation fails. However, this would have wider effects and would probably need more analysis, an option to toggle it off, and so on. System Info Any additional comments? My proposed fix is to define the properties on the prototype, for real. In addition to making them overridable, this would probably also result in a small speedup, as they wouldn't have to be defined every time an instance is created and mounted. I'd be happy to make a pull request for this, if accepted.
Repository: vuejs/core. Description: 🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web. Stars: 53143, Forks: 9061. Primary language: TypeScript. Languages: TypeScript (96.6%), JavaScript (1.7%), HTML (1.2%), Vue (0.5%), CSS (0%). License: MIT. Homepage: https://vuejs.org/ Latest release: v3.5.29 (1w ago). Open PRs: 100, open issues: 903. Last activity: 2h ago. Community health: 62%. Top contributors: yyx990803, dependabot-preview[bot], renovate[bot], edison1105, sxzz, HcySunYang, pikax, underfin, dependabot[bot], jh-leong and others.
TypeScript
Fixes #9919 The implementation is quite straightforward as shown in the first commit. However I found the is getting more and more complex, so I refactored it to improve readability. I can revert that commit if it presents a hurdle for merging this PR. But IMO, with so many existing test cases, the refactoring is quite safe. Summary by CodeRabbit New Features Asset URL handling now supports transforming subpath imports that begin with “#” and combining file paths with fragment hashes in templates and srcset. Bug Fixes Correctly distinguishes true hash-fragment references from importable asset paths starting with “#”. Reuses import registrations and decodes encoded paths to avoid duplicate or incorrect imports. Tests** Added tests covering subpath imports, srcset transformations, and hash-fragment preservation.
Problem Fixes #13969. function refs are currently typed with a callback parameter of: Under TypeScript function parameter variance, this rejects callbacks that use a narrower DOM type, e.g.: ```tsx {}} /> This is unintuitive for function refs on concrete elements and causes unnecessary type errors. Solution Adjust VNodeRef callback typing in runtime-core to use the standard bivariant callback pattern (bivarianceHack), so narrower element parameter types are accepted where appropriate. This is a type-only change and does not affect runtime behavior. Tests Added a dts regression case: tsx.test-d.tsx verifies {}} /> type-checks Validation run locally: pnpm build-dts pnpm test-dts-only Both passed. Scope / Risk Minimal, focused change (2 files) Type-level only No runtime logic changes Summary by CodeRabbit Release Notes Tests Added test assertion verifying form element ref callback support. Refactor Improved TypeScript type handling for ref callbacks to support narrower element types.