WeakSets and WeakMaps shows degrading performance as the amount of
observed objects increases. Using hidden keys result in better
performance especially when repeatedly creating large amounts of
reactive proxies.
This also makes it possible to more efficiently declare non-reactive
objects in userland.
Packages can now augment the ref unwrap bail types in their own `d.ts`.
Also updated the build script to auto concat any files in a package's
`types` directory to the final generated `d.ts`.
- `@vue/reactivity` should no longer require `libs: ["DOM"]` in tsconfig
- Properly bail on `VNode` and `ComponentPublicInstance` in runtime-core
* 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 vue@3.0.0-alpha.13 does not compile unless it explicitely adds `@types/node@v12` as a dependency and `node` in its own tsconfig types.
BREAKING CHANGE: Reactivity APIs adjustments:
- `readonly` is now non-tracking if called on plain objects.
`lock` and `unlock` have been removed. A `readonly` proxy can no
longer be directly mutated. However, it can still wrap an already
reactive object and track changes to the source reactive object.
- `isReactive` now only returns true for proxies created by `reactive`,
or a `readonly` proxy that wraps a `reactive` proxy.
- A new utility `isProxy` is introduced, which returns true for both
reactive or readonly proxies.
- `markNonReactive` has been renamed to `markRaw`.
The next version of Typescript disallows 'this' parameter annotations on
accessors, which causes vue-next to fail to compile.
This PR removes the annotation and adds a cast instead.
Fixes#800