Skip to content

Commit

Permalink
annotate entries
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 12, 2016
1 parent 7ac7cae commit b926b9e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
7 changes: 6 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"root": true,
"parser": "babel-eslint",
"extends": "vue"
"extends": "vue",
"plugins": ["flow-vars"],
"rules": {
"flow-vars/define-flow-type": 1,
"flow-vars/use-flow-type": 1
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"entities": "1.1.x",
"eslint": "2.9.x",
"eslint-config-vue": "1.0.x",
"eslint-plugin-flow-vars": "^0.4.0",
"flow-bin": "^0.24.2",
"http-server": "0.9.x",
"isparta-loader": "2.0.x",
Expand Down
9 changes: 4 additions & 5 deletions src/entries/web-runtime-with-compiler.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* @flow */

import config from 'core/config'
import { warn, cached } from 'core/util/index'
import { query } from 'web/util/index'
Expand All @@ -7,7 +9,7 @@ import { compileToFunctions } from './web-compiler'
const idToTemplate = cached(id => query(id).innerHTML)
const mount = Vue.prototype.$mount

Vue.prototype.$mount = function (el) {
Vue.prototype.$mount = function (el?: string | Element): Vue {
el = el && query(el)
const options = this.$options
// resolve template/el and convert to render function
Expand Down Expand Up @@ -42,11 +44,8 @@ Vue.prototype.$mount = function (el) {
/**
* Get outerHTML of elements, taking care
* of SVG elements in IE as well.
*
* @param {Element} el
* @return {String}
*/
function getOuterHTML (el) {
function getOuterHTML (el: Element): string {
if (el.outerHTML) {
return el.outerHTML
} else {
Expand Down
4 changes: 3 additions & 1 deletion src/entries/web-runtime.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* @flow */

import Vue from 'core/index'
import config from 'core/config'
import { createPatchFunction } from 'core/vdom/patch'
Expand All @@ -22,7 +24,7 @@ Vue.prototype.__patch__ = config._isServer
: createPatchFunction({ nodeOps, modules })

// wrap mount
Vue.prototype.$mount = function (el) {
Vue.prototype.$mount = function (el?: string | Element): Vue {
this.$el = el && query(el)
return this._mount()
}
Expand Down
7 changes: 6 additions & 1 deletion src/entries/web-server-renderer.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
/* @flow */

import { createRenderer } from 'server/create-renderer'
import { isUnaryTag } from 'web/util/index'
import modules from 'web/server/modules/index'
import baseDirectives from 'web/server/directives/index'

export default function publicCreateRenderer (options = {}) {
export default function publicCreateRenderer (options?: Object = {}): {
renderToString: Function,
renderToStream: Function
} {
// user can provide server-side implementations for custom directives
// when creating the renderer.
const directives = Object.assign(baseDirectives, options.directives)
Expand Down

0 comments on commit b926b9e

Please sign in to comment.