Evan You %!s(int64=8) %!d(string=hai) anos
pai
achega
c994e5cf48

+ 20 - 2
flow/component.js

@@ -69,16 +69,34 @@ declare interface Component {
   _provided: ?Object;
 
   // private methods
+
   // lifecycle
   _init: Function;
   _mount: (el?: Element | void, hydrating?: boolean) => Component;
   _update: (vnode: VNode, hydrating?: boolean) => void;
+
   // rendering
   _render: () => VNode;
-  __patch__: (a: Element | VNode | void, b: VNode) => any;
+
+  __patch__: (
+    a: Element | VNode | void,
+    b: VNode,
+    hydrating?: boolean,
+    removeOnly?: boolean,
+    parentElm?: any,
+    refElm?: any
+  ) => any;
+
   // createElement
+
   // _c is internal that accepts `normalizationType` optimization hint
-  _c: (vnode?: VNode, data?: VNodeData, children?: VNodeChildren, normalizationType?: number) => VNode | void;
+  _c: (
+    vnode?: VNode,
+    data?: VNodeData,
+    children?: VNodeChildren,
+    normalizationType?: number
+  ) => VNode | void;
+
   // renderStatic
   _m: (index: number, isInFor?: boolean) => VNode | VNodeChildren;
   // markOnce

+ 1 - 0
flow/modules.js

@@ -10,6 +10,7 @@ declare module 'source-map' {
     toString(): string;
   }
   declare class SourceMapConsumer {
+    constructor (map: Object): void;
     originalPositionFor(position: { line: number; column: number; }): {
       source: ?string;
       line: ?number;

+ 5 - 1
src/core/instance/render-helpers/render-list.js

@@ -7,7 +7,11 @@ import { isObject, isDef } from 'core/util/index'
  */
 export function renderList (
   val: any,
-  render: () => VNode
+  render: (
+    val: any,
+    keyOrIndex: string | number,
+    index?: number
+  ) => VNode
 ): ?Array<VNode> {
   let ret: ?Array<VNode>, i, l, keys, key
   if (Array.isArray(val) || typeof val === 'string') {

+ 1 - 1
src/core/observer/index.js

@@ -80,7 +80,7 @@ export class Observer {
  * Augment an target Object or Array by intercepting
  * the prototype chain using __proto__
  */
-function protoAugment (target, src: Object) {
+function protoAugment (target, src: Object, keys: any) {
   /* eslint-disable no-proto */
   target.__proto__ = src
   /* eslint-enable no-proto */

+ 3 - 1
src/server/bundle-renderer/create-bundle-renderer.js

@@ -27,7 +27,9 @@ type RenderBundle = {
   modules?: { [filename: string]: Array<string> };
 };
 
-export function createBundleRendererCreator (createRenderer: () => Renderer) {
+export function createBundleRendererCreator (
+  createRenderer: (options?: RenderOptions) => Renderer
+) {
   return function createBundleRenderer (
     bundle: string | RenderBundle,
     rendererOptions?: RenderOptions = {}

+ 1 - 1
src/server/create-renderer.js

@@ -18,7 +18,7 @@ type RenderCache = {
 };
 
 export type RenderOptions = {
-  modules?: Array<(vnode: VNode) => string>;
+  modules?: Array<(vnode: VNode) => ?string>;
   directives?: Object;
   isUnaryTag?: Function;
   cache?: RenderCache;

+ 1 - 1
src/server/optimizing-compiler/codegen.js

@@ -97,7 +97,7 @@ function genSSRChildren (el, state, checkSkip) {
 function genSSRNode (el, state) {
   return el.type === 1
     ? genSSRElement(el, state)
-    : genText(el, state)
+    : genText(el)
 }
 
 function genChildrenAsStringNode (el, state) {

+ 8 - 1
src/server/optimizing-compiler/runtime-helpers.js

@@ -71,7 +71,14 @@ function renderStringNode (
   return new StringNode(open, close, children, normalizationType)
 }
 
-function renderStringList (val: any, render: () => string): string {
+function renderStringList (
+  val: any,
+  render: (
+    val: any,
+    keyOrIndex: string | number,
+    index?: number
+  ) => string
+): string {
   let ret = ''
   let i, l, keys, key
   if (Array.isArray(val) || typeof val === 'string') {

+ 1 - 1
src/server/render-context.js

@@ -28,7 +28,7 @@ export class RenderContext {
   next: () => void;
   done: () => void;
 
-  modules: Array<() => ?string>;
+  modules: Array<(node: VNode) => ?string>;
   directives: Object;
   isUnaryTag: (tag: string) => boolean;
 

+ 1 - 1
src/server/render.js

@@ -343,7 +343,7 @@ function renderStartingTag (node: VNode, context) {
 }
 
 export function createRenderFunction (
-  modules: Array<Function>,
+  modules: Array<(node: VNode) => ?string>,
   directives: Object,
   isUnaryTag: Function,
   cache: any

+ 4 - 2
src/shared/util.js

@@ -202,13 +202,15 @@ export function toObject (arr: Array<any>): Object {
 
 /**
  * Perform no operation.
+ * Stubbing args to make Flow happy without leaving useless transpiled code
+ * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/)
  */
-export function noop () {}
+export function noop (a?: any, b?: any, c?: any) {}
 
 /**
  * Always return false.
  */
-export const no = () => false
+export const no = (a?: any, b?: any, c?: any) => false
 
 /**
  * Return same value