rudy-xhd Github contribution chart
rudy-xhd Github Stats
rudy-xhd Most Used Languages

Activity

26 Nov 2022

Issue Comment

Rudy-xhd

Allow skipping some generics when calling a function with multiple generics

Right now in TypeScript it's all or nothing when calling generic methods. You can either skip typing all the generics altogether and they will be inferred from the context (if possible), or you have to manually (re)define all of them. But the reality isn't black and white, there are also shades of gray, where we can infer types for some of the generic parameters, but not others. Currently those have to be unnecessarily verbose by forcing the programmer to explicitly restate them.

Take a look at these 3 cases:

Case 1 - everything can be inferred - no need to call the method with <> definition:

function case1<A, B, C>(a: A, b: B, c: C): A {}

example(1, '2', true); 

Compiler knows that: A is number B is string C is boolean


Case 2 - nothing can be inferred, so we need to state what A, B and C should be, otherwise they'll default to {}:

function case2<A, B, C>(): A {}

example<number, string, boolean>(); 

Case 3 - the one that's interesting to this feature request - some can be inferred, some can't:

function case3<A, B, C>(b: string, c: boolean): A {}

// incorrect type of A - left unspecified:
example('thing'); 

// correct, but unnecessarily verbose - we already know that 'thing' is a string and true is a bool
example<number, string, boolean>('thing', true); 

Now, typing string, boolean in the above example isn't a big deal, but with complex scenarios, say with a method using 5 generics, where you can infer 4 of them, retyping them all seems overly verbose and prone to error.

It would be great if we could have some way to skip re-typing the types that can automatically be inferred. Something like a special auto or inferred type, so we could write:

example<number, auto, auto>('thing', bool); 

Or maybe even, if we only want to specify those up to a certain point:

example<number>('thing', bool); 

The above "short-hand" notation could perhaps be different to account for function overloads with different number of generics.

Having such a feature would solve newcomers encountering problems such as this one: http://stackoverflow.com/questions/38687965/typescript-generics-argument-type-inference/38688143

Forked On 26 Nov 2022 at 12:20:49

Rudy-xhd

Still waiting for this feature...

Commented On 26 Nov 2022 at 12:20:49
Issue Comment

Rudy-xhd

TypeScript 5.0 Iteration Plan

This document outlines our focused tasks for TypeScript 5.0. It minimally indicates intent to investigate tasks or contribute to an implementation. Nothing is set in stone, but we will strive to complete these tasks in a reasonable timeframe.

Date | Event ---------------|------------------------- November 15th | TypeScript 4.9 Release January 20th | Create 5.0 Beta (5.0.1) Build for Testing January 24th | TypeScript 5.0 Beta Release February 24th | Create 5.0 RC (5.0.2) Build for Testing February 28th | TypeScript 5.0 RC Release March 10th | Create 5.0 Final (5.0.3) Build for Testing March 14th | TypeScript 5.0 Final Release 🚀

gantt
    dateFormat  YYYY-MM-DD
    TypeScript 4.9 Stabilization Period : 2022-10-28, 2022-11-11
    TypeScript 5.0 Beta Development : 2022-10-28, 2023-01-19
    TypeScript 5.0 RC Development : 2023-01-19, 2023-02-23
    TypeScript 5.0 Stabilization Period : 2023-02-23, 2023-03-14
todayMarker stroke-width:5px,stroke:#0f0,opacity:0.5 

Language and Compiler Features

Editor Productivity

Performance

Infrastructure

Website

Forked On 26 Nov 2022 at 12:20:02

Rudy-xhd

https://github.com/microsoft/TypeScript/issues/10571 (Allow skipping generics) would be highly appreciated

Commented On 26 Nov 2022 at 12:20:02

Rudy-xhd

fix(watch): should not fire pre watcher on child component unmount

Fix #7030

Merged On 20 Nov 2022 at 03:03:29

Rudy-xhd

Commented On 20 Nov 2022 at 03:03:29
Merge

Rudy-xhd

fix(watch): should not fire pre watcher on child component unmount

Fix #7030

Forked On 20 Nov 2022 at 03:03:28

Rudy-xhd

Thanks. Updated.
On 20 Nov 2022 at 03:03:28

Rudy-xhd

chore: revert

Pushed On 20 Nov 2022 at 03:02:54

Rudy-xhd

chore: revert

Pushed On 20 Nov 2022 at 02:51:59

Rudy-xhd

Update packages/runtime-core/src/scheduler.ts

Co-authored-by: edison daiwei521@126.com

Pushed On 20 Nov 2022 at 02:40:26
Pull Request

Rudy-xhd

fix(watch): should not fire pre watcher on child component unmount

Created On 19 Nov 2022 at 03:02:42
Issue Comment

Rudy-xhd

`watch` runs while the component is being unmounted

Vue version

3.2.41

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-tzhuws?file=src/pages/users/[id].vue

Steps to reproduce

  1. Click /users/b button.
  2. Click /users button.
  3. Check the console (will show the id: undefined).

What is expected?

The behavior should be the same as /users/b to /about simply destroying the component without triggering watch().

What is actually happening?

The behavior is the same as /users/b to /users/a to reuse component instances and then trigger watch() (trigger watch() again before destroying the component instance?).

System Info

