From fbb0dcdf89408d0afe26bf546d2ba87ad0531719 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 20 Sep 2018 00:17:20 -0400 Subject: [PATCH] chore: more meta --- packages/core/README.md | 13 +++++++++ packages/core/src/createRenderer.ts | 40 +++++++++++++++----------- packages/language-service/.npmignore | 3 ++ packages/language-service/README.md | 1 + packages/language-service/index.js | 7 +++++ packages/language-service/package.json | 23 +++++++++++++++ packages/language-service/src/index.ts | 0 packages/scheduler/README.md | 2 ++ 8 files changed, 72 insertions(+), 17 deletions(-) create mode 100644 packages/language-service/.npmignore create mode 100644 packages/language-service/README.md create mode 100644 packages/language-service/index.js create mode 100644 packages/language-service/package.json create mode 100644 packages/language-service/src/index.ts diff --git a/packages/core/README.md b/packages/core/README.md index 48d5587a..d5ff7d87 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -1,3 +1,16 @@ # @vue/core > This package is published only for typing and building custom renderers. It is NOT meant to be used in applications. + +``` ts +import { createRenderer, h } from '@vue/core' + +const { render } = createRenderer({ + queueJob, + nodeOps, + patchData, + teardownVNode +}) + +render(h('div'), container) +``` diff --git a/packages/core/src/createRenderer.ts b/packages/core/src/createRenderer.ts index 6ab6ab42..5ad36401 100644 --- a/packages/core/src/createRenderer.ts +++ b/packages/core/src/createRenderer.ts @@ -26,22 +26,22 @@ import { shouldUpdateFunctionalComponent } from './componentUtils' -interface RendererOptions { - queueJob: (fn: () => void, postFlushJob?: () => void) => void - nodeOps: { - createElement: (tag: string, isSVG?: boolean) => any - createText: (text: string) => any - setText: (node: any, text: string) => void - appendChild: (parent: any, child: any) => void - insertBefore: (parent: any, child: any, ref: any) => void - replaceChild: (parent: any, oldChild: any, newChild: any) => void - removeChild: (parent: any, child: any) => void - clearContent: (node: any) => void - parentNode: (node: any) => any - nextSibling: (node: any) => any - querySelector: (selector: string) => any - } - patchData: ( +interface NodeOps { + createElement: (tag: string, isSVG?: boolean) => any + createText: (text: string) => any + setText: (node: any, text: string) => void + appendChild: (parent: any, child: any) => void + insertBefore: (parent: any, child: any, ref: any) => void + replaceChild: (parent: any, oldChild: any, newChild: any) => void + removeChild: (parent: any, child: any) => void + clearContent: (node: any) => void + parentNode: (node: any) => any + nextSibling: (node: any) => any + querySelector: (selector: string) => any +} + +interface PatchDataFunction { + ( el: any, key: string, prevValue: any, @@ -52,7 +52,13 @@ interface RendererOptions { // passed for DOM operations that removes child content // e.g. innerHTML & textContent unmountChildren: (children: VNode[], childFlags: ChildrenFlags) => void - ) => void + ): void +} + +interface RendererOptions { + queueJob: (fn: () => void, postFlushJob?: () => void) => void + nodeOps: NodeOps + patchData: PatchDataFunction teardownVNode?: (vnode: VNode) => void } diff --git a/packages/language-service/.npmignore b/packages/language-service/.npmignore new file mode 100644 index 00000000..bb5c8a54 --- /dev/null +++ b/packages/language-service/.npmignore @@ -0,0 +1,3 @@ +__tests__/ +__mocks__/ +dist/packages \ No newline at end of file diff --git a/packages/language-service/README.md b/packages/language-service/README.md new file mode 100644 index 00000000..08e34b1e --- /dev/null +++ b/packages/language-service/README.md @@ -0,0 +1 @@ +# @vue/language-service \ No newline at end of file diff --git a/packages/language-service/index.js b/packages/language-service/index.js new file mode 100644 index 00000000..79725f65 --- /dev/null +++ b/packages/language-service/index.js @@ -0,0 +1,7 @@ +'use strict' + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./dist/language-service.cjs.prod.js') +} else { + module.exports = require('./dist/language-service.cjs.js') +} diff --git a/packages/language-service/package.json b/packages/language-service/package.json new file mode 100644 index 00000000..6f3a8a70 --- /dev/null +++ b/packages/language-service/package.json @@ -0,0 +1,23 @@ +{ + "name": "@vue/language-service", + "version": "3.0.0-alpha.1", + "description": "@vue/language-service", + "main": "index.js", + "typings": "dist/index.d.ts", + "buildOptions": { + "formats": ["cjs"] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/vuejs/vue.git" + }, + "keywords": [ + "vue" + ], + "author": "Evan You", + "license": "MIT", + "bugs": { + "url": "https://github.com/vuejs/vue/issues" + }, + "homepage": "https://github.com/vuejs/vue/tree/dev/packages/language-service#readme" +} diff --git a/packages/language-service/src/index.ts b/packages/language-service/src/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/packages/scheduler/README.md b/packages/scheduler/README.md index 826934e7..2af0546c 100644 --- a/packages/scheduler/README.md +++ b/packages/scheduler/README.md @@ -1,3 +1,5 @@ # @vue/scheduler > This package is published only for typing and building custom renderers. It is NOT meant to be used in applications. + +The default scheduler that uses Promise / Microtask to defer and batch updates.