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

fix(reactivity): remove Symbol.observable #968

Merged
merged 2 commits into from
Apr 16, 2020

Conversation

cexbrayat
Copy link
Member

Symbol.observable is brought by @types/node@12 and is not a "well-known" typescript symbol https://www.typescriptlang.org/docs/handbook/symbols.html that can be find in lib.es20xx like the others. It has been removed in @types/node@v13.
It means that an application using [email protected] does not compile unless it explicitely adds @types/node@v12 as a dependency and node in its own tsconfig types.
Otherwise here is the compilation error:

ERROR in /Users/ced-pro/Code/ninjasquad/.../node_modules/@vue/reactivity/dist/reactivity.d.ts(134,13):
134:13 Property 'observable' does not exist on type 'SymbolConstructor'.
    132 |     [Symbol.observable]: infer V;
    133 | } ? {
  > 134 |     [Symbol.observable]: V;
        |             ^
    135 | } : {}) & (T extends {
    136 |     [Symbol.replace]: infer V;
    137 | } ? {

On top of #967

The bump to @types/node@v13 can be removed if you want: it's mainly here to reproduce the issue.

As `tsconfig.json` references it, it should be listed in the dependencies.
It currently uses an older version: this commit also bumps to the latest v12 version, and fixes a typing issue.
`Symbol.observable` is brought by `@types/node@12` and is not a "well-known" typescript symbol https://www.typescriptlang.org/docs/handbook/symbols.html that can be find in lib.es20xx like the others. It has been removed in `@types/node@v13`.
It means that an application using [email protected] does not compile unless it explicitely adds `@types/node@v12` as a dependency and `node` in its own tsconfig types.
@pikax
Copy link
Member

pikax commented Apr 16, 2020

Can you provide a repo to reproduce this?

I tested with node v10.13.0, but was able to build without any issues

@cexbrayat
Copy link
Member Author

It builds with @types/node up until v12, but it doesn't with v13. But the main issue is that an app using vue alpha.13 now has to add node in its tsconfig.json otherwise it does not compile.

@yyx990803
Copy link
Member

We should remove it anyway since it's only Stage 1.

@yyx990803 yyx990803 merged commit 4d014dc into vuejs:master Apr 16, 2020
pikax pushed a commit to pikax/vue-next that referenced this pull request Apr 29, 2020
* chore: add @types/node as an explicit dependency

As `tsconfig.json` references it, it should be listed in the dependencies.
It currently uses an older version: this commit also bumps to the latest v12 version, and fixes a typing issue.

* fix(reactivity): remove Symbol.observable

`Symbol.observable` is brought by `@types/node@12` and is not a "well-known" typescript symbol https://www.typescriptlang.org/docs/handbook/symbols.html that can be find in lib.es20xx like the others. It has been removed in `@types/node@v13`.
It means that an application using [email protected] does not compile unless it explicitely adds `@types/node@v12` as a dependency and `node` in its own tsconfig types.
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