yyx990803 Github contribution chart
yyx990803 Github Stats
yyx990803 Most Used Languages

Activity

04 Oct 2022

Yyx990803

Update Free Weekend Vue School banner to point to offer landing page (#1985)

  • Update Free Weekend Vue School banner to point to offer landing page

  • Update Free Weekend Vue School banner copy

Pushed On 04 Oct 2022 at 01:10:06
Pull Request

Yyx990803

Update Free Weekend Vue School banner to point to offer landing page

Created On 04 Oct 2022 at 01:10:01

Yyx990803

fix(normalizaProp): support css variable as number

fix #6625

Merged On 03 Oct 2022 at 08:18:26

Yyx990803

Commented On 03 Oct 2022 at 08:18:26

Yyx990803

Update Free Weekend Vue School banner (#2969)

  • Update Free Weekend Vue School banner

  • Remove hardcoded date from Vue School banner

Pushed On 01 Oct 2022 at 12:12:53

Yyx990803

Update Free Weekend Vue School banner

Created On 01 Oct 2022 at 12:12:47

Yyx990803

Update Free Weekend Vue School banner (#1982)

  • Update Free Weekend Vue School banner

  • Fix copy, remove hardcoded date

  • Update current phase CTA text

  • Fix Vue School banner link UTM

Pushed On 01 Oct 2022 at 12:12:24
Pull Request

Yyx990803

Update Free Weekend Vue School banner

Created On 01 Oct 2022 at 12:12:20
Issue Comment

Yyx990803

[compiler] The TS code compiled from setup-script has a type error about `@vue/shared` in pnpm

Vue version

3.2.40

Link to minimal reproduction

https://github.com/qmhc/vue-ts-test

Steps to reproduce

Run:

pnpm i

pnpm run build

# optional
pnpm run tsc 

Then check src/index.ts.

What is expected?

No error occurred.

What is actually happening?

It gets a type error following:

image

System Info

System:
  OS: Windows 10 10.0.19044
  CPU: (6) x64 AMD Ryzen 5 3500X 6-Core Processor
  Memory: 14.79 GB / 31.93 GB
Binaries:
  Node: 16.13.1 - C:\Program Files\nodejs\node.EXE
  Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
  Chrome: 105.0.5195.127
  Edge: Spartan (44.19041.1266.0), Chromium (105.0.1343.50)
  Internet Explorer: 11.0.19041.1566
npmPackages:
  vue: ^3.2.40 => 3.2.40 

Any additional comments?

After we comment the prop in __returned__, the error will disappear:

image

Forked On 29 Sep 2022 at 12:41:09

Yyx990803

See https://github.com/microsoft/TypeScript/issues/42873

Not really an issue that Vue can fix, since we do have correct dependency relationships between the packages.

But if you are trying to emit types for your Vue components, you should use vue-tsc instead (this is what powers Volar internally)

Commented On 29 Sep 2022 at 12:41:09
Issue Comment

Yyx990803

Using generic for `ref()` causes error when reassigning

Vue version

3.2.40

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-rpmhsh?file=src/main.ts

Steps to reproduce

ref(t) where t is of type generic T will cause error when reassigning the ref to a value of T.

What is expected?

expected refOfT.value = t to work

What is actually happening?

image

Got an error

Type 'T' is not assignable to type 'UnwrapRef<T>'. 

System Info

No response

Any additional comments?

No response

Forked On 29 Sep 2022 at 12:27:42

Yyx990803

Unfortunately this is because ref values have to expose the "unwrapped" type, which unwraps nested refs, to ensure value access correctness:

const a = { b: ref(0) }
const c = ref(a)

c.value.b // should be number

c.value = a // same error you saw 

To fix this we will need TypeScript to allow specifying different type constraints for getter and setter of the same property. See https://github.com/microsoft/TypeScript/issues/43662

Commented On 29 Sep 2022 at 12:27:42

Yyx990803

fix(devtools): avoid memory leak caused by devtools event buffer

fix #6591

Pushed On 28 Sep 2022 at 10:19:38
Issue Comment

Yyx990803

A memory leak occurred when switching between components

Version

4.1.5

Reproduction link

~~github.com~~ (has router) SFC Playground

Steps to reproduce

  • toggle between pages multiple times
  • check memory usage after GC

What is expected?

Stable memory usage

What is actually happening?

A large number of nodes are not reclaimed, and memory keeps growing

Forked On 28 Sep 2022 at 09:57:50

Yyx990803

The "leak" only happens when:

  • Using the dev build
  • Has Vue Devtools enabled
  • Hasn't opened the Vue devtools tab

Vue Devtools buffers devtool-specific events in a global object before the devtools tab is activated. The buffered events hold references to the component instances triggering them, so those component instances, along with their DOM, are never released from memory until the devtools tab is activated and the buffer is cleared.

Although this does not affect production cases, it could cause perf issues when toggling between heavy components during development. It could also be confusing to users when debugging memory issues.

@Akryum this behavior seems to have been in devtools for a long time, I'm not sure if the memory issue is the result of a recent change or has always been there as well. Is there anyway we can rework this in the devtools to avoid it?

Commented On 28 Sep 2022 at 09:57:50
Issue Comment

Yyx990803

A memory leak occurred when switching between components

Version

4.1.5

Reproduction link

~~github.com~~ (has router) SFC Playground

Steps to reproduce

  • toggle between pages multiple times
  • check memory usage after GC

What is expected?

Stable memory usage

What is actually happening?

A large number of nodes are not reclaimed, and memory keeps growing

Forked On 28 Sep 2022 at 08:07:46

Yyx990803

More investigation: the leak in the original repro is actually caused by the devtools. There is no leak in production.

Commented On 28 Sep 2022 at 08:07:46
Issue Comment

Yyx990803

A memory leak occurred when switching between components

Version

4.1.5

Reproduction link

~~github.com~~ (has router) SFC Playground

Steps to reproduce

  • toggle between pages multiple times
  • check memory usage after GC

What is expected?

Stable memory usage

What is actually happening?

A large number of nodes are not reclaimed, and memory keeps growing

Forked On 28 Sep 2022 at 07:51:59

Yyx990803

Looks like the simplified reproduction is a bit different from the original case, where there is a legit memory leak that is still present in 3.2.40.

Commented On 28 Sep 2022 at 07:51:59

Yyx990803

release: v3.2.40

Pushed On 28 Sep 2022 at 03:40:55
Create Branch
Yyx990803 In vuejs/core Create Branchv3.2.40

Yyx990803

🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

On 28 Sep 2022 at 03:40:52
Issue Comment

Yyx990803

Remove CJS build for @vue/compat

What problem does this feature solve?

@vue/compat depends on estree-walker, which doesn't support CJS build: https://stackblitz.com/edit/node-apcmcb?file=index.js

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /home/projects/node-apcmcb/node_modules/estree-walker/package.json 

This causes issues in Vitest, for example (#1978), or any tools that imports it without preprocessing.

What does the proposed API look like?

I propose removing CJS build altogether, but keep index.js with an if statement (I assume it's used for more old tools that don't understand "exports" field.) If it is meant to be used with estree-walker@2, we should have it for compatibility with Jest. (it's not specified in package.json)

I would also recommend adding "exports" field with compatible Node ESM build (meaning, type: "module" or .mjs extension, docs)

{
  "exports": {
    ".": {
      "development": "./index.dev.mjs"
      "import": "./index.mjs",
      "require": "./index.js"
    },
  }
} 
// index.dev.mjs
export * from './dist/vue.esm.mjs' 
// index.mjs
export * from './dist/vue.esm.prod.mjs' 

Forked On 28 Sep 2022 at 03:06:44

Yyx990803

The root cause is that @vue/compat did not list its own dependencies, so it was resolving to a hoisted & newer version of estree-walker that doesn't have CJS build.

Commented On 28 Sep 2022 at 03:06:44

Yyx990803

fix(compat): list cjs dependencies for compat build

Previously the cjs build implicitly relies on hoisted versions of the deps, causing it to resolve to newer versions of estree-walker when present.

fix #6602

Pushed On 28 Sep 2022 at 03:05:59

Yyx990803

refactor(compiler-core): extract props merging helper

Pushed On 28 Sep 2022 at 02:59:20

Yyx990803

fix(compilre-core): dynamic v-on and static v-on should be merged (#6747)

fix #6742

Pushed On 28 Sep 2022 at 02:46:57
Pull Request

Yyx990803

fix(compilre-core): dynamic v-on and static v-on should be merged

Created On 28 Sep 2022 at 02:46:55

Yyx990803

chore: use stricter slots type in createSlots

Pushed On 28 Sep 2022 at 02:38:32

Yyx990803

ci: GitHub workflows security hardening (#6743)

Pushed On 28 Sep 2022 at 02:36:49
Pull Request

Yyx990803

GitHub Workflows security hardening

Created On 28 Sep 2022 at 02:36:48

Yyx990803

test(slots): ensure createSlots helper work with ssr slots (#6660)

Pushed On 28 Sep 2022 at 02:36:13
Pull Request

Yyx990803

fix(slots): check nullability for multi-branch dynamic slots

Created On 28 Sep 2022 at 02:36:12