System:
  OS: Linux 5.0 undefined
  CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 0 Bytes / 0 Bytes
  Shell: 1.0 - /bin/jsh
Binaries:
  Node: 16.14.2 - /usr/local/bin/node
  Yarn: 1.22.19 - /usr/local/bin/yarn
  npm: 7.17.0 - /usr/local/bin/npm
npmPackages:
  vue: ^3.2.41 => 3.2.41 

Any additional comments?

Is this expected behavior? It seems annoying to need to add a condition of undefined to the watch() callback.

Not sure #2291 has fixed the problem

I will be grateful for any help any can provide!

Forked On 19 Nov 2022 at 03:02:21

Rudy-xhd

Here is this reproduction with Vue only. And I create a PR to fix it. Feel free to review it.

Commented On 19 Nov 2022 at 03:02:21
Create Branch
Rudy-xhd In rudy-xhd/core Create Branchfix/7030

Rudy-xhd

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

On 19 Nov 2022 at 02:55:23

Rudy-xhd

started

Started On 19 Nov 2022 at 07:34:19

Rudy-xhd

chore: format

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

chore: eslint rules overrides (#6729)

Co-authored-by: pengbo43 pengbo43@jd.com Co-authored-by: Anthony Fu anthonyfu117@hotmail.com

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

refactor(types): improve of type assertion (#4177)

Co-authored-by: webfansplz <>

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

types: creating Teleport with h and RawSlots #2613 (#2614)

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

fix(devtools): use cleanupBuffer instead of modifying _buffer (#6812)

Co-authored-by: Anthony Fu anthonyfu117@hotmail.com

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

chore: add cache for prettier and eslint (#6813)

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

chore: more pr tips in contribution guide [ci skip]

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

chore: symbols as helperNameMap index type (#6622)

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

build: enforce LF line break for built files

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

fix(effectScope): calling off() of a detached scope should not break currentScope

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

fix(runtime-dom): fix event timestamp check in iframes

fix #2513 fix #3933 close #5474

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

fix(runtime-core): ensure that errors in slot function execution do not affect block tracking (#5670)

fix #5657

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

fix(runtime-core): fix v-for ref reactivity behavior difference between prod and dev (#6714)

fix #6697

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

release: v3.2.41

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

fix(runtime-core): watching multiple values - handle undefined as initial values (fix: #5032) (#5033)

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

fix(types): ensure createBlock() helper accepts Teleport and Supsense types (fix: #2855) (#5458)

Co-authored-by: Carlos Rodrigues carlos@hypermob.co.uk

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

fix(reactivity): enable trigger when use str to set length of arr (#6810)

Co-authored-by: Anthony Fu anthonyfu117@hotmail.com

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

fix(runtime-core): ensure props definition objects are not mutated during props normalization (close: #6915) (#6916)

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

fix(runtime-core): custom-element: ensure number casting of camelCase props. (fix: #5374) (#5377)

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

types(shared): Improve LooseRequired (#6244)

Pushed On 12 Nov 2022 at 02:02:48

Rudy-xhd

started

Started On 10 Nov 2022 at 02:44:56

Rudy-xhd

started

Started On 09 Nov 2022 at 03:11:26

Rudy-xhd

started

Started On 09 Nov 2022 at 03:02:17

Rudy-xhd

started

Started On 08 Nov 2022 at 03:59:50

Rudy-xhd

started

Started On 03 Nov 2022 at 02:27:09

Rudy-xhd

started

Started On 30 Oct 2022 at 09:24:10
Pull Request

Rudy-xhd

fix(server-renderer): should work with css vars

Created On 26 Oct 2022 at 01:01:15
Merge

Rudy-xhd

fix(server-renderer): should work with css vars

Fix #6926.

watchPostEffect is used in the useCssVars so that the effect can execute asynchronously.

But the effect will execute immediately when using watchPostEffect in the ssr.

Maybe the PR can fix that.

Forked On 26 Oct 2022 at 01:01:04

Rudy-xhd

Thanks, then i close it. Looking forward to your solution.
On 26 Oct 2022 at 01:01:04

Rudy-xhd

fix(server-renderer): should work with css vars

Fix #6926.

watchPostEffect is used in the useCssVars so that the effect can execute asynchronously.

But the effect will execute immediately when using watchPostEffect in the ssr.

Maybe the PR can fix that.

Merged On 26 Oct 2022 at 01:01:05

Rudy-xhd

Commented On 26 Oct 2022 at 01:01:05
Pull Request

Rudy-xhd

fix(server-renderer): should work with css vars

Created On 25 Oct 2022 at 04:18:45
Create Branch
Rudy-xhd In rudy-xhd/core Create Branchfix/6926

Rudy-xhd

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

On 25 Oct 2022 at 04:08:11

Rudy-xhd

started

Started On 22 Oct 2022 at 12:51:33
Pull Request

Rudy-xhd

test(h): add `h` dts test with optional props declaration

Created On 22 Oct 2022 at 12:04:44
Pull Request

Rudy-xhd

test(h): add `h` dts test with optional props declaration

Created On 22 Oct 2022 at 09:06:20
Create Branch
Rudy-xhd In rudy-xhd/core Create Branchchore/improve_h_test

Rudy-xhd

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

On 22 Oct 2022 at 09:04:31