Full Code of GeekyAnts/vue-native-core for AI

master 0c705bebec66 cached
237 files
523.2 KB
146.6k tokens
541 symbols
1 requests
Download .txt
Showing preview only (579K chars total). Download the full file or copy to clipboard to get everything.
Repository: GeekyAnts/vue-native-core
Branch: master
Commit: 0c705bebec66
Files: 237
Total size: 523.2 KB

Directory structure:
gitextract_npbnms5j/

├── .babelrc
├── .eslintignore
├── .eslintrc
├── .flowconfig
├── .github/
│   ├── FUNDING.yml
│   └── ISSUE_TEMPLATE/
│       ├── ---bug-report.md
│       ├── ---issue-with-the-documentation-or-website.md
│       ├── ---issue-with-vue-native-router.md
│       └── ---questions-or-help-with-usage.md
├── .gitignore
├── .prettierrc
├── CHANGELOG.md
├── COMPONENT.md
├── LICENSE
├── README.md
├── __tests__/
│   └── unit/
│       └── features/
│           └── instance/
│               └── init.spec.js
├── converting-react-native-project.md
├── flow/
│   ├── compiler.js
│   ├── component.js
│   ├── global-api.js
│   ├── modules.js
│   ├── options.js
│   ├── ssr.js
│   └── vnode.js
├── jest.config.json
├── jsconfig.json
├── package.json
├── packages/
│   ├── vue-native-core/
│   │   ├── README.md
│   │   ├── index.js
│   │   └── package.json
│   ├── vue-native-helper/
│   │   ├── README.md
│   │   ├── index.js
│   │   └── package.json
│   ├── vue-native-scripts/
│   │   ├── .npmignore
│   │   ├── README.md
│   │   ├── bin/
│   │   │   └── vue-native-script.js
│   │   ├── index.js
│   │   └── package.json
│   └── vue-native-template-compiler/
│       ├── README.md
│       ├── index.js
│       └── package.json
├── scripts/
│   ├── .eslintrc
│   ├── alias.js
│   ├── build.js
│   ├── ci.sh
│   ├── config.js
│   ├── git-hooks/
│   │   └── pre-commit
│   └── release.sh
├── src/
│   ├── compiler/
│   │   ├── codegen/
│   │   │   ├── events.js
│   │   │   └── index.js
│   │   ├── directives/
│   │   │   ├── bind.js
│   │   │   ├── index.js
│   │   │   └── model.js
│   │   ├── error-detector.js
│   │   ├── helpers.js
│   │   ├── index.js
│   │   ├── optimizer.js
│   │   └── parser/
│   │       ├── entity-decoder.js
│   │       ├── filter-parser.js
│   │       ├── html-parser.js
│   │       ├── index.js
│   │       └── text-parser.js
│   ├── core/
│   │   ├── components/
│   │   │   ├── index.js
│   │   │   └── keep-alive.js
│   │   ├── config.js
│   │   ├── global-api/
│   │   │   ├── assets.js
│   │   │   ├── extend.js
│   │   │   ├── index.js
│   │   │   ├── mixin.js
│   │   │   └── use.js
│   │   ├── index.js
│   │   ├── instance/
│   │   │   ├── events.js
│   │   │   ├── index.js
│   │   │   ├── init.js
│   │   │   ├── inject.js
│   │   │   ├── lifecycle.js
│   │   │   ├── proxy.js
│   │   │   ├── render-helpers/
│   │   │   │   ├── bind-object-props.js
│   │   │   │   ├── check-keycodes.js
│   │   │   │   ├── render-list.js
│   │   │   │   ├── render-slot.js
│   │   │   │   ├── render-static.js
│   │   │   │   ├── resolve-filter.js
│   │   │   │   └── resolve-slots.js
│   │   │   ├── render.js
│   │   │   └── state.js
│   │   ├── observer/
│   │   │   ├── array.js
│   │   │   ├── dep.js
│   │   │   ├── index.js
│   │   │   ├── scheduler.js
│   │   │   └── watcher.js
│   │   ├── util/
│   │   │   ├── debug.js
│   │   │   ├── env.js
│   │   │   ├── error.js
│   │   │   ├── index.js
│   │   │   ├── lang.js
│   │   │   ├── options.js
│   │   │   ├── perf.js
│   │   │   └── props.js
│   │   └── vdom/
│   │       ├── create-component.js
│   │       ├── create-element.js
│   │       ├── create-functional-component.js
│   │       ├── helpers/
│   │       │   ├── extract-props.js
│   │       │   ├── get-first-component-child.js
│   │       │   ├── index.js
│   │       │   ├── merge-hook.js
│   │       │   ├── normalize-children.js
│   │       │   ├── resolve-async-component.js
│   │       │   └── update-listeners.js
│   │       ├── modules/
│   │       │   ├── directives.js
│   │       │   ├── index.js
│   │       │   └── ref.js
│   │       ├── patch.js
│   │       └── vnode.js
│   ├── platforms/
│   │   ├── vue-native/
│   │   │   ├── compiler/
│   │   │   │   ├── codegen/
│   │   │   │   │   ├── BaseGenerator.js
│   │   │   │   │   ├── NativeRenderGenerator.js
│   │   │   │   │   ├── RenderGenerator.js
│   │   │   │   │   ├── WebRenderGenerator.js
│   │   │   │   │   └── index.js
│   │   │   │   ├── config.js
│   │   │   │   ├── constants.js
│   │   │   │   ├── directives/
│   │   │   │   │   ├── html.js
│   │   │   │   │   ├── index.js
│   │   │   │   │   ├── model.js
│   │   │   │   │   └── text.js
│   │   │   │   ├── helpers.js
│   │   │   │   ├── index.js
│   │   │   │   ├── modules/
│   │   │   │   │   ├── events.js
│   │   │   │   │   └── style.js
│   │   │   │   ├── native.js
│   │   │   │   ├── parser/
│   │   │   │   │   ├── filter-parser.js
│   │   │   │   │   └── text-parser.js
│   │   │   │   ├── property/
│   │   │   │   │   ├── ARIADOMPropertyConfig.js
│   │   │   │   │   ├── EventConstant.js
│   │   │   │   │   ├── HTMLDOMPropertyConfig.js
│   │   │   │   │   ├── ReactProps.js
│   │   │   │   │   ├── SVGDOMPropertyConfig.js
│   │   │   │   │   └── index.js
│   │   │   │   ├── util/
│   │   │   │   │   ├── attrs.js
│   │   │   │   │   ├── element.js
│   │   │   │   │   └── index.js
│   │   │   │   └── web.js
│   │   │   ├── compiler.js
│   │   │   ├── index.js
│   │   │   ├── observer.js
│   │   │   ├── runtime/
│   │   │   │   ├── components/
│   │   │   │   │   ├── buildComponent.js
│   │   │   │   │   ├── buildDirective.js
│   │   │   │   │   ├── buildInputComponent.js
│   │   │   │   │   ├── buildMixin.js
│   │   │   │   │   ├── buildNativeComponent.js
│   │   │   │   │   ├── buildWebEmptyComponent.js
│   │   │   │   │   ├── buildWebInputComponent.js
│   │   │   │   │   ├── buildWebTransition.js
│   │   │   │   │   ├── index.js
│   │   │   │   │   └── util.js
│   │   │   │   ├── directives/
│   │   │   │   │   ├── index.js
│   │   │   │   │   └── model.js
│   │   │   │   ├── helpers.js
│   │   │   │   ├── index.js
│   │   │   │   ├── lifeCycle.js
│   │   │   │   ├── render-helpers/
│   │   │   │   │   ├── bindNativeClass.js
│   │   │   │   │   ├── bindNativeStyle.js
│   │   │   │   │   ├── bindWebClass.js
│   │   │   │   │   ├── bindWebStyle.js
│   │   │   │   │   ├── checkKeyCodes.js
│   │   │   │   │   ├── directive.js
│   │   │   │   │   ├── dynamicComponent.js
│   │   │   │   │   ├── event.js
│   │   │   │   │   ├── handleProps.js
│   │   │   │   │   ├── index.js
│   │   │   │   │   ├── mergeCssModule.js
│   │   │   │   │   ├── mergeNativeStyleAndNativeClass.js
│   │   │   │   │   ├── mergeProps.js
│   │   │   │   │   ├── renderList.js
│   │   │   │   │   ├── renderSlot.js
│   │   │   │   │   ├── resolveFilter.js
│   │   │   │   │   ├── template.js
│   │   │   │   │   ├── transitionGroupWeb.js
│   │   │   │   │   └── transitionWeb.js
│   │   │   │   └── render.js
│   │   │   └── scripts/
│   │   │       ├── compiler.js
│   │   │       ├── index.js
│   │   │       ├── transformerPlugin.js
│   │   │       └── util/
│   │   │           ├── addvm.js
│   │   │           ├── constants.js
│   │   │           ├── parseCss.js
│   │   │           └── parseTransform.js
│   │   └── web/
│   │       ├── compiler/
│   │       │   ├── directives/
│   │       │   │   ├── html.js
│   │       │   │   ├── index.js
│   │       │   │   ├── model.js
│   │       │   │   └── text.js
│   │       │   ├── index.js
│   │       │   ├── modules/
│   │       │   │   ├── class.js
│   │       │   │   ├── index.js
│   │       │   │   └── style.js
│   │       │   └── util.js
│   │       ├── compiler.js
│   │       ├── runtime/
│   │       │   ├── class-util.js
│   │       │   ├── components/
│   │       │   │   ├── index.js
│   │       │   │   ├── transition-group.js
│   │       │   │   └── transition.js
│   │       │   ├── directives/
│   │       │   │   ├── index.js
│   │       │   │   ├── model.js
│   │       │   │   └── show.js
│   │       │   ├── index.js
│   │       │   ├── modules/
│   │       │   │   ├── attrs.js
│   │       │   │   ├── class.js
│   │       │   │   ├── dom-props.js
│   │       │   │   ├── events.js
│   │       │   │   ├── index.js
│   │       │   │   ├── style.js
│   │       │   │   └── transition.js
│   │       │   ├── node-ops.js
│   │       │   ├── patch.js
│   │       │   └── transition-util.js
│   │       ├── runtime-with-compiler.js
│   │       ├── runtime.js
│   │       └── util/
│   │           ├── attrs.js
│   │           ├── class.js
│   │           ├── compat.js
│   │           ├── element.js
│   │           ├── index.js
│   │           └── style.js
│   ├── sfc/
│   │   └── parser.js
│   └── shared/
│       ├── constants.js
│       └── util.js
└── types/
    ├── index.d.ts
    ├── options.d.ts
    ├── plugin.d.ts
    ├── test/
    │   ├── augmentation-test.ts
    │   ├── options-test.ts
    │   ├── plugin-test.ts
    │   ├── tsconfig.json
    │   └── vue-test.ts
    ├── typings.json
    ├── vnode.d.ts
    └── vue.d.ts

================================================
FILE CONTENTS
================================================

================================================
FILE: .babelrc
================================================
{
  "env": {
    "test": {
      "presets": [
        ["@babel/preset-env", {
          "targets": {"node": "current"},
          "modules": "commonjs"
        }],
        "@babel/preset-flow"
      ]
    }
  }
}

================================================
FILE: .eslintignore
================================================
flow
dist
packages


================================================
FILE: .eslintrc
================================================
{
  "root": true,
  "parserOptions": {
    "parser": "babel-eslint",
    "ecmaVersion": 2018,
    "sourceType": "module"
  },
  "env": {
    "es6": true,
    "node": true,
    "browser": true
  },
  "plugins": [
    "flowtype",
    "prettier"
  ],
  "extends": [
    "eslint:recommended",
    "plugin:flowtype/recommended",
    "plugin:prettier/recommended"
  ],
  "rules": {
    "prettier/prettier": ["error"],
    "no-console": 0,
    "no-useless-escape": 0,
    "no-empty": 0,
    "semi": ["error", "never"],
    "comma-dangle": ["error", "always-multiline"]
  },
  "globals": {
    "__WEEX__": true
  }
}

================================================
FILE: .flowconfig
================================================
[ignore]
.*/__tests__/.*
.*/node_modules/.*
.*/examples/.*
.*/packages/.*
.*/scripts/.*

[include]

[libs]
flow

[options]
unsafe.enable_getters_and_setters=true
module.name_mapper='^compiler/\(.*\)$' -> '<PROJECT_ROOT>/src/compiler/\1'
module.name_mapper='^core/\(.*\)$' -> '<PROJECT_ROOT>/src/core/\1'
module.name_mapper='^shared/\(.*\)$' -> '<PROJECT_ROOT>/src/shared/\1'
module.name_mapper='^web/\(.*\)$' -> '<PROJECT_ROOT>/src/platforms/web/\1'
module.name_mapper='^weex/\(.*\)$' -> '<PROJECT_ROOT>/src/platforms/weex/\1'
module.name_mapper='^vue-native/\(.*\)$' -> '<PROJECT_ROOT>/src/platforms/vue-native/\1'
module.name_mapper='^server/\(.*\)$' -> '<PROJECT_ROOT>/src/server/\1'
module.name_mapper='^entries/\(.*\)$' -> '<PROJECT_ROOT>/src/entries/\1'
module.name_mapper='^sfc/\(.*\)$' -> '<PROJECT_ROOT>/src/sfc/\1'
suppress_comment= \\(.\\|\n\\)*\\$flow-disable-line


================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: vue-native-core
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
custom: # Replace with a single custom sponsorship URL


================================================
FILE: .github/ISSUE_TEMPLATE/---bug-report.md
================================================
---
name: "\U0001F41E Bug report"
about: Spotted a bug in Vue Native?
title: ''
labels: ''

---

**Description of the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**What I expected**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Did I use `vue-native-cli` to create the project?**
Yes/No

**Am I using Expo?**
Yes/No
- If you created your project with `vue-native init <projectName>` then yes
- If you used `vue-native init <projectName> --no-expo`, then no

**Development platform (please complete the following information):**
 - OS: [e.g. iOS]
 - Shell/terminal: [e.g. ZSH, PowerShell]

**The device on which I run my Vue Native app**
 - Device: [e.g. iPhone6]
 - OS: [e.g. iOS8.1]

**Additional context**
Add any other context about the problem here.


================================================
FILE: .github/ISSUE_TEMPLATE/---issue-with-the-documentation-or-website.md
================================================
---
name: "\U0001F4D6 Issue with the documentation or website"
about: Spotted something incorrect or outdated in the docs? Website not rendering correctly?
title: ''
labels: ''

---

This repository only hosts the core packages of Vue Native.

If you have an issue with the docs or website, please create an issue in the [Vue Native Website repository](https://github.com/GeekyAnts/vue-native-website/issues).

Issues opened here that are related to the documentation/website will be closed.


================================================
FILE: .github/ISSUE_TEMPLATE/---issue-with-vue-native-router.md
================================================
---
name: "\U0001F9ED Issue with Vue Native Router"
about: Having trouble with Vue Native Router?
title: ''
labels: ''

---

This repository only hosts the core packages of Vue Native.

If you have an issue with Vue Native Router, please create an issue in the [Vue Native Router repository](https://github.com/GeekyAnts/vue-native-router/issues).

Issues opened here that are related to Vue Native Router will be closed.


================================================
FILE: .github/ISSUE_TEMPLATE/---questions-or-help-with-usage.md
================================================
---
name: "\U0001F9D0 Questions or help with usage"
about: Need help with code or Vue Native usage?
title: 'Question: '
labels: ''

---

The best place to find answers is the [documentation](https://www.vue-native.io/docs/installation.html)  📖

If you still haven't found what you are looking for or need more help, feel free to reach out on [Vue Native Slack](http://slack.vue-native.io/)


================================================
FILE: .gitignore
================================================
.DS_Store
.vscode
.idea

node_modules

*.log

dist/*.gz
dist/*.map
dist/vue.common.min.js

coverage

packages/**/build.js
packages/**/package-lock.json
packages/**/.watchmanconfig


================================================
FILE: .prettierrc
================================================
{
  "parser": "babel",
  "semi": false,
  "trailingComma": "all",
  "singleQuote": true
}

================================================
FILE: CHANGELOG.md
================================================
# Changelog
All notable changes to this project will be documented in this file.

## [ 0.0.1 ] - 2018-08-01
### :zap: Improvements
- Support for v-model in switch.
- `render-prop` and `render-prop-fn` as API to provide a way to pass JSX as props (inline jsx props) or callback which      returns JSX thus avoiding the need to use JSX for components such as Flat List.
- Named Slots support and Basic scoped slots support.

================================================
FILE: COMPONENT.md
================================================
# Vue Component API
> Vue component actually runs in the React runtime. It means, you can not access [VNode](https://vuejs.org/v2/api/#VNode-Interface), you can not use [Render](https://vuejs.org/v2/guide/render-function.html). Conversely, if your previous Vue component does not involve both things, it would most likely run directly in React. 

* web: [react-vue-loader](https://github.com/SmallComfort/react-vue-loader) ([demo](https://github.com/SmallComfort/react-vue-material-demo))
* native: [vue-native-scripts](https://github.com/GeekyAnts/vue-native-core/tree/master/packages/vue-native-scripts) ([demo](https://github.com/SmallComfort/HackerNews))

## Supported API

#### Global Config
> Use the react-vue-loader options: [```vue```](https://github.com/SmallComfort/react-vue-loader#additional-options)
* [silent](https://vuejs.org/v2/api/#silent)

* [optionMergeStrategies](https://vuejs.org/v2/api/#optionMergeStrategies)
* [errorHandler](https://vuejs.org/v2/api/#errorHandler)
* [ignoredElements](https://vuejs.org/v2/api/#ignoredElements) (web only)
* [keyCodes](https://vuejs.org/v2/api/#keyCodes) (web only)

#### Global API
> Use the react-vue-loader options: [```vue```](https://github.com/SmallComfort/react-vue-loader#additional-options)
* [Vue.extend](https://vuejs.org/v2/api/#Vue-extend)

* [Vue.nextTick](https://vuejs.org/v2/api/#Vue-nextTick)
* [Vue.set](https://vuejs.org/v2/api/#Vue-set)
* [Vue.delete](https://vuejs.org/v2/api/#Vue-delete)
* [Vue.directive](https://vuejs.org/v2/api/#Vue-directive) (web only)
  > [partial support](https://github.com/SmallComfort/react-vue/blob/dev/packages/react-vue/COMPONENT.md#options--assets)
* [Vue.component](https://vuejs.org/v2/api/#Vue-component)
* [Vue.use](https://vuejs.org/v2/api/#Vue-use)
* [Vue.mixin](https://vuejs.org/v2/api/#Vue-mixin)
* [Vue.version](https://vuejs.org/v2/api/#Vue-version)

#### Options / Data
* [data](https://vuejs.org/v2/api/#data)

* [props](https://vuejs.org/v2/api/#props)
* [computed](https://vuejs.org/v2/api/#computed)
* [methods](https://vuejs.org/v2/api/#methods)
* [watch](https://vuejs.org/v2/api/#watch)

#### Options / Lifecycle Hooks
* [beforeCreate](https://vuejs.org/v2/api/#beforeCreate)

* [created](https://vuejs.org/v2/api/#created)
* [beforeMount](https://vuejs.org/v2/api/#beforeMount)
* [mounted](https://vuejs.org/v2/api/#mounted)
* [beforeUpdate](https://vuejs.org/v2/api/#beforeUpdate)
* [updated](https://vuejs.org/v2/api/#updated)
* [beforeDestroy](https://vuejs.org/v2/api/#beforeDestroy)

#### Options / Assets
* [directives](https://vuejs.org/v2/api/#directives) (web only)
  * [Hook-Functions](https://vuejs.org/v2/guide/custom-directive.html#Hook-Functions)
    * bind
    * update
    * unbind
  * [Directive-Hook-Arguments](https://vuejs.org/v2/guide/custom-directive.html#Directive-Hook-Arguments)
    * el
    * binding
    * vnode (only one property ```context```)

* [components](https://vuejs.org/v2/api/#components)

#### Options / Composition
* [mixins](https://vuejs.org/v2/api/#mixins)

* [extends](https://vuejs.org/v2/api/#extends)

  > Only options object is allowed

#### Options / Misc
* [name](https://vuejs.org/v2/api/#name)

#### Instance Properties
* [vm.$data](https://vuejs.org/v2/api/#vm-data)

* [vm.$props](https://vuejs.org/v2/api/#vm-props)
* [vm.$el](https://vuejs.org/v2/api/#vm-el)
* [vm.$options](https://vuejs.org/v2/api/#vm-options)
* [vm.$parent](https://vuejs.org/v2/api/#vm-parent)
* [vm.$root](https://vuejs.org/v2/api/#vm-root)
* [vm.$children](https://vuejs.org/v2/api/#vm-children)
* [vm.$slots](https://vuejs.org/v2/api/#vm-slots)
* [vm.$refs](https://vuejs.org/v2/api/#vm-refs)

#### Instance Methods / Data
* [vm.$watch](https://vuejs.org/v2/api/#vm-watch)

* [vm.$set](https://vuejs.org/v2/api/#vm-set)
* [vm.$delete](https://vuejs.org/v2/api/#vm-delete)

#### Instance Methods / Events
* [vm.$on](https://vuejs.org/v2/api/#vm-on)

* [vm.$once](https://vuejs.org/v2/api/#vm-once)
* [vm.$off](https://vuejs.org/v2/api/#vm-off)
* [vm.$emit](https://vuejs.org/v2/api/#vm-emit)

#### Instance Methods / Lifecycle
* [vm.$forceUpdate](https://vuejs.org/v2/api/#vm-forceUpdate)

* [vm.$nextTick](https://vuejs.org/v2/api/#vm-nextTick)

#### Directives
* [v-text](https://vuejs.org/v2/api/#v-text) (web only)

* [v-html](https://vuejs.org/v2/api/#v-html) (web only)
* [v-show](https://vuejs.org/v2/api/#v-show)
* [v-if](https://vuejs.org/v2/api/#v-if)
* [v-else](https://vuejs.org/v2/api/#v-else)
* [v-else-if](https://vuejs.org/v2/api/#v-else-if)
* [v-for](https://vuejs.org/v2/api/#v-for)
* [v-on](https://vuejs.org/v2/api/#v-on) (web only)
* [v-bind](https://vuejs.org/v2/api/#v-bind)
* [v-model](https://vuejs.org/v2/api/#v-model) (web only)
  > Unsupported features: [value bindings checkbox](https://vuejs.org/v2/guide/forms.html#Checkbox-1) & [value bindings select options](https://vuejs.org/v2/guide/forms.html#Select-Options)

#### Special Attributes
* [key](https://vuejs.org/v2/api/#key)

* [ref](https://vuejs.org/v2/api/#ref)
* [slot](https://vuejs.org/v2/api/#slot)
* [is](https://vuejs.org/v2/api/#is)

#### Built-In Components
* [component](https://vuejs.org/v2/api/#component)

* [transition](https://vuejs.org/v2/api/#transition) (web only)
  > The \<transition> would render an extra DOM element, you can configure ```tag``` attribute to custom the extra DOM element

  > Unsupported features: [transition modes](https://vuejs.org/v2/guide/transitions.html#Transition-Modes)

* [slot](https://vuejs.org/v2/api/#slot)

#### Server-Side Rendering (web only)
  > Use React Server Rendering

## Unsupported API

#### Global Config
* ~~[performance](https://vuejs.org/v2/api/#performance)~~
* ~~[devtools](https://vuejs.org/v2/api/#devtools)~~
* ~~[productionTip](https://vuejs.org/v2/api/#productionTip)~~

#### Global API
* ~~[Vue.filter](https://vuejs.org/v2/api/#Vue-filter)~~

* ~~[Vue.compile](https://vuejs.org/v2/api/#Vue-compile)~~

#### Options / Data
* ~~[propsData](https://vuejs.org/v2/api/#propsData)~~

#### Options / DOM
* ~~[el](https://vuejs.org/v2/api/#el)~~

* ~~[template](https://vuejs.org/v2/api/#template)~~
* ~~[render](https://vuejs.org/v2/api/#render)~~
* ~~[renderError](https://vuejs.org/v2/api/#renderError)~~

#### Options / Lifecycle Hooks
* ~~[activated](https://vuejs.org/v2/api/#activated)~~

* ~~[deactivated](https://vuejs.org/v2/api/#deactivated)~~
* ~~[destroyed](https://vuejs.org/v2/api/#destroyed)~~

#### Options / Assets
* ~~[filters](https://vuejs.org/v2/api/#filters)~~

#### Options / Misc
* ~~[delimiters](https://vuejs.org/v2/api/#delimiters)~~

* ~~[functional](https://vuejs.org/v2/api/#functional)~~
* ~~[model](https://vuejs.org/v2/api/#model)~~

#### Instance Properties
* ~~[vm.$scopedSlots](https://vuejs.org/v2/api/#vm-scopedSlots)~~

* ~~[vm.$isServer](https://vuejs.org/v2/api/#vm-isServer)~~

#### Instance Methods / Lifecycle
* ~~[vm.$mount](https://vuejs.org/v2/api/#vm-mount)~~

* ~~[vm.$destroy](https://vuejs.org/v2/api/#vm-destroy)~~

#### Directives
* ~~[v-pre](https://vuejs.org/v2/api/#v-pre)~~

* ~~[v-cloak](https://vuejs.org/v2/api/#v-cloak)~~
* ~~[v-once](https://vuejs.org/v2/api/#v-once)~~

#### Built-In Components
* ~~[transition-group](https://vuejs.org/v2/api/#transition-group)~~
* ~~[keep-alive](https://vuejs.org/v2/api/#keep-alive)~~

#### ~~VNode Interface~~


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2013-present, Yuxi (Evan) You

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


================================================
FILE: README.md
================================================
## ⚠️ This project has been deprecated and is no longer maintained ⚠️

# Vue Native

[![No Maintenance Intended](https://unmaintained.tech/badge.svg)](http://unmaintained.tech/)

Visit our website at [vue-native.io](https://vue-native.io) or read the official documentation [here](https://vue-native.io/docs/installation.html).

## Build native mobile apps using Vue

Vue Native is a framework to build cross platform native mobile apps using JavaScript. It is a wrapper around the APIs of React Native. So, with Vue Native, you can do everything that you can do with React Native. With Vue Native, you get

- **The simplicity of Vue.js.** Incrementally build user interfaces with the familiar syntax of HTML and CSS in single file components.
- **Seamless interop with React Native.** Use core React Native components with Vue.js syntax out of the box to develop mobile apps on both iOS and Android.

## Contents
- [Documentation](#documentation)
- [Installation](#installation)
- [Project setup with Vue Native CLI](#project-setup-with-vue-native-cli)
- [Using Vue Native with a pre-existing React Native or Expo project](#using-vue-native-in-a-react-native-project)
- [Available React Native components](#available-react-native-components)
- [Contributors](#contributors)
- [License](#license)
- [Special thanks](#credits-to-react-vue)

## Documentation

You can find the full documentation for Vue Native [on this website](https://vue-native.io/docs/installation.html). It covers installation and setup, component basics, routing, testing, the internal API and more.

The source for the Vue Native documentation and website is hosted on a separate repo, [here](https://github.com/GeekyAnts/vue-native-website)


## About Vue Native

   Vue Native is developed and maintained by [GeekyAnts](https://geekyants.com?utm_source=github&utm_medium=opensource&utm_campaign=vue-native-core),
   specialists in [cross-platform mobile development](https://geekyants.com/solution/universal-and-cross-platform-app-development-services?utm_source=github&utm_medium=opensource&utm_campaign=vue-native-core).

   ### Why Choose Vue Native?

   - Write Vue.js code, get native mobile apps
   - Leverage existing Vue.js knowledge
   - Access React Native's ecosystem

   ### Professional Services

   Looking to build a production app with Vue Native? Our
   [mobile engineering team](https://geekyants.com/service/hire-mobile-app-development-services?utm_source=github&utm_medium=opensource&utm_campaign=vue-native-core)
   can help you:

   - Architect scalable mobile applications
   - Migrate from other frameworks
   - Optimize app performance

   [Get in touch](https://geekyants.com/hire?utm_source=github&utm_medium=opensource&utm_campaign=vue-native-core)

## Installation

To install Vue Native's official CLI, run
```
$ npm install vue-native-cli -g
```

To use the CLI, you must have either [expo-cli](https://github.com/expo/expo-cli) or [react-native-cli](https://github.com/react-native-community/cli) installed globally.

## Project setup with Vue Native CLI

The Vue Native CLI can be used to easily generate a fully configured Vue Native app. It wraps `expo-cli` and `react-native-cli` to generate a simple single page application (SPA) after installing and configuring dependencies from [vue-native-core](https://github.com/GeekyAnts/vue-native-core).

You should have either expo-cli or react-native-cli installed as a global dependency. Refer to the [installation guide](https://vue-native.io/docs/installation.html) for details on project setup. The GitHub repository for Vue Native CLI is hosted [here](https://github.com/GeekyAnts/vue-native-cli).

With the CLI, generating a Vue Native project is as easy as running the command
```
$ vue-native init <projectName>
```

## Using Vue Native in a React Native project

It is possible to integrate Vue Native into a pre-existing React Native project. You can find instructions to do this [here](converting-react-native-project.md).

These instructions can also be used to set up a Vue Native project from scratch.

## Available React Native components

All the core components of React Native 0.63 onwards are globally registered and available to use in templates without the need to import and locally register.

[The components and their React Native documentation can be found here.](https://reactnative.dev/docs/components-and-apis)

All other components that were previously available, but then deprecated from React Native can still be used by installing their respective packages.

For example, to use `WebView`, use the [react-native-webview](https://github.com/react-native-webview/react-native-webview) package.

## Contributors

This project exists thanks to all the people who contribute. 
<a href="https://github.com/GeekyAnts/vue-native-core/contributors"><img src="https://opencollective.com/vue-native-core/contributors.svg?width=890&button=false" /></a>

Maintained by [GeekyAnts](https://geekyants.com?utm_source=github&utm_medium=opensource&utm_campaign=vue-native-core) -
   [Cross-Platform Development Experts](https://geekyants.com/solution/universal-and-cross-platform-app-development-services?utm_source=github&utm_medium=opensource&utm_campaign=vue-native-core)


## License

[MIT](http://opensource.org/licenses/MIT)

## Credits to [react-vue](https://github.com/SmallComfort/react-vue)

A huge thanks to the author of react-vue for most of the work on Vue Native.


================================================
FILE: __tests__/unit/features/instance/init.spec.js
================================================
import Vue from 'vue-native/index'

describe('Initialization', () => {
  function noop () {}

  let asserted

  function createCompareFn (spy) {
    const hasWarned = msg => {
      var count = spy.calls.count()
      var args
      while (count--) {
        args = spy.calls.argsFor(count)
        if (args.some(containsMsg)) {
          return true
        }
      }

      function containsMsg (arg) {
        return arg.toString().indexOf(msg) > -1
      }
    }

    return {
      compare: msg => {
        asserted = asserted.concat(msg)
        var warned = Array.isArray(msg)
          ? msg.some(hasWarned)
          : hasWarned(msg)
        return {
          pass: warned,
          message: warned
            ? 'Expected message "' + msg + '" not to have been warned'
            : 'Expected message "' + msg + '" to have been warned'
        }
      }
    }
  }

  // define custom matcher for warnings
  beforeEach(() => {
    asserted = []
    spyOn(console, 'warn')
    spyOn(console, 'error')
    jasmine.addMatchers({
      toHaveBeenWarned: () => createCompareFn(console.error),
      toHaveBeenTipped: () => createCompareFn(console.warn)
    })
  })

  afterEach(done => {
    const warned = msg => asserted.some(assertedMsg => msg.toString().indexOf(assertedMsg) > -1)
    let count = console.error.calls.count()
    let args
    while (count--) {
      args = console.error.calls.argsFor(count)
      if (!warned(args[0])) {
        done.fail(`Unexpected console.error message: ${args[0]}`)
        return
      }
    }
    done()
  })

  it('without new', () => {
    try { Vue() } catch (e) {}
    expect('Vue is a constructor and should be called with the `new` keyword').toHaveBeenWarned()
  })

  it('with new', () => {
    expect(new Vue() instanceof Vue).toBe(true)
  })
})


================================================
FILE: converting-react-native-project.md
================================================
## Setting up a React Native project for Vue Native

[Vue Native CLI](https://github.com/GeekyAnts/vue-native-cli) is the recommended way to setup a new Vue Native project. However, if you wish to setup a project from scratch, use the following steps after setting up a React Native / Expo project.

### Step 1: Install

The following packages are required as runtime dependencies by Vue Native:
- [vue-native-core](https://www.npmjs.com/package/vue-native-core)
- [vue-native-helper](https://www.npmjs.com/package/vue-native-helper)

During development, another package is required to transpile Vue Native component files (with `.vue` extensions) into JS:
- [vue-native-scripts](https://www.npmjs.com/package/vue-native-scripts)

To install them, run the following commands in your project directory
```
$ npm install --save vue-native-core vue-native-helper
$ npm install --save-dev vue-native-scripts
```

### Step 2: Configure the React Native bundler

The Metro bundler is used by React Native to generate app bundles. It can be configured using a `metro.config.js` file. Add the following to your `metro.config.js` (make one to your project's root if you don't have one already):

```js
const { getDefaultConfig } = require("metro-config");

module.exports = (async () => {
  const {
    resolver: { sourceExts }
  } = await getDefaultConfig();
  return {
    transformer: {
      babelTransformerPath: require.resolve("./vueTransformerPlugin.js"),
      getTransformOptions: async () => ({
        transform: {
          experimentalImportSupport: false,
          inlineRequires: false,
        },
      })
    },
    resolver: {
      sourceExts: [...sourceExts, "vue"]
    }
  };
})();
```

#### NOTE to Expo users:

The `app.json` file must be modified to allow `.vue` files to be recognised.

```diff
{
  "expo": {
    "sdkVersion": "34.0.0",
    "platforms": [
      "ios",
      "android",
      "web"
    ],
    ...
    "packagerOpts": {
+     "sourceExts": ["js", "json", "ts", "tsx", "vue"],
      "config": "metro.config.js"
    }
  }
}
```


The `babelTransformPath` property above takes the path to the transformer you wish to use. In our case, we need to create a `vueTransformerPlugin.js` file to the project's root and specify supported extensions:

```js
const vueNativeScripts = require("vue-native-scripts");

const upstreamTransformer = require("metro-react-native-babel-transformer");

const vueExtensions = ["vue"]; // <-- Add other extensions if needed.

module.exports.transform = function ({ src, filename, options }) {
  if (vueExtensions.some(ext => filename.endsWith("." + ext))) {
    return vueNativeScripts.transform({ src, filename, options });
  }
  return upstreamTransformer.transform({ src, filename, options });
};
```

This file conditionally transforms files based on their extensions. `vue-native-scripts` is used for `.vue` files, while the stock React Native Babel transformer is used for other (JS) files.

## Using Vue Native components and `.vue` files

In the React Native application, you can simply `import` your Vue components as follows

```
import VueComponent from './VueComponent.vue'
```

There should be a file named `VueComponent.vue` in the corresponding folder; the transformer parses this file and sends it to the React Native bundler.


================================================
FILE: flow/compiler.js
================================================
declare type CompilerOptions = {
  warn?: Function; // allow customizing warning in different environments; e.g. node
  expectHTML?: boolean; // only false for non-web builds
  modules?: Array<ModuleOptions>; // platform specific modules; e.g. style; class
  staticKeys?: string; // a list of AST properties to be considered static; for optimization
  directives?: { [key: string]: Function }; // platform specific directives
  isUnaryTag?: (tag: string) => ?boolean; // check if a tag is unary for the platform
  canBeLeftOpenTag?: (tag: string) => ?boolean; // check if a tag can be left opened
  isReservedTag?: (tag: string) => ?boolean; // check if a tag is a native for the platform
  mustUseProp?: (tag: string, type: ?string, name: string) => boolean; // check if an attribute should be bound as a property
  isPreTag?: (attr: string) => ?boolean; // check if a tag needs to preserve whitespace
  getTagNamespace?: (tag: string) => ?string; // check the namespace for a tag
  transforms?: Array<Function>; // a list of transforms on parsed AST before codegen
  preserveWhitespace?: boolean;
  isFromDOM?: boolean;
  shouldDecodeTags?: boolean;
  shouldDecodeNewlines?: boolean;

  // runtime user-configurable
  delimiters?: [string, string]; // template delimiters
}

declare type CompiledResult = {
  ast: ?ASTElement;
  render: string;
  staticRenderFns: Array<string>;
  errors?: Array<string>;
  tips?: Array<string>;
}

declare type CompiledFunctionResult = {
  render: Function;
  staticRenderFns: Array<Function>;
}

declare type ModuleOptions = {
  preTransformNode: (el: ASTElement) => void;
  transformNode: (el: ASTElement) => void; // transform an element's AST node
  postTransformNode: (el: ASTElement) => void;
  genData: (el: ASTElement) => string; // generate extra data string for an element
  transformCode?: (el: ASTElement, code: string) => string; // further transform generated code for an element
  staticKeys?: Array<string>; // AST properties to be considered static
}

declare type ASTModifiers = { [key: string]: boolean }
declare type ASTIfConditions = Array<{ exp: ?string; block: ASTElement }>

declare type ASTElementHandler = {
  value: string;
  modifiers: ?ASTModifiers;
}

declare type ASTElementHandlers = {
  [key: string]: ASTElementHandler | Array<ASTElementHandler>;
}

declare type ASTDirective = {
  name: string;
  rawName: string;
  value: string;
  arg: ?string;
  modifiers: ?ASTModifiers;
}

declare type ASTNode = ASTElement | ASTText | ASTExpression

declare type ASTElement = {
  type: 1;
  tag: string;
  attrsList: Array<{ name: string; value: string }>;
  attrsMap: { [key: string]: string | null };
  parent: ASTElement | void;
  children: Array<ASTNode>;

  static?: boolean;
  staticRoot?: boolean;
  staticInFor?: boolean;
  staticProcessed?: boolean;
  hasBindings?: boolean;

  text?: string;
  attrs?: Array<{ name: string; value: string }>;
  props?: Array<{ name: string; value: string }>;
  plain?: boolean;
  pre?: true;
  ns?: string;

  component?: string;
  inlineTemplate?: true;
  transitionMode?: string | null;
  slotName?: ?string;
  slotTarget?: ?string;
  slotScope?: ?string;
  scopedSlots?: { [name: string]: ASTElement };

  ref?: string;
  refInFor?: boolean;

  if?: string;
  ifProcessed?: boolean;
  elseif?: string;
  else?: true;
  ifConditions?: ASTIfConditions;

  for?: string;
  forProcessed?: boolean;
  key?: string;
  alias?: string;
  iterator1?: string;
  iterator2?: string;

  staticClass?: string;
  classBinding?: string;
  staticStyle?: string;
  styleBinding?: string;
  events?: ASTElementHandlers;
  nativeEvents?: ASTElementHandlers;

  transition?: string | true;
  transitionOnAppear?: boolean;

  model?: {
    value: string;
    callback: string;
    expression: string;
  };

  directives?: Array<ASTDirective>;

  forbidden?: true;
  once?: true;
  onceProcessed?: boolean;
  wrapData?: (code: string) => string;

  // weex specific
  appendAsTree?: boolean;
}

declare type ASTExpression = {
  type: 2;
  expression: string;
  text: string;
  static?: boolean;
}

declare type ASTText = {
  type: 3;
  text: string;
  static?: boolean;
}

// SFC-parser related declarations

// an object format describing a single-file component.
declare type SFCDescriptor = {
  template: ?SFCBlock;
  script: ?SFCBlock;
  styles: Array<SFCBlock>;
  customBlocks: Array<SFCCustomBlock>;
}

declare type SFCCustomBlock = {
  type: string;
  content: string;
  start?: number;
  end?: number;
  src?: string;
  attrs: {[attribute:string]: string};
}

declare type SFCBlock = {
  type: string;
  content: string;
  start?: number;
  end?: number;
  lang?: string;
  src?: string;
  scoped?: boolean;
  module?: string | boolean;
}


================================================
FILE: flow/component.js
================================================
import type { Config } from '../src/core/config'
import type VNode from '../src/core/vdom/vnode'
import type Watcher from '../src/core/observer/watcher'

declare interface Component {
  // constructor information
  static cid: number;
  static options: Object;
  // extend
  static extend: (options: Object) => Function;
  static superOptions: Object;
  static extendOptions: Object;
  static sealedOptions: Object;
  static super: Class<Component>;
  // assets
  static directive: (id: string, def?: Function | Object) => Function | Object | void;
  static component: (id: string, def?: Class<Component> | Object) => Class<Component>;
  static filter: (id: string, def?: Function) => Function | void;

  // public properties
  $el: any; // so that we can attach __vue__ to it
  $data: Object;
  $options: ComponentOptions;
  $parent: Component | void;
  $root: Component;
  $children: Array<Component>;
  $refs: { [key: string]: Component | Element | Array<Component | Element> | void };
  $slots: { [key: string]: Array<VNode> };
  $scopedSlots: { [key: string]: () => VNodeChildren };
  $vnode: VNode; // the placeholder node for the component in parent's render tree
  $isServer: boolean;
  $props: Object;

  // public methods
  $mount: (el?: Element | string, hydrating?: boolean) => Component;
  $forceUpdate: () => void;
  $destroy: () => void;
  $set: <T>(target: Object | Array<T>, key: string | number, val: T) => T;
  $delete: <T>(target: Object | Array<T>, key: string | number) => void;
  $watch: (expOrFn: string | Function, cb: Function, options?: Object) => Function;
  $on: (event: string | Array<string>, fn: Function) => Component;
  $once: (event: string, fn: Function) => Component;
  $off: (event?: string | Array<string>, fn?: Function) => Component;
  $emit: (event: string, ...args: Array<mixed>) => Component;
  $nextTick: (fn: Function) => void;
  $createElement: (tag?: string | Component, data?: Object, children?: VNodeChildren) => VNode;

  // private properties
  _uid: number;
  _name: string; // this only exists in dev mode
  _isVue: true;
  _self: Component;
  _renderProxy: Component;
  _renderContext: ?Component;
  _watcher: Watcher;
  _watchers: Array<Watcher>;
  _computedWatchers: { [key: string]: Watcher };
  _data: Object;
  _props: Object;
  _events: Object;
  _inactive: boolean | null;
  _directInactive: boolean;
  _isMounted: boolean;
  _isDestroyed: boolean;
  _isBeingDestroyed: boolean;
  _vnode: ?VNode; // self root node
  _staticTrees: ?Array<VNode>;
  _hasHookEvent: boolean;
  _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;
  // createElement
  // _c is internal that accepts `normalizationType` optimization hint
  _c: (vnode?: VNode, data?: VNodeData, children?: VNodeChildren, normalizationType?: number) => VNode | void;
  // renderStatic
  _m: (index: number, isInFor?: boolean) => VNode | VNodeChildren;
  // markOnce
  _o: (vnode: VNode | Array<VNode>, index: number, key: string) => VNode | VNodeChildren;
  // toString
  _s: (value: mixed) => string;
  // text to VNode
  _v: (value: string | number) => VNode;
  // toNumber
  _n: (value: string) => number | string;
  // empty vnode
  _e: () => VNode;
  // loose equal
  _q: (a: mixed, b: mixed) => boolean;
  // loose indexOf
  _i: (arr: Array<mixed>, val: mixed) => number;
  // resolveFilter
  _f: (id: string) => Function;
  // renderList
  _l: (val: mixed, render: Function) => ?Array<VNode>;
  // renderSlot
  _t: (name: string, fallback: ?Array<VNode>, props: ?Object) => ?Array<VNode>;
  // apply v-bind object
  _b: (data: any, value: any, asProp?: boolean) => VNodeData;
  // check custom keyCode
  _k: (eventKeyCode: number, key: string, builtInAlias: number | Array<number> | void) => boolean;
  // resolve scoped slots
  _u: (scopedSlots: Array<[string, Function]>) => { [key: string]: Function };

  // allow dynamic method registration
  [key: string]: any
}


================================================
FILE: flow/global-api.js
================================================
declare interface GlobalAPI {
  cid: number;
  options: Object;
  config: Config;
  util: Object;

  extend: (options: Object) => Function;
  set: <T>(target: Object | Array<T>, key: string | number, value: T) => T;
  delete: <T>(target: Object| Array<T>, key: string | number) => void;
  nextTick: (fn: Function, context?: Object) => void;
  use: (plugin: Function | Object) => void;
  mixin: (mixin: Object) => void;
  compile: (template: string) => { render: Function, staticRenderFns: Array<Function> };

  directive: (id: string, def?: Function | Object) => Function | Object | void;
  component: (id: string, def?: Class<Component> | Object) => Class<Component>;
  filter: (id: string, def?: Function) => Function | void;

  // allow dynamic method registration
  [key: string]: any
}


================================================
FILE: flow/modules.js
================================================
declare module 'he' {
  declare function escape(html: string): string;
  declare function decode(html: string): string;
}

declare module 'source-map' {
  declare class SourceMapGenerator {
    setSourceContent(filename: string, content: string): void;
    addMapping(mapping: Object): void;
    toString(): string;
  }
  declare class SourceMapConsumer {
    originalPositionFor(position: { line: number; column: number; }): {
      source: ?string;
      line: ?number;
      column: ?number;
    };
  }
}

declare module 'lru-cache' {
  declare var exports: {
    (): any
  }
}

declare module 'de-indent' {
  declare var exports: {
    (input: string): string
  }
}

declare module 'serialize-javascript' {
  declare var exports: {
    (input: string, options: { isJSON: boolean }): string
  }
}

declare module 'lodash.template' {
  declare var exports: {
    (input: string, options: { interpolate: RegExp, escape: RegExp }): Function
  }
}

declare module 'change-case' {
  declare var exports: {
    (): any
  }
}


================================================
FILE: flow/options.js
================================================
declare type InternalComponentOptions = {
  _isComponent: true;
  parent: Component;
  propsData: ?Object;
  _parentVnode: VNode;
  _parentListeners: ?Object;
  _renderChildren: ?Array<VNode>;
  _componentTag: ?string;
  _parentElm: ?Node;
  _refElm: ?Node;
  render?: Function;
  staticRenderFns?: Array<Function>
}

declare type ComponentOptions = {
  // data
  data: Object | Function | void;
  props?: { [key: string]: PropOptions };
  propsData?: ?Object;
  computed?: {
    [key: string]: Function | {
      get?: Function;
      set?: Function;
      cache?: boolean
    }
  };
  methods?: { [key: string]: Function };
  watch?: { [key: string]: Function | string };

  // DOM
  el?: string | Element;
  template?: string;
  render: (h: () => VNode) => VNode;
  renderError?: (h: () => VNode, err: Error) => VNode;
  staticRenderFns?: Array<() => VNode>;

  // lifecycle
  beforeCreate?: Function;
  created?: Function;
  beforeMount?: Function;
  mounted?: Function;
  beforeUpdate?: Function;
  updated?: Function;
  activated?: Function;
  deactivated?: Function;
  beforeDestroy?: Function;
  destroyed?: Function;

  // assets
  directives?: { [key: string]: Object };
  components?: { [key: string]: Class<Component> };
  transitions?: { [key: string]: Object };
  filters?: { [key: string]: Function };

  // context
  provide?: { [key: string | Symbol]: any } | () => { [key: string | Symbol]: any };
  inject?: { [key: string]: string | Symbol } | Array<string>;

  // component v-model customization
  model?: {
    prop?: string;
    event?: string;
  };

  // misc
  parent?: Component;
  mixins?: Array<Object>;
  name?: string;
  extends?: Class<Component> | Object;
  delimiters?: [string, string];

  // private
  _isComponent?: true;
  _propKeys?: Array<string>;
  _parentVnode?: VNode;
  _parentListeners?: ?Object;
  _renderChildren?: ?Array<VNode>;
  _componentTag: ?string;
  _scopeId: ?string;
  _base: Class<Component>;
  _parentElm: ?Node;
  _refElm: ?Node;
}

declare type PropOptions = {
  type: Function | Array<Function> | null;
  default: any;
  required: ?boolean;
  validator: ?Function;
}


================================================
FILE: flow/ssr.js
================================================
declare type ComponentWithCacheContext = {
  type: 'ComponentWithCache';
  bufferIndex: number;
  buffer: Array<string>;
  key: string;
}

declare type ElementContext = {
  type: 'Element';
  children: Array<VNode>;
  rendered: number;
  endTag: string;
  total: number;
}

declare type ComponentContext = {
  type: 'Component';
  prevActive: Component;
}

declare type RenderState = ComponentContext | ComponentWithCacheContext | ElementContext


================================================
FILE: flow/vnode.js
================================================
declare type VNodeChildren = Array<?VNode | string | VNodeChildren> | string

declare type VNodeComponentOptions = {
  Ctor: Class<Component>;
  propsData: ?Object;
  listeners: ?Object;
  children: ?Array<VNode>;
  tag?: string;
}

declare type MountedComponentVNode = {
  context: Component;
  componentOptions: VNodeComponentOptions;
  componentInstance: Component;
  parent: VNode;
  data: VNodeData;
}

// interface for vnodes in update modules
declare type VNodeWithData = {
  tag: string;
  data: VNodeData;
  children: ?Array<VNode>;
  text: void;
  elm: any;
  ns: string | void;
  context: Component;
  key: string | number | void;
  parent?: VNodeWithData;
  componentInstance?: Component;
  isRootInsert: boolean;
}

declare interface VNodeData {
  key?: string | number;
  slot?: string;
  ref?: string;
  pre?: boolean;
  tag?: string;
  staticClass?: string;
  class?: any;
  staticStyle?: { [key: string]: any };
  style?: Array<Object> | Object;
  normalizedStyle?: Object;
  props?: { [key: string]: any };
  attrs?: { [key: string]: string };
  domProps?: { [key: string]: any };
  hook?: { [key: string]: Function };
  on?: ?{ [key: string]: Function | Array<Function> };
  nativeOn?: { [key: string]: Function | Array<Function> };
  transition?: Object;
  show?: boolean; // marker for v-show
  inlineTemplate?: {
    render: Function;
    staticRenderFns: Array<Function>;
  };
  directives?: Array<VNodeDirective>;
  keepAlive?: boolean;
  scopedSlots?: { [key: string]: Function };
  model?: {
    value: any;
    callback: Function;
  };
}

declare type VNodeDirective = {
  name: string;
  rawName: string;
  value?: any;
  oldValue?: any;
  arg?: string;
  modifiers?: ASTModifiers;
  def?: Object;
}


================================================
FILE: jest.config.json
================================================
{
  "verbose": true,
  "testMatch": [
    "<rootDir>/**/__tests__/**/*.(test|spec).js"
  ],
  "moduleDirectories": [
    "node_modules"
  ],
  "moduleNameMapper": {
    "^vue-native(.*)$": "<rootDir>/src/platforms/vue-native$1",
    "^vue(.*)$": "<rootDir>/src/platforms/web/runtime-with-compiler$1",
    "^compiler(.*)$": "<rootDir>/src/compiler$1",
    "^core(.*)$": "<rootDir>/src/core$1",
    "^shared(.*)$": "<rootDir>/src/shared$1",
    "^web(.*)$": "<rootDir>/src/platforms/web$1",
    "^sfc(.*)$": "<rootDir>/src/sfc$1"
  },
  "collectCoverage": true,
  "collectCoverageFrom": [
    "<rootDir>/src/platforms/vue-native/**/*.js",
    "!**/node_modules/**"
  ],
  "coverageDirectory": "<rootDir>/coverage",
  "testURL": "http://localhost"
}

================================================
FILE: jsconfig.json
================================================
{
  "compilerOptions": {
    "moduleResolution": "node",
    "baseUrl": "src",
    "paths": {
      "vue/*": ["platforms/web/runtime-with-compiler/*"],
      "compiler/*": ["compiler/*"],
      "core/*": ["core/*"],
      "shared/*": ["shared/*"],
      "web/*": ["platforms/web/*"],
      "vue-native/*": ["platforms/vue-native/*"],
      "sfc/*": ["sfc/*"]
    }
  },
  "exclude": ["node_modules", "packages"]
}


================================================
FILE: package.json
================================================
{
  "name": "vue-native-core",
  "version": "0.3.1",
  "description": "Create mobile apps using vuejs",
  "main": "packages/vue-native-core/index.js",
  "typings": "types/index.d.ts",
  "repository": {
    "type": "git",
    "url": "https://github.com/GeekyAnts/vue-native-core.git"
  },
  "keywords": [
    "vue",
    "native",
    "mobile"
  ],
  "engines": {
    "node": "^4.5 || >=5.10"
  },
  "engineStrict": true,
  "author": "Geekyants (https://geekyants.io/)",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/GeekyAnts/vue-native-core/issues"
  },
  "files": [
    "src",
    "packages",
    "types/*.d.ts"
  ],
  "scripts": {
    "lint": "eslint src scripts",
    "lint:fix": "eslint --fix src scripts",
    "flow": "flow check",
    "test:unit": "jest --config ./jest.config.json",
    "test": "npm run lint && npm run flow && npm run test:unit",
    "build": "node scripts/build.js",
    "release": "bash scripts/release.sh"
  },
  "husky": {
    "hooks": {
      "pre-commit": "npm run lint:fix"
    }
  },
  "homepage": "https://github.com/GeekyAnts/vue-native-core",
  "devDependencies": {
    "@babel/core": "^7.5.5",
    "@babel/preset-env": "^7.5.5",
    "@babel/preset-flow": "^7.0.0",
    "babel-core": "^6.9.0",
    "babel-eslint": "^10.0.3",
    "babel-helper-vue-jsx-merge-props": "^2.0.2",
    "babel-jest": "^26.0.1",
    "babel-plugin-syntax-dynamic-import": "^6.18.0",
    "babel-plugin-syntax-jsx": "^6.18.0",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-plugin-transform-vue-jsx": "^3.2.0",
    "babel-preset-flow-vue": "^1.0.0",
    "babel-preset-react": "^6.24.1",
    "buble": "^0.19.8",
    "change-case": "^3.0.1",
    "cross-spawn": "^5.0.1",
    "de-indent": "^1.0.2",
    "eslint": "^6.5.1",
    "eslint-config-prettier": "^6.5.0",
    "eslint-plugin-flowtype": "^4.3.0",
    "eslint-plugin-prettier": "^3.1.1",
    "flow-bin": "^0.39.0",
    "hash-sum": "^1.0.2",
    "he": "^1.1.0",
    "husky": "^3.0.8",
    "jasmine": "^2.5.2",
    "jasmine-core": "^2.5.2",
    "jest": "^26.0.1",
    "js-beautify": "^1.6.14",
    "lodash": "^4.17.20",
    "lodash.template": "^4.4.0",
    "lru-cache": "^4.0.2",
    "prettier": "^1.18.2",
    "react": "16.8.6",
    "resolve": "^1.2.0",
    "rollup": "^1.17.0",
    "rollup-plugin-alias": "^1.5.2",
    "rollup-plugin-buble": "^0.19.8",
    "rollup-plugin-flow-no-whitespace": "^1.0.0",
    "rollup-plugin-prettier": "^0.6.0",
    "rollup-plugin-replace": "^2.2.0",
    "serialize-javascript": "^3.1.0",
    "typescript": "^2.1.6",
    "uglify-js": "^3.6.0"
  }
}


================================================
FILE: packages/vue-native-core/README.md
================================================
# vue-native-core

> This package is auto-generated. For pull requests please work with [src/platforms/vue-native/index.js](https://github.com/GeekyAnts/vue-native-core/tree/develop/src/platforms/vue-native).

Find the `vue-native-core` repository [here](https://github.com/GeekyAnts/vue-native-core).

For the official documentation, visit [this](https://vue-native.io/docs/installation.html) website.


================================================
FILE: packages/vue-native-core/index.js
================================================
module.exports = require('./build')

================================================
FILE: packages/vue-native-core/package.json
================================================
{
  "name": "vue-native-core",
  "version": "0.3.1",
  "description": "Library with core functionalities to create Vue Native components",
  "main": "index.js",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/GeekyAnts/vue-native-core"
  },
  "keywords": [
    "react",
    "vue"
  ],
  "author": "Geekyants (https://geekyants.io/)",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/GeekyAnts/vue-native-core/issues"
  },
  "homepage": "https://github.com/GeekyAnts/vue-native-core/tree/master/packages/vue-native-core",
  "peerDependencies": {
    "react": "^16.3.0"
  }
}


================================================
FILE: packages/vue-native-helper/README.md
================================================
# vue-native-helper

> This package is auto-generated. For pull requests please work with [src/platforms/vue-native/runtime/helpers.js](https://github.com/GeekyAnts/vue-native-core/tree/develop/src/platforms/vue-native/runtime).

Find the `vue-native-core` repository [here](https://github.com/GeekyAnts/vue-native-core).

For the official documentation, visit [this](https://vue-native.io/docs/installation.html) website.


================================================
FILE: packages/vue-native-helper/index.js
================================================
module.exports = require('./build')

================================================
FILE: packages/vue-native-helper/package.json
================================================
{
  "name": "vue-native-helper",
  "version": "0.3.1",
  "description": "Helper library with utilities for vue-native-core",
  "main": "index.js",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/GeekyAnts/vue-native-core"
  },
  "keywords": [
    "react",
    "vue",
    "helper"
  ],
  "author": "Geekyants (https://geekyants.io/)",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/GeekyAnts/vue-native-core/issues"
  },
  "homepage": "https://github.com/GeekyAnts/vue-native-core#readme",
  "peerDependencies": {
    "react": "^16.3.0"
  }
}


================================================
FILE: packages/vue-native-scripts/.npmignore
================================================
node_modules
npm-debug.log
test/output
docs/_book
.DS_Store
.idea
*.iml


================================================
FILE: packages/vue-native-scripts/README.md
================================================
# vue-native-scripts

> This package is auto-generated. For pull requests please work with [src/platforms/vue-native/scripts/index.js](https://github.com/GeekyAnts/vue-native-core/tree/develop/src/platforms/vue-native/scripts).

Compile and transform Vue components to React Native.

Find the `vue-native-core` repository [here](https://github.com/GeekyAnts/vue-native-core).

For the official documentation, visit [this](https://vue-native.io/docs/installation.html) website.

## Usage

[Vue Native CLI](https://github.com/GeekyAnts/vue-native-cli) is the recommended way to setup a new Vue Native project. However, if you wish to setup a project from scratch, use the following steps after setting up a React Native / Expo project.

### Step 1: Install

The following packages are required as runtime dependencies by Vue Native:
- [vue-native-core](https://www.npmjs.com/package/vue-native-core)
- [vue-native-helper](https://www.npmjs.com/package/vue-native-helper)

During development, another package is required to transpile Vue Native component files (with `.vue` extensions) into JS:
- [vue-native-scripts](https://www.npmjs.com/package/vue-native-scripts)

To install them, run the following commands in your project directory
```
$ npm install --save vue-native-core vue-native-helper
$ npm install --save-dev vue-native-scripts
```

### Step 2: Configure the React Native bundler

The Metro bundler is used by React Native to generate app bundles. It can be configured using a `metro.config.js` file. Add the following to your `metro.config.js` (make one to your project's root if you don't have one already):

```js
const { getDefaultConfig } = require("metro-config");

module.exports = (async () => {
  const {
    resolver: { sourceExts }
  } = await getDefaultConfig();
  return {
    transformer: {
      babelTransformerPath: require.resolve("./vueTransformerPlugin.js"),
      getTransformOptions: async () => ({
        transform: {
          experimentalImportSupport: false,
          inlineRequires: false,
        },
      })
    },
    resolver: {
      sourceExts: [...sourceExts, "vue"]
    }
  };
})();
```

The `babelTransformPath` property above takes the path to the transformer you wish to use. In our case, we need to create a `vueTransformerPlugin.js` file to the project's root and specify supported extensions:

```js
// For React Native version 0.59 or later
var upstreamTransformer = require("metro-react-native-babel-transformer");

// You will need to use different transformers for different React Native versions
// However, versions older than v0.59 are no longer supported by Vue Native

// For React Native version 0.56 - 0.58
// var upstreamTransformer = require("metro/src/reactNativeTransformer");

// For React Native version 0.52 - 0.55
// var upstreamTransformer = require("metro/src/transformer");

// For React Native version 0.47 - 0.51
// var upstreamTransformer = require("metro-bundler/src/transformer");

// For React Native version 0.46
// var upstreamTransformer = require("metro-bundler/build/transformer");

var vueNaiveScripts = require("vue-native-scripts");
var vueExtensions = ["vue"]; // <-- Add other extensions if needed.

module.exports.transform = function({ src, filename, options }) {
  if (vueExtensions.some(ext => filename.endsWith("." + ext))) {
    return vueNaiveScripts.transform({ src, filename, options });
  }
  return upstreamTransformer.transform({ src, filename, options });
};
```

This file conditionally transforms files based on their extensions. `vue-native-scripts` is used for `.vue` files, while the stock React Native Babel transformer is used for other (JS) files.

## Using Vue Native components and `.vue` files

In the React Native application, you can simply `import` your Vue components as follows

```
import VueComponent from './VueComponent.vue'
```

There should be a file named `VueComponent.vue` in the corresponding folder; the transformer parses this file and sends it to the React Native bundler.


================================================
FILE: packages/vue-native-scripts/bin/vue-native-script.js
================================================
#!/usr/bin/env node

const spawn = require('cross-spawn');
const script = process.argv[2];
const args = process.argv.slice(3);
const validCommands = ['compiler'];

if(validCommands.indexOf(script) !== -1) {
  const result = spawn.sync(
    'node',
    ['--no-deprecation', require.resolve('../scripts/' + script + '.js')].concat(args),
    { stdio: 'inherit' }
  );
  process.exit(result.status);
} else {
  console.log(
    `Invalid command '${script}'. Please check if you need to update react-native-scripts.`
  );
}


================================================
FILE: packages/vue-native-scripts/index.js
================================================
module.exports = require('./build.js')

================================================
FILE: packages/vue-native-scripts/package.json
================================================
{
  "name": "vue-native-scripts",
  "version": "0.3.1",
  "description": "Compile Vue Native components to React Native",
  "main": "index.js",
  "scripts": {},
  "bin": {
    "vue-native-scripts": "./bin/vue-native-script.js"
  },
  "author": "Geekyants (https://geekyants.io/)",
  "license": "MIT",
  "dependencies": {
    "babel-core": "^6.25.0",
    "babel-traverse": "^6.26.0",
    "cross-spawn": "^5.1.0",
    "css-parse": "^2.0.0",
    "hash-sum": "^1.0.2",
    "js-beautify": "^1.6.14",
    "line-number": "^0.1.0",
    "parse5": "^5.0.0",
    "path": "^0.12.7",
    "semver": "^6.2.0",
    "source-map": "~0.6.0",
    "vue-native-template-compiler": "^0.3.0"
  },
  "peerDependencies": {
    "react-native": "^0.59.0",
    "metro": "^0.51.0",
    "metro-bundler": "*",
    "metro-react-native-babel-transformer": "^0.51.0"
  },
  "bugs": {
    "url": "https://github.com/GeekyAnts/vue-native-core/issues"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/GeekyAnts/vue-native-core/tree/master/packages/vue-native-scripts"
  }
}


================================================
FILE: packages/vue-native-template-compiler/README.md
================================================
# vue-native-template-compiler

> This package is auto-generated. For pull requests please work with [src/platforms/vue-native/compiler/index.js](https://github.com/GeekyAnts/vue-native-core/tree/develop/src/platforms/vue-native).

Find the `vue-native-core` repository [here](https://github.com/GeekyAnts/vue-native-core).

For the official documentation, visit [this](https://vue-native.io/docs/installation.html) website.


================================================
FILE: packages/vue-native-template-compiler/index.js
================================================
module.exports = require('./build')

================================================
FILE: packages/vue-native-template-compiler/package.json
================================================
{
  "name": "vue-native-template-compiler",
  "version": "0.3.1",
  "description": "Vue Native template compiler, dependency of vue-native-scripts. It can also be used as a stand-alone compiler",
  "main": "index.js",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/GeekyAnts/vue-native-core"
  },
  "keywords": [
    "react",
    "vue",
    "template",
    "compiler"
  ],
  "author": "Geekyants (https://geekyants.io/)",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/GeekyAnts/vue-native-core/issues"
  },
  "homepage": "https://github.com/GeekyAnts/vue-native-core/tree/master/packages/vue-native-template-compiler",
  "dependencies": {
    "he": "^1.1.0",
    "de-indent": "^1.0.2",
    "change-case": "^3.0.1"
  }
}


================================================
FILE: scripts/.eslintrc
================================================

{
  "env": {
    "es6": true,
  },
  "rules": {
    "camelcase": 0,
  },
}


================================================
FILE: scripts/alias.js
================================================
const path = require('path')

module.exports = {
  vue: path.resolve(__dirname, '../src/platforms/web/runtime-with-compiler'),
  compiler: path.resolve(__dirname, '../src/compiler'),
  core: path.resolve(__dirname, '../src/core'),
  shared: path.resolve(__dirname, '../src/shared'),
  web: path.resolve(__dirname, '../src/platforms/web'),
  'vue-native': path.resolve(__dirname, '../src/platforms/vue-native'),
  sfc: path.resolve(__dirname, '../src/sfc'),
}


================================================
FILE: scripts/build.js
================================================
const fs = require('fs')
const path = require('path')
const zlib = require('zlib')
const rollup = require('rollup')
const uglify = require('uglify-js')

if (!fs.existsSync('dist')) {
  fs.mkdirSync('dist')
}

let builds = require('./config').getAllBuilds()

// filter builds via command line arg
if (process.argv[2]) {
  const filters = process.argv[2].split(',')
  builds = builds.filter(b => {
    return filters.some(f => b.dest.indexOf(f) > -1)
  })
}

build(builds)

function build(builds) {
  let built = 0
  const total = builds.length
  const next = () => {
    buildEntry(builds[built])
      .then(() => {
        built++
        if (built < total) {
          next()
        }
      })
      .catch(logError)
  }

  next()
}

function buildEntry(config) {
  const isProd = /min\.js$/.test(config.dest)
  const output = config.output
  const { file, banner } = output
  return rollup
    .rollup(config)
    .then(bundle => bundle.generate(output))
    .then(({ output: [{ code }] }) => {
      if (isProd) {
        const minified =
          (banner ? banner + '\n' : '') +
          uglify.minify(code, {
            fromString: true,
            output: {
              screw_ie8: true,
              ascii_only: true,
            },
            compress: {
              pure_funcs: ['makeMap'],
            },
          }).code
        return write(file, minified, true)
      } else {
        return write(file, code)
      }
    })
}

function write(dest, code, zip) {
  return new Promise((resolve, reject) => {
    function report(extra) {
      console.log(
        blue(path.relative(process.cwd(), dest)) +
          ' ' +
          getSize(code) +
          (extra || ''),
      )
      resolve()
    }

    fs.writeFile(dest, code, err => {
      if (err) return reject(err)
      if (zip) {
        zlib.gzip(code, (err, zipped) => {
          if (err) return reject(err)
          report(' (gzipped: ' + getSize(zipped) + ')')
        })
      } else {
        report()
      }
    })
  })
}

function getSize(code) {
  return (code.length / 1024).toFixed(2) + 'kb'
}

function logError(e) {
  console.log(e)
}

function blue(str) {
  return '\x1b[1m\x1b[34m' + str + '\x1b[39m\x1b[22m'
}


================================================
FILE: scripts/ci.sh
================================================
set -e
npm test

# report coverage stats for non-PRs
if [[ -z $CI_PULL_REQUEST ]]; then
  cat ./coverage/lcov.info | ./node_modules/.bin/codecov
fi


================================================
FILE: scripts/config.js
================================================
const path = require('path')
const buble = require('rollup-plugin-buble')
const alias = require('rollup-plugin-alias')
const replace = require('rollup-plugin-replace')
const flow = require('rollup-plugin-flow-no-whitespace')
const prettier = require('rollup-plugin-prettier')

const version = '2.2.6'

// const banner =
//   "/*!\n" +
//   " * Vue Native v" +
//   version +
//   "\n" +
//   " * (c) 2018-" +
//   new Date().getFullYear() +
//   " GeekyAnts Software Pvt. Ltd.\n" +
//   " * Released under the MIT License.\n" +
//   " */"

const aliases = require('./alias')
const resolve = p => {
  const base = p.split('/')[0]
  if (aliases[base]) {
    return path.resolve(aliases[base], p.slice(base.length + 1))
  } else {
    return path.resolve(__dirname, '../', p)
  }
}

const builds = {
  'vue-native-core': {
    entry: resolve('vue-native/index.js'),
    dest: resolve('packages/vue-native-core/build.js'),
    format: 'cjs',
    external: ['react'],
  },
  'vue-native-helper': {
    entry: resolve('vue-native/runtime/helpers.js'),
    dest: resolve('packages/vue-native-helper/build.js'),
    format: 'cjs',
  },
  'vue-native-scripts': {
    entry: resolve('vue-native/scripts/index.js'),
    dest: resolve('packages/vue-native-scripts/build.js'),
    format: 'cjs',
    external: []
      .concat(
        Object.keys(
          require('../packages/vue-native-scripts/package.json').dependencies,
        ),
      )
      .concat(
        Object.keys(
          require('../packages/vue-native-scripts/package.json')
            .peerDependencies,
        ),
      ),
  },
  'vue-native-template-compiler': {
    entry: resolve('vue-native/compiler.js'),
    dest: resolve('packages/vue-native-template-compiler/build.js'),
    format: 'cjs',
    external: ['change-case', 'he', 'de-indent', 'lodash'],
  },
}

function genConfig(opts) {
  const config = {
    input: opts.entry,
    output: {
      file: opts.dest,
      format: opts.format,
      banner: opts.banner,
      name: 'Vue',
    },
    external: opts.external,
    plugins: [
      replace({
        __VERSION__: version,
      }),
      flow(),
      buble(),
      alias(Object.assign({}, aliases, opts.alias)),
      prettier(),
    ].concat(opts.plugins || []),
    onwarn: (msg, warn) => {
      if (!/Circular/.test(msg)) {
        warn(msg)
      }
    },
  }

  if (opts.env) {
    config.plugins.push(
      replace({
        'process.env.NODE_ENV': JSON.stringify(opts.env),
      }),
    )
  }

  return config
}

if (process.env.TARGET) {
  module.exports = genConfig(builds[process.env.TARGET])
} else {
  exports.getBuild = name => genConfig(builds[name])
  exports.getAllBuilds = () =>
    Object.keys(builds).map(name => genConfig(builds[name]))
}


================================================
FILE: scripts/git-hooks/pre-commit
================================================
#!/usr/bin/env bash

files_to_lint=$(git diff --cached --name-only --diff-filter=ACM | grep '\.js$')

if [ -n "$files_to_lint" ]; then
  NODE_ENV=production eslint --quiet $files_to_lint
fi


================================================
FILE: scripts/release.sh
================================================
set -e

CURRENT_BRANCH=$(git branch --show-current)
if [ $CURRENT_BRANCH != "master" ]; then
  echo "This script can only be run in the master branch. Exiting..."
  exit 1
fi

# get the version number from the user
read -e -p "Enter the new Vue Native version: " VERSION
if [[ -z $VERSION ]]; then
  echo "No version entered. Exiting..."
  exit 0
fi

# Decide the NPM tag.
# Tag should be set to 'next' for pre-release versions
# and will be 'latest' by default
read -p "Is this a pre-release version? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
  echo "Using npm tag 'next' for this release."
  TAG='next'
else
  echo "Using npm tag 'latest' for this release."
  TAG='latest'
fi

read -p "Releasing $VERSION with npm tag $TAG - are you sure? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
  echo "Releasing $VERSION (with npm tag $TAG)..."

  # bump package versions
  # packages:
  # - vue-native-core
  # - vue-native-helper
  # - vue-native-scripts
  # - vue-native-template-compiler

  cd packages/vue-native-core
  npm version $VERSION
  cd -

  cd packages/vue-native-helper
  npm version $VERSION
  cd -

  cd packages/vue-native-scripts
  npm version $VERSION
  cd -

  cd packages/vue-native-template-compiler
  npm version $VERSION
  cd -

  # build
  # the build needs to be generated after the version bump
  # because the Vue version comes from packages/vue-native-core/package.json
  # refer to scripts/config.js
  VERSION=$VERSION npm run build

  # commit
  git add -A
  git commit -m "[build] $VERSION"

  # publish packages
  # vue-native-core has already been published by np
  # packages:
  # - vue-native-core
  # - vue-native-helper
  # - vue-native-scripts
  # - vue-native-template-compiler

  cd packages/vue-native-core
  npm publish --tag $TAG
  cd -

  cd packages/vue-native-helper
  npm publish --tag $TAG
  cd -

  cd packages/vue-native-scripts
  npm publish --tag $TAG
  cd -

  cd packages/vue-native-template-compiler
  npm publish --tag $TAG
  cd -

  # Update version in main package.json and commit
  npm version $VERSION

  # Push the tags and version update
  git push origin v$VERSION
  git push origin master

  echo "\nPublished v$VERSION!"
fi


================================================
FILE: src/compiler/codegen/events.js
================================================
/* @flow */

const fnExpRE = /^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/
const simplePathRE = /^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/

// keyCode aliases
const keyCodes: { [key: string]: number | Array<number> } = {
  esc: 27,
  tab: 9,
  enter: 13,
  space: 32,
  up: 38,
  left: 37,
  right: 39,
  down: 40,
  delete: [8, 46],
}

// #4868: modifiers that prevent the execution of the listener
// need to explicitly return null so that we can determine whether to remove
// the listener for .once
const genGuard = condition => `if(${condition})return null;`

const modifierCode: { [key: string]: string } = {
  stop: '$event.stopPropagation();',
  prevent: '$event.preventDefault();',
  self: genGuard(`$event.target !== $event.currentTarget`),
  ctrl: genGuard(`!$event.ctrlKey`),
  shift: genGuard(`!$event.shiftKey`),
  alt: genGuard(`!$event.altKey`),
  meta: genGuard(`!$event.metaKey`),
  left: genGuard(`'button' in $event && $event.button !== 0`),
  middle: genGuard(`'button' in $event && $event.button !== 1`),
  right: genGuard(`'button' in $event && $event.button !== 2`),
}

export function genHandlers(
  events: ASTElementHandlers,
  native: boolean,
  warn: Function,
): string {
  let res = native ? 'nativeOn:{' : 'on:{'
  for (const name in events) {
    const handler = events[name]
    // #5330: warn click.right, since right clicks do not actually fire click events.
    if (
      process.env.NODE_ENV !== 'production' &&
      name === 'click' &&
      handler &&
      handler.modifiers &&
      handler.modifiers.right
    ) {
      warn(
        `Use "contextmenu" instead of "click.right" since right clicks ` +
          `do not actually fire "click" events.`,
      )
    }
    res += `"${name}":${genHandler(name, handler)},`
  }
  return res.slice(0, -1) + '}'
}

function genHandler(
  name: string,
  handler: ASTElementHandler | Array<ASTElementHandler>,
): string {
  if (!handler) {
    return 'function(){}'
  }

  if (Array.isArray(handler)) {
    return `[${handler.map(handler => genHandler(name, handler)).join(',')}]`
  }

  const isMethodPath = simplePathRE.test(handler.value)
  const isFunctionExpression = fnExpRE.test(handler.value)

  if (!handler.modifiers) {
    return isMethodPath || isFunctionExpression
      ? handler.value
      : `function($event){${handler.value}}` // inline statement
  } else {
    let code = ''
    let genModifierCode = ''
    const keys = []
    for (const key in handler.modifiers) {
      if (modifierCode[key]) {
        genModifierCode += modifierCode[key]
        // left/right
        if (keyCodes[key]) {
          keys.push(key)
        }
      } else {
        keys.push(key)
      }
    }
    if (keys.length) {
      code += genKeyFilter(keys)
    }
    // Make sure modifiers like prevent and stop get executed after key filtering
    if (genModifierCode) {
      code += genModifierCode
    }
    const handlerCode = isMethodPath
      ? handler.value + '($event)'
      : isFunctionExpression
      ? `(${handler.value})($event)`
      : handler.value
    return `function($event){${code}${handlerCode}}`
  }
}

function genKeyFilter(keys: Array<string>): string {
  return `if(!('button' in $event)&&${keys
    .map(genFilterCode)
    .join('&&')})return null;`
}

function genFilterCode(key: string): string {
  const keyVal = parseInt(key, 10)
  if (keyVal) {
    return `$event.keyCode!==${keyVal}`
  }
  const alias = keyCodes[key]
  return `_k($event.keyCode,${JSON.stringify(key)}${
    alias ? ',' + JSON.stringify(alias) : ''
  })`
}


================================================
FILE: src/compiler/codegen/index.js
================================================
/* @flow */

import { genHandlers } from './events'
import { baseWarn, pluckModuleFunction } from '../helpers'
import baseDirectives from '../directives/index'
import { camelize, no } from 'shared/util'

type TransformFunction = (el: ASTElement, code: string) => string
type DataGenFunction = (el: ASTElement) => string
type DirectiveFunction = (
  el: ASTElement,
  dir: ASTDirective,
  warn: Function,
) => boolean

// configurable state
let warn
let transforms: Array<TransformFunction>
let dataGenFns: Array<DataGenFunction>
let platformDirectives
let isPlatformReservedTag
let staticRenderFns
let onceCount
let currentOptions

export function generate(
  ast: ASTElement | void,
  options: CompilerOptions,
): {
  render: string,
  staticRenderFns: Array<string>,
} {
  // save previous staticRenderFns so generate calls can be nested
  const prevStaticRenderFns: Array<string> = staticRenderFns
  const currentStaticRenderFns: Array<string> = (staticRenderFns = [])
  const prevOnceCount = onceCount
  onceCount = 0
  currentOptions = options
  warn = options.warn || baseWarn
  transforms = pluckModuleFunction(options.modules, 'transformCode')
  dataGenFns = pluckModuleFunction(options.modules, 'genData')
  platformDirectives = options.directives || {}
  isPlatformReservedTag = options.isReservedTag || no
  const code = ast ? genElement(ast) : '_c("div")'
  staticRenderFns = prevStaticRenderFns
  onceCount = prevOnceCount
  return {
    render: `with(this){return ${code}}`,
    staticRenderFns: currentStaticRenderFns,
  }
}

function genElement(el: ASTElement): string {
  if (el.staticRoot && !el.staticProcessed) {
    return genStatic(el)
  } else if (el.once && !el.onceProcessed) {
    return genOnce(el)
  } else if (el.for && !el.forProcessed) {
    return genFor(el)
  } else if (el.if && !el.ifProcessed) {
    return genIf(el)
  } else if (el.tag === 'template' && !el.slotTarget) {
    return genChildren(el) || 'void 0'
  } else if (el.tag === 'slot') {
    return genSlot(el)
  } else {
    // component or element
    let code
    if (el.component) {
      code = genComponent(el.component, el)
    } else {
      const data = el.plain ? undefined : genData(el)

      const children = el.inlineTemplate ? null : genChildren(el, true)
      code = `_c('${el.tag}'${
        data ? `,${data}` : '' // data
      }${
        children ? `,${children}` : '' // children
      })`
    }
    // module transforms
    for (let i = 0; i < transforms.length; i++) {
      code = transforms[i](el, code)
    }
    return code
  }
}

// hoist static sub-trees out
function genStatic(el: ASTElement): string {
  el.staticProcessed = true
  staticRenderFns.push(`with(this){return ${genElement(el)}}`)
  return `_m(${staticRenderFns.length - 1}${el.staticInFor ? ',true' : ''})`
}

// v-once
function genOnce(el: ASTElement): string {
  el.onceProcessed = true
  if (el.if && !el.ifProcessed) {
    return genIf(el)
  } else if (el.staticInFor) {
    let key = ''
    let parent = el.parent
    while (parent) {
      if (parent.for) {
        key = parent.key
        break
      }
      parent = parent.parent
    }
    if (!key) {
      process.env.NODE_ENV !== 'production' &&
        warn(`v-once can only be used inside v-for that is keyed. `)
      return genElement(el)
    }
    return `_o(${genElement(el)},${onceCount++}${key ? `,${key}` : ``})`
  } else {
    return genStatic(el)
  }
}

function genIf(el: any): string {
  el.ifProcessed = true // avoid recursion
  return genIfConditions(el.ifConditions.slice())
}

function genIfConditions(conditions: ASTIfConditions): string {
  if (!conditions.length) {
    return '_e()'
  }

  const condition = conditions.shift()
  if (condition.exp) {
    return `(${condition.exp})?${genTernaryExp(
      condition.block,
    )}:${genIfConditions(conditions)}`
  } else {
    return `${genTernaryExp(condition.block)}`
  }

  // v-if with v-once should generate code like (a)?_m(0):_m(1)
  function genTernaryExp(el) {
    return el.once ? genOnce(el) : genElement(el)
  }
}

function genFor(el: any): string {
  const exp = el.for
  const alias = el.alias
  const iterator1 = el.iterator1 ? `,${el.iterator1}` : ''
  const iterator2 = el.iterator2 ? `,${el.iterator2}` : ''

  if (
    process.env.NODE_ENV !== 'production' &&
    maybeComponent(el) &&
    el.tag !== 'slot' &&
    el.tag !== 'template' &&
    !el.key
  ) {
    warn(
      `<${el.tag} v-for="${alias} in ${exp}">: component lists rendered with ` +
        `v-for should have explicit keys. ` +
        `See https://vuejs.org/guide/list.html#key for more info.`,
      true /* tip */,
    )
  }

  el.forProcessed = true // avoid recursion
  return (
    `_l((${exp}),` +
    `function(${alias}${iterator1}${iterator2}){` +
    `return ${genElement(el)}` +
    '})'
  )
}

function genData(el: ASTElement): string {
  let data = '{'

  // directives first.
  // directives may mutate the el's other properties before they are generated.
  const dirs = genDirectives(el)
  if (dirs) data += dirs + ','

  // key
  if (el.key) {
    data += `key:${el.key},`
  }
  // ref
  if (el.ref) {
    data += `ref:${el.ref},`
  }
  if (el.refInFor) {
    data += `refInFor:true,`
  }
  // pre
  if (el.pre) {
    data += `pre:true,`
  }
  // record original tag name for components using "is" attribute
  if (el.component) {
    data += `tag:"${el.tag}",`
  }
  // module data generation functions
  for (let i = 0; i < dataGenFns.length; i++) {
    data += dataGenFns[i](el)
  }
  // attributes
  if (el.attrs) {
    data += `attrs:{${genProps(el.attrs)}},`
  }
  // DOM props
  if (el.props) {
    data += `domProps:{${genProps(el.props)}},`
  }
  // event handlers
  if (el.events) {
    data += `${genHandlers(el.events, false, warn)},`
  }
  if (el.nativeEvents) {
    data += `${genHandlers(el.nativeEvents, true, warn)},`
  }
  // slot target
  if (el.slotTarget) {
    data += `slot:${el.slotTarget},`
  }
  // scoped slots
  if (el.scopedSlots) {
    data += `${genScopedSlots(el.scopedSlots)},`
  }
  // component v-model
  if (el.model) {
    data += `model:{value:${el.model.value},callback:${el.model.callback},expression:${el.model.expression}},`
  }
  // inline-template
  if (el.inlineTemplate) {
    const inlineTemplate = genInlineTemplate(el)
    if (inlineTemplate) {
      data += `${inlineTemplate},`
    }
  }
  data = data.replace(/,$/, '') + '}'
  // v-bind data wrap
  if (el.wrapData) {
    data = el.wrapData(data)
  }
  return data
}

function genDirectives(el: ASTElement): string | void {
  const dirs = el.directives
  if (!dirs) return
  let res = 'directives:['
  let hasRuntime = false
  let i, l, dir, needRuntime
  for (i = 0, l = dirs.length; i < l; i++) {
    dir = dirs[i]
    needRuntime = true
    const gen: DirectiveFunction =
      platformDirectives[dir.name] || baseDirectives[dir.name]
    if (gen) {
      // compile-time directive that manipulates AST.
      // returns true if it also needs a runtime counterpart.
      needRuntime = !!gen(el, dir, warn)
    }
    if (needRuntime) {
      hasRuntime = true
      res += `{name:"${dir.name}",rawName:"${dir.rawName}"${
        dir.value
          ? `,value:(${dir.value}),expression:${JSON.stringify(dir.value)}`
          : ''
      }${dir.arg ? `,arg:"${dir.arg}"` : ''}${
        dir.modifiers ? `,modifiers:${JSON.stringify(dir.modifiers)}` : ''
      }},`
    }
  }
  if (hasRuntime) {
    return res.slice(0, -1) + ']'
  }
}

function genInlineTemplate(el: ASTElement): ?string {
  const ast = el.children[0]
  if (
    process.env.NODE_ENV !== 'production' &&
    (el.children.length > 1 || ast.type !== 1)
  ) {
    warn('Inline-template components must have exactly one child element.')
  }
  if (ast.type === 1) {
    const inlineRenderFns = generate(ast, currentOptions)
    return `inlineTemplate:{render:function(){${
      inlineRenderFns.render
    }},staticRenderFns:[${inlineRenderFns.staticRenderFns
      .map(code => `function(){${code}}`)
      .join(',')}]}`
  }
}

function genScopedSlots(slots: { [key: string]: ASTElement }): string {
  return `scopedSlots:_u([${Object.keys(slots)
    .map(key => genScopedSlot(key, slots[key]))
    .join(',')}])`
}

function genScopedSlot(key: string, el: ASTElement) {
  return (
    `[${key},function(${String(el.attrsMap.scope)}){` +
    `return ${
      el.tag === 'template' ? genChildren(el) || 'void 0' : genElement(el)
    }}]`
  )
}

function genChildren(el: ASTElement, checkSkip?: boolean): string | void {
  const children = el.children
  if (children.length) {
    const el: any = children[0]
    // optimize single v-for
    if (
      children.length === 1 &&
      el.for &&
      el.tag !== 'template' &&
      el.tag !== 'slot'
    ) {
      return genElement(el)
    }
    const normalizationType = checkSkip ? getNormalizationType(children) : 0
    return `[${children.map(genNode).join(',')}]${
      normalizationType ? `,${normalizationType}` : ''
    }`
  }
}

// determine the normalization needed for the children array.
// 0: no normalization needed
// 1: simple normalization needed (possible 1-level deep nested array)
// 2: full normalization needed
function getNormalizationType(children: Array<ASTNode>): number {
  let res = 0
  for (let i = 0; i < children.length; i++) {
    const el: ASTNode = children[i]
    if (el.type !== 1) {
      continue
    }
    if (
      needsNormalization(el) ||
      (el.ifConditions &&
        el.ifConditions.some(c => needsNormalization(c.block)))
    ) {
      res = 2
      break
    }
    if (
      maybeComponent(el) ||
      (el.ifConditions && el.ifConditions.some(c => maybeComponent(c.block)))
    ) {
      res = 1
    }
  }
  return res
}

function needsNormalization(el: ASTElement): boolean {
  return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
}

function maybeComponent(el: ASTElement): boolean {
  return !isPlatformReservedTag(el.tag)
}

function genNode(node: ASTNode): string {
  if (node.type === 1) {
    return genElement(node)
  } else {
    return genText(node)
  }
}

function genText(text: ASTText | ASTExpression): string {
  return `_v(${
    text.type === 2
      ? text.expression // no need for () because already wrapped in _s()
      : transformSpecialNewlines(JSON.stringify(text.text))
  })`
}

function genSlot(el: ASTElement): string {
  const slotName = el.slotName || '"default"'
  const children = genChildren(el)
  let res = `_t(${slotName}${children ? `,${children}` : ''}`
  const attrs =
    el.attrs &&
    `{${el.attrs.map(a => `${camelize(a.name)}:${a.value}`).join(',')}}`
  const bind = el.attrsMap['v-bind']
  if ((attrs || bind) && !children) {
    res += `,null`
  }
  if (attrs) {
    res += `,${attrs}`
  }
  if (bind) {
    res += `${attrs ? '' : ',null'},${bind}`
  }
  return res + ')'
}

// componentName is el.component, take it as argument to shun flow's pessimistic refinement
function genComponent(componentName: string, el: ASTElement): string {
  const children = el.inlineTemplate ? null : genChildren(el, true)
  return `_c(${componentName},${genData(el)}${children ? `,${children}` : ''})`
}

function genProps(props: Array<{ name: string, value: string }>): string {
  let res = ''
  for (let i = 0; i < props.length; i++) {
    const prop = props[i]
    res += `"${prop.name}":${transformSpecialNewlines(prop.value)},`
  }
  return res.slice(0, -1)
}

// #3895, #4268
function transformSpecialNewlines(text: string): string {
  return text.replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029')
}


================================================
FILE: src/compiler/directives/bind.js
================================================
/* @flow */

export default function bind(el: ASTElement, dir: ASTDirective) {
  el.wrapData = (code: string) => {
    return `_b(${code},'${el.tag}',${dir.value}${
      dir.modifiers && dir.modifiers.prop ? ',true' : ''
    })`
  }
}


================================================
FILE: src/compiler/directives/index.js
================================================
/* @flow */

import bind from './bind'
import { noop } from 'shared/util'

export default {
  bind,
  cloak: noop,
}


================================================
FILE: src/compiler/directives/model.js
================================================
/* @flow */

/**
 * Cross-platform code generation for component v-model
 */
export function genComponentModel(
  el: ASTElement,
  value: string,
  modifiers: ?ASTModifiers,
): ?boolean {
  const { number, trim } = modifiers || {}

  const baseValueExpression = '$$v'
  let valueExpression = baseValueExpression
  if (trim) {
    valueExpression =
      `(typeof ${baseValueExpression} === 'string'` +
      `? ${baseValueExpression}.trim()` +
      `: ${baseValueExpression})`
  }
  if (number) {
    valueExpression = `_n(${valueExpression})`
  }
  const assignment = genAssignmentCode(value, valueExpression)

  el.model = {
    value: `(${value})`,
    expression: `"${value}"`,
    callback: `function (${baseValueExpression}) {${assignment}}`,
  }
}

/**
 * Cross-platform codegen helper for generating v-model value assignment code.
 */
export function genAssignmentCode(value: string, assignment: string): string {
  const modelRs = parseModel(value)
  if (modelRs.idx === null) {
    return `${value}=${assignment}`
  } else {
    return (
      `var $$exp = ${modelRs.exp}, $$idx = ${modelRs.idx};` +
      `if (!Array.isArray($$exp)){` +
      `${value}=${assignment}}` +
      `else{$$exp.splice($$idx, 1, ${assignment})}`
    )
  }
}

/**
 * parse directive model to do the array update transform. a[idx] = val => $$a.splice($$idx, 1, val)
 *
 * for loop possible cases:
 *
 * - test
 * - test[idx]
 * - test[test1[idx]]
 * - test["a"][idx]
 * - xxx.test[a[a].test1[idx]]
 * - test.xxx.a["asa"][test1[idx]]
 *
 */

let len, str, chr, index, expressionPos, expressionEndPos

export function parseModel(val: string): Object {
  str = val
  len = str.length
  index = expressionPos = expressionEndPos = 0

  if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
    return {
      exp: val,
      idx: null,
    }
  }

  while (!eof()) {
    chr = next()
    /* istanbul ignore if */
    if (isStringStart(chr)) {
      parseString(chr)
    } else if (chr === 0x5b) {
      parseBracket(chr)
    }
  }

  return {
    exp: val.substring(0, expressionPos),
    idx: val.substring(expressionPos + 1, expressionEndPos),
  }
}

function next(): number {
  return str.charCodeAt(++index)
}

function eof(): boolean {
  return index >= len
}

function isStringStart(chr: number): boolean {
  return chr === 0x22 || chr === 0x27
}

function parseBracket(chr: number): void {
  let inBracket = 1
  expressionPos = index
  while (!eof()) {
    chr = next()
    if (isStringStart(chr)) {
      parseString(chr)
      continue
    }
    if (chr === 0x5b) inBracket++
    if (chr === 0x5d) inBracket--
    if (inBracket === 0) {
      expressionEndPos = index
      break
    }
  }
}

function parseString(chr: number): void {
  const stringQuote = chr
  while (!eof()) {
    chr = next()
    if (chr === stringQuote) {
      break
    }
  }
}


================================================
FILE: src/compiler/error-detector.js
================================================
/* @flow */

import { dirRE, onRE } from './parser/index'

// these keywords should not appear inside expressions, but operators like
// typeof, instanceof and in are allowed
const prohibitedKeywordRE = new RegExp(
  '\\b' +
    (
      'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
      'super,throw,while,yield,delete,export,import,return,switch,default,' +
      'extends,finally,continue,debugger,function,arguments'
    )
      .split(',')
      .join('\\b|\\b') +
    '\\b',
)

// these unary operators should not be used as property/method names
const unaryOperatorsRE = new RegExp(
  '\\b' +
    'delete,typeof,void'.split(',').join('\\s*\\([^\\)]*\\)|\\b') +
    '\\s*\\([^\\)]*\\)',
)

// check valid identifier for v-for
const identRE = /[A-Za-z_$][\w$]*/

// strip strings in expressions
const stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g

// detect problematic expressions in a template
export function detectErrors(ast: ?ASTNode): Array<string> {
  const errors: Array<string> = []
  if (ast) {
    checkNode(ast, errors)
  }
  return errors
}

function checkNode(node: ASTNode, errors: Array<string>) {
  if (node.type === 1) {
    for (const name in node.attrsMap) {
      if (dirRE.test(name)) {
        const value = node.attrsMap[name]
        if (value) {
          if (name === 'v-for') {
            checkFor(node, `v-for="${value}"`, errors)
          } else if (onRE.test(name)) {
            checkEvent(value, `${name}="${value}"`, errors)
          } else {
            checkExpression(value, `${name}="${value}"`, errors)
          }
        }
      }
    }
    if (node.children) {
      for (let i = 0; i < node.children.length; i++) {
        checkNode(node.children[i], errors)
      }
    }
  } else if (node.type === 2) {
    checkExpression(node.expression, node.text, errors)
  }
}

function checkEvent(exp: string, text: string, errors: Array<string>) {
  const stipped = exp.replace(stripStringRE, '')
  const keywordMatch: any = stipped.match(unaryOperatorsRE)
  if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
    errors.push(
      `avoid using JavaScript unary operator as property name: ` +
        `"${keywordMatch[0]}" in expression ${text.trim()}`,
    )
  }
  checkExpression(exp, text, errors)
}

function checkFor(node: ASTElement, text: string, errors: Array<string>) {
  checkExpression(node.for || '', text, errors)
  checkIdentifier(node.alias, 'v-for alias', text, errors)
  checkIdentifier(node.iterator1, 'v-for iterator', text, errors)
  checkIdentifier(node.iterator2, 'v-for iterator', text, errors)
}

function checkIdentifier(
  ident: ?string,
  type: string,
  text: string,
  errors: Array<string>,
) {
  if (typeof ident === 'string' && !identRE.test(ident)) {
    errors.push(`invalid ${type} "${ident}" in expression: ${text.trim()}`)
  }
}

function checkExpression(exp: string, text: string, errors: Array<string>) {
  try {
    new Function(`return ${exp}`)
  } catch (e) {
    const keywordMatch = exp
      .replace(stripStringRE, '')
      .match(prohibitedKeywordRE)
    if (keywordMatch) {
      errors.push(
        `avoid using JavaScript keyword as property name: ` +
          `"${keywordMatch[0]}" in expression ${text.trim()}`,
      )
    } else {
      errors.push(`invalid expression: ${text.trim()}`)
    }
  }
}


================================================
FILE: src/compiler/helpers.js
================================================
/* @flow */

import { parseFilters } from './parser/filter-parser'

export function baseWarn(msg: string) {
  console.error(`[Vue compiler]: ${msg}`)
}

export function pluckModuleFunction<F: Function>(
  modules: ?Array<Object>,
  key: string,
): Array<F> {
  return modules ? modules.map(m => m[key]).filter(_ => _) : []
}

export function addProp(el: ASTElement, name: string, value: string) {
  ;(el.props || (el.props = [])).push({ name, value })
}

export function addAttr(el: ASTElement, name: string, value: string) {
  ;(el.attrs || (el.attrs = [])).push({ name, value })
}

export function addDirective(
  el: ASTElement,
  name: string,
  rawName: string,
  value: string,
  arg: ?string,
  modifiers: ?ASTModifiers,
) {
  ;(el.directives || (el.directives = [])).push({
    name,
    rawName,
    value,
    arg,
    modifiers,
  })
}

export function addHandler(
  el: ASTElement,
  name: string,
  value: string,
  modifiers: ?ASTModifiers,
  important?: boolean,
  warn?: Function,
) {
  // warn prevent and passive modifier
  /* istanbul ignore if */
  if (
    process.env.NODE_ENV !== 'production' &&
    warn &&
    modifiers &&
    modifiers.prevent &&
    modifiers.passive
  ) {
    warn(
      "passive and prevent can't be used together. " +
        "Passive handler can't prevent default event.",
    )
  }
  // check capture modifier
  if (modifiers && modifiers.capture) {
    delete modifiers.capture
    name = '!' + name // mark the event as captured
  }
  if (modifiers && modifiers.once) {
    delete modifiers.once
    name = '~' + name // mark the event as once
  }
  /* istanbul ignore if */
  if (modifiers && modifiers.passive) {
    delete modifiers.passive
    name = '&' + name // mark the event as passive
  }
  let events
  if (modifiers && modifiers.native) {
    delete modifiers.native
    events = el.nativeEvents || (el.nativeEvents = {})
  } else {
    events = el.events || (el.events = {})
  }
  const newHandler = { value, modifiers }
  const handlers = events[name]
  /* istanbul ignore if */
  if (Array.isArray(handlers)) {
    important ? handlers.unshift(newHandler) : handlers.push(newHandler)
  } else if (handlers) {
    events[name] = important ? [newHandler, handlers] : [handlers, newHandler]
  } else {
    events[name] = newHandler
  }
}

export function getBindingAttr(
  el: ASTElement,
  name: string,
  getStatic?: boolean,
): ?string {
  const dynamicValue =
    getAndRemoveAttr(el, ':' + name) || getAndRemoveAttr(el, 'v-bind:' + name)
  if (dynamicValue != null) {
    return parseFilters(dynamicValue)
  } else if (getStatic !== false) {
    const staticValue = getAndRemoveAttr(el, name)
    if (staticValue != null) {
      return JSON.stringify(staticValue)
    }
  }
}

export function getAndRemoveAttr(el: ASTElement, name: string): ?string {
  let val
  if ((val = el.attrsMap[name]) != null) {
    const list = el.attrsList
    for (let i = 0, l = list.length; i < l; i++) {
      if (list[i].name === name) {
        list.splice(i, 1)
        break
      }
    }
  }
  return val
}


================================================
FILE: src/compiler/index.js
================================================
/* @flow */

import { parse } from './parser/index'
import { optimize } from './optimizer'
import { generate } from './codegen/index'
import { detectErrors } from './error-detector'
import { extend, noop } from 'shared/util'
import { warn, tip } from 'core/util/debug'

function baseCompile(
  template: string,
  options: CompilerOptions,
): CompiledResult {
  const ast = parse(template.trim(), options)
  optimize(ast, options)
  const code = generate(ast, options)
  return {
    ast,
    render: code.render,
    staticRenderFns: code.staticRenderFns,
  }
}

function makeFunction(code, errors) {
  try {
    return new Function(code)
  } catch (err) {
    errors.push({ err, code })
    return noop
  }
}

export function createCompiler(baseOptions: CompilerOptions) {
  const functionCompileCache: {
    [key: string]: CompiledFunctionResult,
  } = Object.create(null)

  function compile(
    template: string,
    options?: CompilerOptions,
  ): CompiledResult {
    const finalOptions = Object.create(baseOptions)
    const errors = []
    const tips = []
    finalOptions.warn = (msg, tip) => {
      ;(tip ? tips : errors).push(msg)
    }

    if (options) {
      // merge custom modules
      if (options.modules) {
        finalOptions.modules = (baseOptions.modules || []).concat(
          options.modules,
        )
      }
      // merge custom directives
      if (options.directives) {
        finalOptions.directives = extend(
          Object.create(baseOptions.directives),
          options.directives,
        )
      }
      // copy other options
      for (const key in options) {
        if (key !== 'modules' && key !== 'directives') {
          finalOptions[key] = options[key]
        }
      }
    }

    const compiled = baseCompile(template, finalOptions)
    if (process.env.NODE_ENV !== 'production') {
      errors.push.apply(errors, detectErrors(compiled.ast))
    }
    compiled.errors = errors
    compiled.tips = tips
    return compiled
  }

  function compileToFunctions(
    template: string,
    options?: CompilerOptions,
    vm?: Component,
  ): CompiledFunctionResult {
    options = options || {}

    /* istanbul ignore if */
    if (process.env.NODE_ENV !== 'production') {
      // detect possible CSP restriction
      try {
        new Function('return 1')
      } catch (e) {
        if (e.toString().match(/unsafe-eval|CSP/)) {
          warn(
            'It seems you are using the standalone build of Vue.js in an ' +
              'environment with Content Security Policy that prohibits unsafe-eval. ' +
              'The template compiler cannot work in this environment. Consider ' +
              'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
              'templates into render functions.',
          )
        }
      }
    }

    // check cache
    const key = options.delimiters
      ? String(options.delimiters) + template
      : template
    if (functionCompileCache[key]) {
      return functionCompileCache[key]
    }

    // compile
    const compiled = compile(template, options)

    // check compilation errors/tips
    if (process.env.NODE_ENV !== 'production') {
      if (compiled.errors && compiled.errors.length) {
        warn(
          `Error compiling template:\n\n${template}\n\n` +
            compiled.errors.map(e => `- ${e}`).join('\n') +
            '\n',
          vm,
        )
      }
      if (compiled.tips && compiled.tips.length) {
        compiled.tips.forEach(msg => tip(msg, vm))
      }
    }

    // turn code into functions
    const res = {}
    const fnGenErrors = []
    res.render = makeFunction(compiled.render, fnGenErrors)
    const l = compiled.staticRenderFns.length
    res.staticRenderFns = new Array(l)
    for (let i = 0; i < l; i++) {
      res.staticRenderFns[i] = makeFunction(
        compiled.staticRenderFns[i],
        fnGenErrors,
      )
    }

    // check function generation errors.
    // this should only happen if there is a bug in the compiler itself.
    // mostly for codegen development use
    /* istanbul ignore if */
    if (process.env.NODE_ENV !== 'production') {
      if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
        warn(
          `Failed to generate render function:\n\n` +
            fnGenErrors
              .map(({ err, code }) => `${err.toString()} in\n\n${code}\n`)
              .join('\n'),
          vm,
        )
      }
    }

    return (functionCompileCache[key] = res)
  }

  return {
    compile,
    compileToFunctions,
  }
}


================================================
FILE: src/compiler/optimizer.js
================================================
/* @flow */

import { makeMap, isBuiltInTag, cached, no } from 'shared/util'

let isStaticKey
let isPlatformReservedTag

const genStaticKeysCached = cached(genStaticKeys)

/**
 * Goal of the optimizer: walk the generated template AST tree
 * and detect sub-trees that are purely static, i.e. parts of
 * the DOM that never needs to change.
 *
 * Once we detect these sub-trees, we can:
 *
 * 1. Hoist them into constants, so that we no longer need to
 *    create fresh nodes for them on each re-render;
 * 2. Completely skip them in the patching process.
 */
export function optimize(root: ?ASTElement, options: CompilerOptions) {
  if (!root) return
  isStaticKey = genStaticKeysCached(options.staticKeys || '')
  isPlatformReservedTag = options.isReservedTag || no
  // first pass: mark all non-static nodes.
  markStatic(root)
  // second pass: mark static roots.
  markStaticRoots(root, false)
}

function genStaticKeys(keys: string): Function {
  return makeMap(
    'type,tag,attrsList,attrsMap,plain,parent,children,attrs' +
      (keys ? ',' + keys : ''),
  )
}

function markStatic(node: ASTNode) {
  node.static = isStatic(node)
  if (node.type === 1) {
    // do not make component slot content static. this avoids
    // 1. components not able to mutate slot nodes
    // 2. static slot content fails for hot-reloading
    if (
      !isPlatformReservedTag(node.tag) &&
      node.tag !== 'slot' &&
      node.attrsMap['inline-template'] == null
    ) {
      return
    }
    for (let i = 0, l = node.children.length; i < l; i++) {
      const child = node.children[i]
      markStatic(child)
      if (!child.static) {
        node.static = false
      }
    }
  }
}

function markStaticRoots(node: ASTNode, isInFor: boolean) {
  if (node.type === 1) {
    if (node.static || node.once) {
      node.staticInFor = isInFor
    }
    // For a node to qualify as a static root, it should have children that
    // are not just static text. Otherwise the cost of hoisting out will
    // outweigh the benefits and it's better off to just always render it fresh.
    if (
      node.static &&
      node.children.length &&
      !(node.children.length === 1 && node.children[0].type === 3)
    ) {
      node.staticRoot = true
      return
    } else {
      node.staticRoot = false
    }
    if (node.children) {
      for (let i = 0, l = node.children.length; i < l; i++) {
        markStaticRoots(node.children[i], isInFor || !!node.for)
      }
    }
    if (node.ifConditions) {
      walkThroughConditionsBlocks(node.ifConditions, isInFor)
    }
  }
}

function walkThroughConditionsBlocks(
  conditionBlocks: ASTIfConditions,
  isInFor: boolean,
): void {
  for (let i = 1, len = conditionBlocks.length; i < len; i++) {
    markStaticRoots(conditionBlocks[i].block, isInFor)
  }
}

function isStatic(node: ASTNode): boolean {
  if (node.type === 2) {
    // expression
    return false
  }
  if (node.type === 3) {
    // text
    return true
  }
  return !!(
    node.pre ||
    (!node.hasBindings && // no dynamic bindings
    !node.if &&
    !node.for && // not v-if or v-for or v-else
    !isBuiltInTag(node.tag) && // not a built-in
    isPlatformReservedTag(node.tag) && // not a component
      !isDirectChildOfTemplateFor(node) &&
      Object.keys(node).every(isStaticKey))
  )
}

function isDirectChildOfTemplateFor(node: ASTElement): boolean {
  while (node.parent) {
    node = node.parent
    if (node.tag !== 'template') {
      return false
    }
    if (node.for) {
      return true
    }
  }
  return false
}


================================================
FILE: src/compiler/parser/entity-decoder.js
================================================
/* @flow */

let decoder

export function decode(html: string): string {
  decoder = decoder || document.createElement('div')
  decoder.innerHTML = html
  return decoder.textContent
}


================================================
FILE: src/compiler/parser/filter-parser.js
================================================
/* @flow */

const validDivisionCharRE = /[\w).+\-_$\]]/

export function parseFilters(exp: string): string {
  let inSingle = false
  let inDouble = false
  let inTemplateString = false
  let inRegex = false
  let curly = 0
  let square = 0
  let paren = 0
  let lastFilterIndex = 0
  let c, prev, i, expression, filters

  for (i = 0; i < exp.length; i++) {
    prev = c
    c = exp.charCodeAt(i)
    if (inSingle) {
      if (c === 0x27 && prev !== 0x5c) inSingle = false
    } else if (inDouble) {
      if (c === 0x22 && prev !== 0x5c) inDouble = false
    } else if (inTemplateString) {
      if (c === 0x60 && prev !== 0x5c) inTemplateString = false
    } else if (inRegex) {
      if (c === 0x2f && prev !== 0x5c) inRegex = false
    } else if (
      c === 0x7c && // pipe
      exp.charCodeAt(i + 1) !== 0x7c &&
      exp.charCodeAt(i - 1) !== 0x7c &&
      !curly &&
      !square &&
      !paren
    ) {
      if (expression === undefined) {
        // first filter, end of expression
        lastFilterIndex = i + 1
        expression = exp.slice(0, i).trim()
      } else {
        pushFilter()
      }
    } else {
      switch (c) {
        case 0x22:
          inDouble = true
          break // "
        case 0x27:
          inSingle = true
          break // '
        case 0x60:
          inTemplateString = true
          break // `
        case 0x28:
          paren++
          break // (
        case 0x29:
          paren--
          break // )
        case 0x5b:
          square++
          break // [
        case 0x5d:
          square--
          break // ]
        case 0x7b:
          curly++
          break // {
        case 0x7d:
          curly--
          break // }
      }
      if (c === 0x2f) {
        // /
        let j = i - 1
        let p
        // find first non-whitespace prev char
        for (; j >= 0; j--) {
          p = exp.charAt(j)
          if (p !== ' ') break
        }
        if (!p || !validDivisionCharRE.test(p)) {
          inRegex = true
        }
      }
    }
  }

  if (expression === undefined) {
    expression = exp.slice(0, i).trim()
  } else if (lastFilterIndex !== 0) {
    pushFilter()
  }

  function pushFilter() {
    ;(filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim())
    lastFilterIndex = i + 1
  }

  if (filters) {
    for (i = 0; i < filters.length; i++) {
      expression = wrapFilter(expression, filters[i])
    }
  }

  return expression
}

function wrapFilter(exp: string, filter: string): string {
  const i = filter.indexOf('(')
  if (i < 0) {
    // _f: resolveFilter
    return `_f("${filter}")(${exp})`
  } else {
    const name = filter.slice(0, i)
    const args = filter.slice(i + 1)
    return `_f("${name}")(${exp},${args}`
  }
}


================================================
FILE: src/compiler/parser/html-parser.js
================================================
/**
 * Not type-checking this file because it's mostly vendor code.
 */

/*!
 * HTML Parser By John Resig (ejohn.org)
 * Modified by Juriy "kangax" Zaytsev
 * Original code by Erik Arvidsson, Mozilla Public License
 * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
 */

import { makeMap, no } from 'shared/util'
import { isNonPhrasingTag } from 'web/compiler/util'

// Regular Expressions for parsing tags and attributes
const singleAttrIdentifier = /([^\s"'<>/=]+)/
const singleAttrAssign = /(?:=)/
const singleAttrValues = [
  // attr value double quotes
  /"([^"]*)"+/.source,
  // attr value, single quotes
  /'([^']*)'+/.source,
  // attr value, no quotes
  /([^\s"'=<>`]+)/.source,
]
const attribute = new RegExp(
  '^\\s*' +
    singleAttrIdentifier.source +
    '(?:\\s*(' +
    singleAttrAssign.source +
    ')' +
    '\\s*(?:' +
    singleAttrValues.join('|') +
    '))?',
)

// could use https://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-QName
// but for Vue templates we can enforce a simple charset
const ncname = '[a-zA-Z_][\\w\\-\\.]*'
const qnameCapture = '((?:' + ncname + '\\:)?' + ncname + ')'
const startTagOpen = new RegExp('^<' + qnameCapture)
const startTagClose = /^\s*(\/?)>/
const endTag = new RegExp('^<\\/' + qnameCapture + '[^>]*>')
const doctype = /^<!DOCTYPE [^>]+>/i
const comment = /^<!--/
const conditionalComment = /^<!\[/

let IS_REGEX_CAPTURING_BROKEN = false
'x'.replace(/x(.)?/g, function(m, g) {
  IS_REGEX_CAPTURING_BROKEN = g === ''
})

// Special Elements (can contain anything)
const isPlainTextElement = makeMap('script,style,textarea', true)
const reCache = {}

const decodingMap = {
  '&lt;': '<',
  '&gt;': '>',
  '&quot;': '"',
  '&amp;': '&',
  '&#10;': '\n',
}
const encodedAttr = /&(?:lt|gt|quot|amp);/g
const encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#10);/g

function decodeAttr(value, shouldDecodeNewlines) {
  const re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr
  return value.replace(re, match => decodingMap[match])
}

export function parseHTML(html, options) {
  const stack = []
  const expectHTML = options.expectHTML
  const isUnaryTag = options.isUnaryTag || no
  const canBeLeftOpenTag = options.canBeLeftOpenTag || no
  let index = 0
  let last, lastTag
  while (html) {
    last = html
    // Make sure we're not in a plaintext content element like script/style
    if (!lastTag || !isPlainTextElement(lastTag)) {
      let textEnd = html.indexOf('<')
      if (textEnd === 0) {
        // Comment:
        if (comment.test(html)) {
          const commentEnd = html.indexOf('-->')

          if (commentEnd >= 0) {
            advance(commentEnd + 3)
            continue
          }
        }

        // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
        if (conditionalComment.test(html)) {
          const conditionalEnd = html.indexOf(']>')

          if (conditionalEnd >= 0) {
            advance(conditionalEnd + 2)
            continue
          }
        }

        // Doctype:
        const doctypeMatch = html.match(doctype)
        if (doctypeMatch) {
          advance(doctypeMatch[0].length)
          continue
        }

        // End tag:
        const endTagMatch = html.match(endTag)
        if (endTagMatch) {
          const curIndex = index
          advance(endTagMatch[0].length)
          parseEndTag(endTagMatch[1], curIndex, index)
          continue
        }

        // Start tag:
        const startTagMatch = parseStartTag()
        if (startTagMatch) {
          handleStartTag(startTagMatch)
          continue
        }
      }

      let text, rest, next
      if (textEnd >= 0) {
        rest = html.slice(textEnd)
        while (
          !endTag.test(rest) &&
          !startTagOpen.test(rest) &&
          !comment.test(rest) &&
          !conditionalComment.test(rest)
        ) {
          // < in plain text, be forgiving and treat it as text
          next = rest.indexOf('<', 1)
          if (next < 0) break
          textEnd += next
          rest = html.slice(textEnd)
        }
        text = html.substring(0, textEnd)
        advance(textEnd)
      }

      if (textEnd < 0) {
        text = html
        html = ''
      }

      if (options.chars && text) {
        options.chars(text)
      }
    } else {
      var stackedTag = lastTag.toLowerCase()
      var reStackedTag =
        reCache[stackedTag] ||
        (reCache[stackedTag] = new RegExp(
          '([\\s\\S]*?)(</' + stackedTag + '[^>]*>)',
          'i',
        ))
      var endTagLength = 0
      var rest = html.replace(reStackedTag, function(all, text, endTag) {
        endTagLength = endTag.length
        if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
          text = text
            .replace(/<!--([\s\S]*?)-->/g, '$1')
            .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1')
        }
        if (options.chars) {
          options.chars(text)
        }
        return ''
      })
      index += html.length - rest.length
      html = rest
      parseEndTag(stackedTag, index - endTagLength, index)
    }

    if (html === last) {
      options.chars && options.chars(html)
      if (
        process.env.NODE_ENV !== 'production' &&
        !stack.length &&
        options.warn
      ) {
        options.warn(`Mal-formatted tag at end of template: "${html}"`)
      }
      break
    }
  }

  // Clean up any remaining tags
  parseEndTag()

  function advance(n) {
    index += n
    html = html.substring(n)
  }

  function parseStartTag() {
    const start = html.match(startTagOpen)
    if (start) {
      const match = {
        tagName: start[1],
        attrs: [],
        start: index,
      }
      advance(start[0].length)
      let end, attr
      while (
        !(end = html.match(startTagClose)) &&
        (attr = html.match(attribute))
      ) {
        advance(attr[0].length)
        match.attrs.push(attr)
      }
      if (end) {
        match.unarySlash = end[1]
        advance(end[0].length)
        match.end = index
        return match
      }
    }
  }

  function handleStartTag(match) {
    const tagName = match.tagName
    const unarySlash = match.unarySlash

    if (expectHTML) {
      if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
        parseEndTag(lastTag)
      }
      if (canBeLeftOpenTag(tagName) && lastTag === tagName) {
        parseEndTag(tagName)
      }
    }

    const unary =
      isUnaryTag(tagName) ||
      (tagName === 'html' && lastTag === 'head') ||
      !!unarySlash

    const l = match.attrs.length
    const attrs = new Array(l)
    for (let i = 0; i < l; i++) {
      const args = match.attrs[i]
      // hackish work around FF bug https://bugzilla.mozilla.org/show_bug.cgi?id=369778
      if (IS_REGEX_CAPTURING_BROKEN && args[0].indexOf('""') === -1) {
        if (args[3] === '') {
          delete args[3]
        }
        if (args[4] === '') {
          delete args[4]
        }
        if (args[5] === '') {
          delete args[5]
        }
      }
      let value = args[3] || args[4] || args[5] || ''
      let name = args[1]
      /**
       * react-vue change
       * <div autorun></div>
       * {name: "autorun", value: """"} => {name: "autorun", value: "true"}
       */
      if (args[1].indexOf('v-') === -1 && args[2] === undefined) {
        value = 'true'
        name = ':' + name
      }
      attrs[i] = {
        name: name,
        value: decodeAttr(value, options.shouldDecodeNewlines),
      }
    }

    if (!unary) {
      stack.push({
        tag: tagName,
        lowerCasedTag: tagName.toLowerCase(),
        attrs: attrs,
      })
      lastTag = tagName
    }

    if (options.start) {
      options.start(tagName, attrs, unary, match.start, match.end)
    }
  }

  function parseEndTag(tagName, start, end) {
    let pos, lowerCasedTagName
    if (start == null) start = index
    if (end == null) end = index

    if (tagName) {
      lowerCasedTagName = tagName.toLowerCase()
    }

    // Find the closest opened tag of the same type
    if (tagName) {
      for (pos = stack.length - 1; pos >= 0; pos--) {
        if (stack[pos].lowerCasedTag === lowerCasedTagName) {
          break
        }
      }
    } else {
      // If no tag name is provided, clean shop
      pos = 0
    }

    if (pos >= 0) {
      // Close all the open elements, up the stack
      for (let i = stack.length - 1; i >= pos; i--) {
        if (
          process.env.NODE_ENV !== 'production' &&
          (i > pos || !tagName) &&
          options.warn
        ) {
          options.warn(`tag <${stack[i].tag}> has no matching end tag.`)
        }
        if (options.end) {
          options.end(stack[i].tag, start, end)
        }
      }

      // Remove the open elements from the stack
      stack.length = pos
      lastTag = pos && stack[pos - 1].tag
    } else if (lowerCasedTagName === 'br') {
      if (options.start) {
        options.start(tagName, [], true, start, end)
      }
    } else if (lowerCasedTagName === 'p') {
      if (options.start) {
        options.start(tagName, [], false, start, end)
      }
      if (options.end) {
        options.end(tagName, start, end)
      }
    }
  }
}


================================================
FILE: src/compiler/parser/index.js
================================================
/* @flow */

import { decode } from 'he'
import { parseHTML } from './html-parser'
import { parseText } from './text-parser'
import { parseFilters } from './filter-parser'
import { cached, no, camelize } from 'shared/util'
import { genAssignmentCode } from '../directives/model'
import { isIE, isEdge, isServerRendering, isNative } from 'core/util/env'

import ReactNativeRenderGenerator from 'vue-native/compiler/codegen/NativeRenderGenerator.js'

import {
  addProp,
  addAttr,
  baseWarn,
  addHandler,
  addDirective,
  getBindingAttr,
  getAndRemoveAttr,
  pluckModuleFunction,
} from '../helpers'

export const onRE = /^@|^v-on:/
export const dirRE = /^v-|^@|^:/
export const forAliasRE = /(.*?)\s+(?:in|of)\s+(.*)/
export const forIteratorRE = /\((\{[^}]*\}|[^,]*),([^,]*)(?:,([^,]*))?\)/

const argRE = /:(.*)$/
const bindRE = /^:|^v-bind:/
const modifierRE = /\.[^.]+/g
const splitRE = /\r?\n/g

const decodeHTMLCached = cached(decode)

// configurable state
export let warn
let delimiters
let transforms
let preTransforms
let postTransforms
let platformIsPreTag
let platformMustUseProp
let platformGetTagNamespace

/**
 * Convert HTML string to AST.
 */
export function parse(
  template: string,
  options: CompilerOptions,
): ASTElement | void {
  warn = options.warn || baseWarn
  platformGetTagNamespace = options.getTagNamespace || no
  platformMustUseProp = options.mustUseProp || no
  platformIsPreTag = options.isPreTag || no
  preTransforms = pluckModuleFunction(options.modules, 'preTransformNode')
  transforms = pluckModuleFunction(options.modules, 'transformNode')
  postTransforms = pluckModuleFunction(options.modules, 'postTransformNode')
  delimiters = options.delimiters

  const stack = []
  const preserveWhitespace = options.preserveWhitespace !== false
  let root
  let currentParent
  let inVPre = false
  let inPre = false
  let warned = false

  function warnOnce(msg) {
    if (!warned) {
      warned = true
      warn(msg)
    }
  }

  function endPre(element) {
    // check pre state
    if (element.pre) {
      inVPre = false
    }
    if (platformIsPreTag(element.tag)) {
      inPre = false
    }
  }

  parseHTML(template, {
    warn,
    expectHTML: options.expectHTML,
    isUnaryTag: options.isUnaryTag,
    canBeLeftOpenTag: options.canBeLeftOpenTag,
    shouldDecodeNewlines: options.shouldDecodeNewlines,
    start(tag, attrs, unary) {
      // check namespace.
      // inherit parent ns if there is one
      const ns =
        (currentParent && currentParent.ns) || platformGetTagNamespace(tag)

      // handle IE svg bug
      /* istanbul ignore if */
      if (isIE && ns === 'svg') {
        attrs = guardIESVGBug(attrs)
      }

      const element: ASTElement = {
        type: 1,
        tag,
        attrsList: attrs,
        attrsMap: makeAttrsMap(attrs),
        parent: currentParent,
        children: [],
      }
      if (ns) {
        element.ns = ns
      }

      if (isForbiddenTag(element) && !isServerRendering()) {
        element.forbidden = true
        process.env.NODE_ENV !== 'production' &&
          warn(
            'Templates should only be responsible for mapping the state to the ' +
              'UI. Avoid placing tags with side-effects in your templates, such as ' +
              `<${tag}>` +
              ', as they will not be parsed.',
          )
      }

      // apply pre-transforms
      for (let i = 0; i < preTransforms.length; i++) {
        preTransforms[i](element, options)
      }

      if (!inVPre) {
        processPre(element)
        if (element.pre) {
          inVPre = true
        }
      }
      if (platformIsPreTag(element.tag)) {
        inPre = true
      }
      if (inVPre) {
        processRawAttrs(element)
      } else {
        processFor(element)
        processIf(element)
        processOnce(element)
        processKey(element)

        // determine whether this is a plain element after
        // removing structural attributes
        element.plain = !element.key && !attrs.length

        processRef(element)
        processSlot(element)
        processComponent(element)
        for (let i = 0; i < transforms.length; i++) {
          transforms[i](element, options)
        }
        processAttrs(element)
      }

      function checkRootConstraints(el) {
        if (process.env.NODE_ENV !== 'production') {
          if (el.tag === 'slot' || el.tag === 'template') {
            warnOnce(
              `Cannot use <${el.tag}> as component root element because it may ` +
                'contain multiple nodes.',
            )
          }
          // eslint-disable-next-line no-prototype-builtins
          if (el.attrsMap.hasOwnProperty('v-for')) {
            warnOnce(
              'Cannot use v-for on stateful component root element because ' +
                'it renders multiple elements.',
            )
          }
        }
      }

      // tree management
      if (!root) {
        root = element
        checkRootConstraints(root)
      } else if (!stack.length) {
        // allow root elements with v-if, v-else-if and v-else
        if (root.if && (element.elseif || element.else)) {
          checkRootConstraints(element)
          addIfCondition(root, {
            exp: element.elseif,
            block: element,
          })
        } else if (process.env.NODE_ENV !== 'production') {
          warnOnce(
            `Component template should contain exactly one root element. ` +
              `If you are using v-if on multiple elements, ` +
              `use v-else-if to chain them instead.`,
          )
        }
      }
      if (currentParent && !element.forbidden) {
        if (element.elseif || element.else) {
          processIfConditions(element, currentParent)
        } else if (element.slotScope) {
          // scoped slot
          currentParent.plain = false
          const name = element.slotTarget || '"default"'
          ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[
            name
          ] = element
        } else {
          currentParent.children.push(element)
          element.parent = currentParent
        }
      }
      if (!unary) {
        currentParent = element
        stack.push(element)
      } else {
        endPre(element)
      }
      // apply post-transforms
      for (let i = 0; i < postTransforms.length; i++) {
        postTransforms[i](element, options)
      }
    },

    end() {
      // remove trailing whitespace
      const element = stack[stack.length - 1]
      const lastNode = element.children[element.children.length - 1]
      if (lastNode && lastNode.type === 3 && lastNode.text === ' ' && !inPre) {
        element.children.pop()
      }
      // pop stack
      stack.length -= 1
      currentParent = stack[stack.length - 1]
      endPre(element)
    },

    chars(text: string) {
      if (!currentParent) {
        if (process.env.NODE_ENV !== 'production') {
          if (text === template) {
            warnOnce(
              'Component template requires a root element, rather than just text.',
            )
          } else if ((text = text.trim())) {
            warnOnce(`text "${text}" outside root element will be ignored.`)
          }
        }
        return
      }
      // IE textarea placeholder bug
      /* istanbul ignore if */
      if (
        isIE &&
        currentParent.tag === 'textarea' &&
        currentParent.attrsMap.placeholder === text
      ) {
        return
      }
      const children = currentParent.children
      text =
        inPre || text.trim()
          ? decodeHTMLCached(text)
          : // only preserve whitespace if its not right after a starting tag
          preserveWhitespace && children.length
          ? ' '
          : ''
      if (text) {
        let expression
        if (
          !inVPre &&
          text !== ' ' &&
          (expression = parseText(text, delimiters))
        ) {
          children.push({
            type: 2,
            expression,
            text,
          })
        } else if (
          text !== ' ' ||
          !children.length ||
          children[children.length - 1].text !== ' '
        ) {
          children.push({
            type: 3,
            text,
          })
        }
      }
    },
  })
  return root
}

function processPre(el) {
  if (getAndRemoveAttr(el, 'v-pre') != null) {
    el.pre = true
  }
}

function processRawAttrs(el) {
  const l = el.attrsList.length
  if (l) {
    const attrs = (el.attrs = new Array(l))
    for (let i = 0; i < l; i++) {
      attrs[i] = {
        name: el.attrsList[i].name,
        value: JSON.stringify(el.attrsList[i].value),
      }
    }
  } else if (!el.pre) {
    // non root node in pre blocks with no attributes
    el.plain = true
  }
}

function processKey(el) {
  const exp = getBindingAttr(el, 'key')
  if (exp) {
    if (process.env.NODE_ENV !== 'production' && el.tag === 'template') {
      warn(
        `<template> cannot be keyed. Place the key on real elements instead.`,
      )
    }
    el.key = exp
  }
}

function processRef(el) {
  const ref = getBindingAttr(el, 'ref')
  if (ref) {
    el.ref = ref
    el.refInFor = checkInFor(el)
  }
}

function processFor(el) {
  let exp
  if ((exp = getAndRemoveAttr(el, 'v-for'))) {
    const inMatch = exp.match(forAliasRE)
    if (!inMatch) {
      process.env.NODE_ENV !== 'production' &&
        warn(`Invalid v-for expression: ${exp}`)
      return
    }
    el.for = inMatch[2].trim()
    const alias = inMatch[1].trim()
    const iteratorMatch = alias.match(forIteratorRE)
    if (iteratorMatch) {
      el.alias = iteratorMatch[1].trim()
      el.iterator1 = iteratorMatch[2].trim()
      if (iteratorMatch[3]) {
        el.iterator2 = iteratorMatch[3].trim()
      }
    } else {
      el.alias = alias
    }
  }
}

function processIf(el) {
  const exp = getAndRemoveAttr(el, 'v-if')
  if (exp) {
    el.if = exp
    addIfCondition(el, {
      exp: exp,
      block: el,
    })
  } else {
    if (getAndRemoveAttr(el, 'v-else') != null) {
      el.else = true
    }
    const elseif = getAndRemoveAttr(el, 'v-else-if')
    if (elseif) {
      el.elseif = elseif
    }
  }
}

function processIfConditions(el, parent) {
  const prev = findPrevElement(parent.children)
  if (prev && prev.if) {
    addIfCondition(prev, {
      exp: el.elseif,
      block: el,
    })
  } else if (process.env.NODE_ENV !== 'production') {
    warn(
      `v-${el.elseif ? 'else-if="' + el.elseif + '"' : 'else'} ` +
        `used on element <${el.tag}> without corresponding v-if.`,
    )
  }
}

function findPrevElement(children: Array<any>): ASTElement | void {
  let i = children.length
  while (i--) {
    if (children[i].type === 1) {
      return children[i]
    } else {
      if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {
        warn(
          `text "${children[i].text.trim()}" between v-if and v-else(-if) ` +
            `will be ignored.`,
        )
      }
      children.pop()
    }
  }
}

function addIfCondition(el, condition) {
  if (!el.ifConditions) {
    el.ifConditions = []
  }
  el.ifConditions.push(condition)
}

function processOnce(el) {
  const once = getAndRemoveAttr(el, 'v-once')
  if (once != null) {
    el.once = true
  }
}

function processSlot(el) {
  if (el.tag === 'slot') {
    el.slotName = getBindingAttr(el, 'name')
    if (process.env.NODE_ENV !== 'production' && el.key) {
      warn(
        `\`key\` does not work on <slot> because slots are abstract outlets ` +
          `and can possibly expand into multiple elements. ` +
          `Use the key on a wrapping element instead.`,
      )
    }
  } else {
    const slotTarget = getBindingAttr(el, 'slot')
    if (slotTarget) {
      el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget
    }
    if (el.tag === 'template') {
      el.slotScope = getAndRemoveAttr(el, 'scope')
    }
  }
}

function processComponent(el) {
  let binding
  if ((binding = getBindingAttr(el, 'is'))) {
    el.component = binding
  }
  if (getAndRemoveAttr(el, 'inline-template') != null) {
    el.inlineTemplate = true
  }
}

export function processAttrs(
  el: ASTElement,
  options: Object | void,
  customSlot: boolean = false,
) {
  const list = el.attrsList
  let i, l, name, rawName, value, modifiers, isProp
  for (i = 0, l = list.length; i < l; i++) {
    name = rawName = list[i].name
    value = list[i].value
    if (dirRE.test(name)) {
      // mark element as dynamic
      el.hasBindings = true
      // modifiers
      modifiers = parseModifiers(name)
      if (modifiers) {
        name = name.replace(modifierRE, '')
      }
      if (bindRE.test(name)) {
        // v-bind
        name = name.replace(bindRE, '')
        value = parseFilters(value)
        isProp = false
        if (modifiers) {
          if (modifiers.prop) {
            isProp = true
            name = camelize(name)
            if (name === 'innerHtml') name = 'innerHTML'
          }
          if (modifiers.camel) {
            name = camelize(name)
          }
          if (modifiers.sync) {
            addHandler(
              el,
              `update:${camelize(name)}`,
              genAssignmentCode(value, `$event`),
            )
          }
        }
        if (isProp || platformMustUseProp(el.tag, el.attrsMap.type, name)) {
          addProp(el, name, value)
        } else {
          addAttr(el, name, value)
        }
      } else if (onRE.test(name)) {
        // v-on
        name = name.replace(onRE, '')
        addHandler(el, name, value, modifiers, false, warn)
        //Check if its expression or function
        //
        if (isNative) {
          let camelCaseName = 'on-' + name
          camelCaseName = camelCaseName.replace(/-([a-z])/g, function(g) {
            return g[1].toUpperCase()
          })
          addAttr(el, camelCaseName, `() => ${value}`)
        }
      } else {
        // normal directives
        name = name.replace(dirRE, '')
        // parse arg
        const argMatch = name.match(argRE)
        const arg = argMatch && argMatch[1]
        if (arg) {
          name = name.slice(0, -(arg.length + 1))
        }
        if (isNative) {
          addHandler(el, name, value, modifiers, false, warn)
          if (name === 'model') {
            addAttr(el, 'value', value)
            let detectOnChange = false
            // $flow-disable-line
            el.attrs.forEach(attr => {
              if (attr.name === 'on-change') {
                detectOnChange = true
              }
            })
            if (!detectOnChange) {
              if (el.tag !== 'switch') {
                addAttr(
                  el,
                  'on-change',
                  `(value) => ${value}=value.nativeEvent.text`,
                )
              } else {
                addAttr(el, 'on-value-change', `(value) => ${value}=value`)
              }
            }
          }
        } else {
          addDirective(el, name, rawName, value, arg, modifiers)
        }
        if (process.env.NODE_ENV !== 'production' && name === 'model') {
          checkForAliasModel(el, value)
        }
      }
    } else {
      // literal attribute
      if (process.env.NODE_ENV !== 'production') {
        const expression = parseText(value, delimiters)
        if (expression) {
          warn(
            `${name}="${value}": ` +
              'Interpolation inside attributes has been removed. ' +
              'Use v-bind or the colon shorthand instead. For example, ' +
              'instead of <div id="{{ val }}">, use <div :id="val">.',
          )
        }
      }
      if (name === 'to') {
        value = value.replace(/\//, '')
        addAttr(el, 'on-press', `() => ${'navigation'}.navigate('${value}')`)
      } else {
        if (
          (name === 'render-prop-fn' || name === 'render-prop') &&
          customSlot
        ) {
          // Add Attribute in parent element
          //
          const renderer = new ReactNativeRenderGenerator(el, options)
          let customRenderer = renderer.generateRender()
          let customImport = renderer.generateImport()
          customRenderer = customRenderer.replace(
            /render \(vm\)/,
            'render (slotProps)',
          )

          if (name === 'render-prop') {
            customRenderer = '(' + customRenderer + ')()'
          } else {
            // Support for args
            customRenderer = customRenderer.replace(
              /render \(slotProps\)/,
              'render (args)',
            )
            if (
              el.attrsMap['arguments'] &&
              typeof el.attrsMap['arguments'] === 'string'
            ) {
              let customArguments = el.attrsMap['arguments'].split(',')
              customRenderer = customRenderer.replace(
                /render \(args\)/,
                // $flow-disable-line
                `render (${el.attrsMap['arguments']})`,
              )
              // Replace each instance of the argument
              //
              customArguments.forEach(argument => {
                let reg = new RegExp('vm[' + argument + ']', 'g')
                customRenderer = customRenderer.replace(reg, argument)
              })
            } else {
              customRenderer = customRenderer.replace(/vm\(args\)/g, 'args')
            }
          }
          // $flow-disable-line
          addAttr(el.parent, value, `${customRenderer}`)
          let vueNativeCoreImport = customImport.split(splitRE)
          if (vueNativeCoreImport && vueNativeCoreImport[0]) {
            let imports = vueNativeCoreImport[0]
            imports = imports.replace(/import \{/g, '')
            imports = imports.replace(/\} from 'vue-native-helper'/g, '')
            return imports.split(',').map(function(item) {
              return item.trim()
            })
          }
        } else {
          addAttr(el, name, JSON.stringify(value))
        }
      }
    }
  }
}

function checkInFor(el: ASTElement): boolean {
  let parent = el
  while (parent) {
    if (parent.for !== undefined) {
      return true
    }
    parent = parent.parent
  }
  return false
}

function parseModifiers(name: string): Object | void {
  const match = name.match(modifierRE)
  if (match) {
    const ret = {}
    match.forEach(m => {
      ret[m.slice(1)] = true
    })
    return ret
  }
}

function makeAttrsMap(attrs: Array<Object>): Object {
  const map = {}
  for (let i = 0, l = attrs.length; i < l; i++) {
    if (
      process.env.NODE_ENV !== 'production' &&
      map[attrs[i].name] &&
      !isIE &&
      !isEdge
    ) {
      warn('duplicate attribute: ' + attrs[i].name)
    }
    map[attrs[i].name] = attrs[i].value
  }
  return map
}

function isForbiddenTag(el): boolean {
  return (
    el.tag === 'style' ||
    (el.tag === 'script' &&
      (!el.attrsMap.type || el.attrsMap.type === 'text/javascript'))
  )
}

const ieNSBug = /^xmlns:NS\d+/
const ieNSPrefix = /^NS\d+:/

/* istanbul ignore next */
function guardIESVGBug(attrs) {
  const res = []
  for (let i = 0; i < attrs.length; i++) {
    const attr = attrs[i]
    if (!ieNSBug.test(attr.name)) {
      attr.name = attr.name.replace(ieNSPrefix, '')
      res.push(attr)
    }
  }
  return res
}

function checkForAliasModel(el, value) {
  let _el = el
  while (_el) {
    if (_el.for && _el.alias === value) {
      warn(
        `<${el.tag} v-model="${value}">: ` +
          `You are binding v-model directly to a v-for iteration alias. ` +
          `This will not be able to modify the v-for source array because ` +
          `writing to the alias is like modifying a function local variable. ` +
          `Consider using an array of objects and use v-model on an object property instead.`,
      )
    }
    _el = _el.parent
  }
}


================================================
FILE: src/compiler/parser/text-parser.js
================================================
/* @flow */

import { cached } from 'shared/util'
import { parseFilters } from './filter-parser'

const defaultTagRE = /\{\{((?:.|\n)+?)\}\}/g
const regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g

const buildRegex = cached(delimiters => {
  const open = delimiters[0].replace(regexEscapeRE, '\\$&')
  const close = delimiters[1].replace(regexEscapeRE, '\\$&')
  return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
})

export function parseText(
  text: string,
  delimiters?: [string, string],
): string | void {
  const tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE
  if (!tagRE.test(text)) {
    return
  }
  const tokens = []
  let lastIndex = (tagRE.lastIndex = 0)
  let match, index
  while ((match = tagRE.exec(text))) {
    index = match.index
    // push text token
    if (index > lastIndex) {
      tokens.push(JSON.stringify(text.slice(lastIndex, index)))
    }
    // tag token
    const exp = parseFilters(match[1].trim())
    tokens.push(`_s(${exp})`)
    lastIndex = index + match[0].length
  }
  if (lastIndex < text.length) {
    tokens.push(JSON.stringify(text.slice(lastIndex)))
  }
  return tokens.join('+')
}


================================================
FILE: src/core/components/index.js
================================================
import KeepAlive from './keep-alive'

export default {
  KeepAlive,
}


================================================
FILE: src/core/components/keep-alive.js
================================================
/* @flow */

import { getFirstComponentChild } from 'core/vdom/helpers/index'

type VNodeCache = { [key: string]: ?VNode }

const patternTypes: Array<Function> = [String, RegExp]

function getComponentName(opts: ?VNodeComponentOptions): ?string {
  return opts && (opts.Ctor.options.name || opts.tag)
}

function matches(pattern: string | RegExp, name: string): boolean {
  if (typeof pattern === 'string') {
    return pattern.split(',').indexOf(name) > -1
  } else if (pattern instanceof RegExp) {
    return pattern.test(name)
  }
  /* istanbul ignore next */
  return false
}

function pruneCache(cache: VNodeCache, current: VNode, filter: Function) {
  for (const key in cache) {
    const cachedNode: ?VNode = cache[key]
    if (cachedNode) {
      const name: ?string = getComponentName(cachedNode.componentOptions)
      if (name && !filter(name)) {
        if (cachedNode !== current) {
          pruneCacheEntry(cachedNode)
        }
        cache[key] = null
      }
    }
  }
}

function pruneCacheEntry(vnode: ?VNode) {
  if (vnode) {
    vnode.componentInstance.$destroy()
  }
}

export default {
  name: 'keep-alive',
  abstract: true,

  props: {
    include: patternTypes,
    exclude: patternTypes,
  },

  created() {
    this.cache = Object.create(null)
  },

  destroyed() {
    for (const key in this.cache) {
      pruneCacheEntry(this.cache[key])
    }
  },

  watch: {
    include(val: string | RegExp) {
      pruneCache(this.cache, this._vnode, name => matches(val, name))
    },
    exclude(val: string | RegExp) {
      pruneCache(this.cache, this._vnode, name => !matches(val, name))
    },
  },

  render() {
    const vnode: VNode = getFirstComponentChild(this.$slots.default)
    const componentOptions: ?VNodeComponentOptions =
      vnode && vnode.componentOptions
    if (componentOptions) {
      // check pattern
      const name: ?string = getComponentName(componentOptions)
      if (
        name &&
        ((this.include && !matches(this.include, name)) ||
          (this.exclude && matches(this.exclude, name)))
      ) {
        return vnode
      }
      const key: ?string =
        vnode.key == null
          ? // same constructor may get registered as different local components
            // so cid alone is not enough (#3269)
            componentOptions.Ctor.cid +
            (componentOptions.tag ? `::${componentOptions.tag}` : '')
          : vnode.key
      if (this.cache[key]) {
        vnode.componentInstance = this.cache[key].componentInstance
      } else {
        this.cache[key] = vnode
      }
      vnode.data.keepAlive = true
    }
    return vnode
  },
}


================================================
FILE: src/core/config.js
================================================
/* @flow */

import { no, noop, identity } from 'shared/util'

import { LIFECYCLE_HOOKS } from 'shared/constants'

export type Config = {
  // user
  optionMergeStrategies: { [key: string]: Function },
  silent: boolean,
  productionTip: boolean,
  performance: boolean,
  devtools: boolean,
  errorHandler: ?(err: Error, vm: Component, info: string) => void,
  ignoredElements: Array<string>,
  keyCodes: { [key: string]: number | Array<number> },

  // platform
  isReservedTag: (x?: string) => boolean,
  isReservedAttr: (x?: string) => boolean,
  parsePlatformTagName: (x: string) => string,
  isUnknownElement: (x?: string) => boolean,
  getTagNamespace: (x?: string) => string | void,
  mustUseProp: (tag: string, type: ?string, name: string) => boolean,

  // legacy
  _lifecycleHooks: Array<string>,
}

export default ({
  /**
   * Option merge strategies (used in core/util/options)
   */
  optionMergeStrategies: Object.create(null),

  /**
   * Whether to suppress warnings.
   */
  silent: false,

  /**
   * Show production mode tip message on boot?
   */
  productionTip: process.env.NODE_ENV !== 'production',

  /**
   * Whether to enable devtools
   */
  devtools: process.env.NODE_ENV !== 'production',

  /**
   * Whether to record perf
   */
  performance: false,

  /**
   * Error handler for watcher errors
   */
  errorHandler: null,

  /**
   * Ignore certain custom elements
   */
  ignoredElements: [],

  /**
   * Custom user key aliases for v-on
   */
  keyCodes: Object.create(null),

  /**
   * Check if a tag is reserved so that it cannot be registered as a
   * component. This is platform-dependent and may be overwritten.
   */
  isReservedTag: no,

  /**
   * Check if an attribute is reserved so that it cannot be used as a component
   * prop. This is platform-dependent and may be overwritten.
   */
  isReservedAttr: no,

  /**
   * Check if a tag is an unknown element.
   * Platform-dependent.
   */
  isUnknownElement: no,

  /**
   * Get the namespace of an element
   */
  getTagNamespace: noop,

  /**
   * Parse the real tag name for the specific platform.
   */
  parsePlatformTagName: identity,

  /**
   * Check if an attribute must be bound using property, e.g. value
   * Platform-dependent.
   */
  mustUseProp: no,

  /**
   * Exposed for legacy reasons
   */
  _lifecycleHooks: LIFECYCLE_HOOKS,
}: Config)


================================================
FILE: src/core/global-api/assets.js
================================================
/* @flow */

import config from '../config'
import { ASSET_TYPES } from 'shared/constants'
import {
  warn,
  // isPlainObject,
  camelize,
  capitalize,
} from '../util/index'

export function initAssetRegisters(Vue: GlobalAPI) {
  /**
   * Create asset registration methods.
   */
  ASSET_TYPES.forEach(type => {
    Vue[type] = function(
      id: string,
      definition: Function | Object,
    ): Function | Object | void {
      if (!definition) {
        return this.options[type + 's'][id]
      } else {
        /* istanbul ignore if */
        if (process.env.NODE_ENV !== 'production') {
          if (type === 'component' && config.isReservedTag(id)) {
            warn(
              'Do not use built-in or reserved HTML elements as component ' +
                'id: ' +
                id,
            )
          }
        }
        // if (type === 'component' && isPlainObject(definition)) {
        //   definition.name = definition.name || id
        //   definition = this.options._base.extend(definition)
        // }
        if (type === 'directive' && typeof definition === 'function') {
          definition = { bind: definition, update: definition }
        }
        /**
         * react-vue change
         */
        if (type === 'component' && typeof definition === 'function') {
          id = capitalize(camelize(id))
          if (definition.name) {
            const _id = capitalize(camelize(definition.name))
            if (_id !== id) {
              this.options[type + 's'][_id] = definition
            }
          }
        }

        this.options[type + 's'][id] = definition
        return definition
      }
    }
  })
}


================================================
FILE: src/core/global-api/extend.js
================================================
/* @flow */

import { ASSET_TYPES } from 'shared/constants'
import { warn, extend, mergeOptions } from '../util/index'
import { defineComputed, proxy } from '../instance/state'

export function initExtend(Vue: GlobalAPI) {
  /**
   * Each instance constructor, including Vue, has a unique
   * cid. This enables us to create wrapped "child
   * constructors" for prototypal inheritance and cache them.
   */
  Vue.cid = 0
  let cid = 1

  /**
   * Class inheritance
   */
  Vue.extend = function(extendOptions: Object): Function {
    extendOptions = extendOptions || {}
    const Super = this
    const SuperId = Super.cid
    const cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {})
    if (cachedCtors[SuperId]) {
      return cachedCtors[SuperId]
    }

    const name = extendOptions.name || Super.options.name
    if (process.env.NODE_ENV !== 'production') {
      if (!/^[a-zA-Z][\w-]*$/.test(name)) {
        warn(
          'Invalid component name: "' +
            name +
            '". Component names ' +
            'can only contain alphanumeric characters and the hyphen, ' +
            'and must start with a letter.',
        )
      }
    }

    const Sub = function VueComponent(options) {
      this._init(options)
    }
    Sub.prototype = Object.create(Super.prototype)
    Sub.prototype.constructor = Sub
    Sub.cid = cid++
    Sub.options = mergeOptions(Super.options, extendOptions)
    Sub['super'] = Super

    // For props and computed properties, we define the proxy getters on
    // the Vue instances at extension time, on the extended prototype. This
    // avoids Object.defineProperty calls for each instance created.
    if (Sub.options.props) {
      initProps(Sub)
    }
    if (Sub.options.computed) {
      initComputed(Sub)
    }

    // allow further extension/mixin/plugin usage
    Sub.extend = Super.extend
    Sub.mixin = Super.mixin
    Sub.use = Super.use

    // create asset registers, so extended classes
    // can have their private assets too.
    ASSET_TYPES.forEach(function(type) {
      Sub[type] = Super[type]
    })
    // enable recursive self-lookup
    if (name) {
      Sub.options.components[name] = Sub
    }

    // keep a reference to the super options at extension time.
    // later at instantiation we can check if Super's options have
    // been updated.
    Sub.superOptions = Super.options
    Sub.extendOptions = extendOptions
    Sub.sealedOptions = extend({}, Sub.options)

    // cache constructor
    cachedCtors[SuperId] = Sub
    return Sub
  }
}

function initProps(Comp) {
  const props = Comp.options.props
  for (const key in props) {
    proxy(Comp.prototype, `_props`, key)
  }
}

function initComputed(Comp) {
  const computed = Comp.options.computed
  for (const key in computed) {
    defineComputed(Comp.prototype, key, computed[key])
  }
}


================================================
FILE: src/core/global-api/index.js
================================================
/* @flow */

import config from '../config'
import { initUse } from './use'
import { initMixin } from './mixin'
import { initExtend } from './extend'
import { initAssetRegisters } from './assets'
import { set, del } from '../observer/index'
import { ASSET_TYPES } from 'shared/constants'
import builtInComponents from '../components/index'

import {
  warn,
  extend,
  nextTick,
  mergeOptions,
  defineReactive,
} from '../util/index'

export function initGlobalAPI(Vue: GlobalAPI) {
  // config
  const configDef = {}
  configDef.get = () => config
  if (process.env.NODE_ENV !== 'production') {
    configDef.set = () => {
      warn(
        'Do not replace the Vue.config object, set individual fields instead.',
      )
    }
  }
  Object.defineProperty(Vue, 'config', configDef)

  // exposed util methods.
  // NOTE: these are not considered part of the public API - avoid relying on
  // them unless you are aware of the risk.
  Vue.util = {
    warn,
    extend,
    mergeOptions,
    defineReactive,
  }

  Vue.set = set
  Vue.delete = del
  Vue.nextTick = nextTick

  Vue.options = Object.create(null)
  ASSET_TYPES.forEach(type => {
    Vue.options[type + 's'] = Object.create(null)
  })

  // this is used to identify the "base" constructor to extend all plain-object
  // components with in Weex's multi-instance scenarios.
  Vue.options._base = Vue

  extend(Vue.options.components, builtInComponents)

  initUse(Vue)
  initMixin(Vue)
  initExtend(Vue)
  initAssetRegisters(Vue)
}


================================================
FILE: src/core/global-api/mixin.js
================================================
/* @flow */

import { mergeOptions } from '../util/index'

export function initMixin(Vue: GlobalAPI) {
  Vue.mixin = function(mixin: Object) {
    this.options = mergeOptions(this.options, mixin)
  }
}


================================================
FILE: src/core/global-api/use.js
================================================
/* @flow */

import { toArray } from '../util/index'

export function initUse(Vue: GlobalAPI) {
  Vue.use = function(plugin: Function | Object) {
    /* istanbul ignore if */
    if (plugin.installed) {
      return
    }
    // additional parameters
    const args = toArray(arguments, 1)
    args.unshift(this)
    if (typeof plugin.install === 'function') {
      plugin.install.apply(plugin, args)
    } else if (typeof plugin === 'function') {
      plugin.apply(null, args)
    }
    plugin.installed = true
    return this
  }
}


================================================
FILE: src/core/index.js
================================================
import Vue from './instance/index'
import { initGlobalAPI } from './global-api/index'
import { isServerRendering } from 'core/util/env'

initGlobalAPI(Vue)

Object.defineProperty(Vue.prototype, '$isServer', {
  get: isServerRendering,
})

Vue.version = '__VERSION__'

export default Vue


================================================
FILE: src/core/instance/events.js
================================================
/* @flow */

import { updateListeners } from '../vdom/helpers/index'
import { toArray, tip, hyphenate, formatComponentName } from '../util/index'

export function initEvents(vm: Component) {
  vm._events = Object.create(null)

  /**
   * react-vue change
   */
  if (Array.isArray(vm.$options.reactVueCustomEvent)) {
    vm.$options.reactVueCustomEvent.forEach((v: any) => {
      vm.$on(v.name, v.handle)
    })
  }
  // vm._hasHookEvent = false
  // // init parent attached events
  // const listeners = vm.$options._parentListeners
  // if (listeners) {
  //   updateComponentListeners(vm, listeners)
  // }
}

let target: Component

function add(event, fn, once) {
  if (once) {
    target.$once(event, fn)
  } else {
    target.$on(event, fn)
  }
}

function remove(event, fn) {
  target.$off(event, fn)
}

export function updateComponentListeners(
  vm: Component,
  listeners: Object,
  oldListeners: ?Object,
) {
  target = vm
  updateListeners(listeners, oldListeners || {}, add, remove, vm)
}

export function eventsMixin(Vue: Class<Component>) {
  const hookRE = /^hook:/
  Vue.prototype.$on = function(
    event: string | Array<string>,
    fn: Function,
  ): Component {
    const vm: Component = this
    if (Array.isArray(event)) {
      for (let i = 0, l = event.length; i < l; i++) {
        this.$on(event[i], fn)
      }
    } else {
      ;(vm._events[event] || (vm._events[event] = [])).push(fn)
      // optimize hook:event cost by using a boolean flag marked at registration
      // instead of a hash lookup
      if (hookRE.test(event)) {
        vm._hasHookEvent = true
      }
    }
    return vm
  }

  Vue.prototype.$once = function(event: string, fn: Function): Component {
    const vm: Component = this
    function on() {
      vm.$off(event, on)
      fn.apply(vm, arguments)
    }
    on.fn = fn
    vm.$on(event, on)
    return vm
  }

  Vue.prototype.$off = function(
    event?: string | Array<string>,
    fn?: Function,
  ): Component {
    const vm: Component = this
    // all
    if (!arguments.length) {
      vm._events = Object.create(null)
      return vm
    }
    // array of events
    if (Array.isArray(event)) {
      for (let i = 0, l = event.length; i < l; i++) {
        this.$off(event[i], fn)
      }
      return vm
    }
    // specific event
    const cbs = vm._events[event]
    if (!cbs) {
      return vm
    }
    if (arguments.length === 1) {
      vm._events[event] = null
      return vm
    }
    // specific handler
    let cb
    let i = cbs.length
    while (i--) {
      cb = cbs[i]
      if (cb === fn || cb.fn === fn) {
        cbs.splice(i, 1)
        break
      }
    }
    return vm
  }

  Vue.prototype.$emit = function(event: string): Component {
    const vm: Component = this
    if (process.env.NODE_ENV !== 'production') {
      const lowerCaseEvent = event.toLowerCase()
      if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
        tip(
          `Event "${lowerCaseEvent}" is emitted in component ` +
            `${formatComponentName(
              vm,
            )} but the handler is registered for "${event}". ` +
            `Note that HTML attributes are case-insensitive and you cannot use ` +
            `v-on to listen to camelCase events when using in-DOM templates. ` +
            `You should probably use "${hyphenate(
              event,
            )}" instead of "${event}".`,
        )
      }
    }
    let cbs = vm._events[event]
    if (cbs) {
      cbs = cbs.length > 1 ? toArray(cbs) : cbs
      const args = toArray(arguments, 1)
      for (let i = 0, l = cbs.length; i < l; i++) {
        cbs[i].apply(vm, args)
      }
    }
    return vm
  }
}


================================================
FILE: src/core/instance/index.js
================================================
import { initMixin } from './init'
import { stateMixin } from './state'
/**
 * react-vue change
 */
// import { renderMixin } from './render'
import { eventsMixin } from './events'
/**
 * react-vue change
 */
// import { lifecycleMixin } from './lifecycle'
import {
  warn,
  // nextTick,
} from '../util/index'

function Vue(options) {
  if (process.env.NODE_ENV !== 'production' && !(this instanceof Vue)) {
    warn('Vue is a constructor and should be called with the `new` keyword')
  }

  if (process.env.NODE_ENV !== 'production') {
    warn(
      'Vue Native has been deprecated and is no longer being maintained. Please consider migrating to React Native or use NativeScript-Vue instead',
    )
  }
  /**
   * react-vue change
   */
  if (options) {
    if (options.reactVueSlots) {
      this.$slots = options.reactVueSlots
    }
    if (options.reactVueForceUpdate) {
      this.$forceUpdate = options.reactVueForceUpdate
    }
  }
  this._init(options)
}

initMixin(Vue)
stateMixin(Vue)
eventsMixin(Vue)

/**
 * react-vue change
 */
// lifecycleMixin(Vue)
// renderMixin(Vue)

export default Vue


================================================
FILE: src/core/instance/init.js
================================================
/* @flow */

import config from '../config'
import { initProxy } from './proxy'
import { initState } from './state'
import { initRender } from './render'
import { initEvents } from './events'
import { mark, measure } from '../util/perf'
import { initLifecycle, callHook } from './lifecycle'
import { initProvide, initInjections } from './inject'
import { extend, mergeOptions, formatComponentName } from '../util/index'

let uid = 0

export function initMixin(Vue: Class<Component>) {
  Vue.prototype._init = function(options?: Object) {
    const vm: Component = this
    // a uid
    vm._uid = uid++

    let startTag, endTag
    /* istanbul ignore if */
    if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
      startTag = `vue-perf-init:${vm._uid}`
      endTag = `vue-perf-end:${vm._uid}`
      mark(startTag)
    }

    // a flag to avoid this being observed
    vm._isVue = true
    // merge options
    if (options && options._isComponent) {
      // optimize internal component instantiation
      // since dynamic options merging is pretty slow, and none of the
      // internal component options needs special treatment.
      initInternalComponent(vm, options)
    } else {
      vm.$options = mergeOptions(
        resolveConstructorOptions(vm.constructor),
        options || {},
        vm,
      )
    }
    /* istanbul ignore else */
    if (process.env.NODE_ENV !== 'production') {
      initProxy(vm)
    } else {
      vm._renderProxy = vm
    }
    // expose real self
    vm._self = vm
    initLifecycle(vm)
    initEvents(vm)
    initRender(vm)
    callHook(vm, 'beforeCreate')
    initInjections(vm) // resolve injections before data/props
    initState(vm)
    initProvide(vm) // resolve provide after data/props
    callHook(vm, 'created')

    /* istanbul ignore if */
    if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
      vm._name = formatComponentName(vm, false)
      mark(endTag)
      measure(`${vm._name} init`, startTag, endTag)
    }

    if (vm.$options.el) {
      vm.$mount(vm.$options.el)
    }
  }
}

function initInternalComponent(
  vm: Component,
  options: InternalComponentOptions,
) {
  const opts = (vm.$options = Object.create(vm.constructor.options))
  // doing this because it's faster than dynamic enumeration.
  opts.parent = options.parent
  opts.propsData = options.propsData
  opts._parentVnode = options._parentVnode
  opts._parentListeners = options._parentListeners
  opts._renderChildren = options._renderChildren
  opts._componentTag = options._componentTag
  opts._parentElm = options._parentElm
  opts._refElm = options._refElm
  if (options.render) {
    opts.render = options.render
    opts.staticRenderFns = options.staticRenderFns
  }
}

export function resolveConstructorOptions(Ctor: Class<Component>) {
  let options = Ctor.options
  if (Ctor.super) {
    const superOptions = resolveConstructorOptions(Ctor.super)
    const cachedSuperOptions = Ctor.superOptions
    if (superOptions !== cachedSuperOptions) {
      // super option changed,
      // need to resolve new options.
      Ctor.superOptions = superOptions
      // check if there are any late-modified/attached options (#4976)
      const modifiedOptions = resolveModifiedOptions(Ctor)
      // update base extend options
      if (modifiedOptions) {
        extend(Ctor.extendOptions, modifiedOptions)
      }
      options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions)
      if (options.name) {
        options.components[options.name] = Ctor
      }
    }
  }
  return options
}

function resolveModifiedOptions(Ctor: Class<Component>): ?Object {
  let modified
  const latest = Ctor.options
  const sealed = Ctor.sealedOptions
  for (const key in latest) {
    if (latest[key] !== sealed[key]) {
      if (!modified) modified = {}
      modified[key] = dedupe(latest[key], sealed[key])
    }
  }
  return modified
}

function dedupe(latest, sealed) {
  // compare latest and sealed to ensure lifecycle hooks won't be duplicated
  // between merges
  if (Array.isArray(latest)) {
    const res = []
    sealed = Array.isArray(sealed) ? sealed : [sealed]
    for (let i = 0; i < latest.length; i++) {
      if (sealed.indexOf(latest[i]) < 0) {
        res.push(latest[i])
      }
    }
    return res
  } else {
    return latest
  }
}


================================================
FILE: src/core/instance/inject.js
================================================
/* @flow */

import { hasSymbol } from 'core/util/env'
import { warn } from '../util/index'
import { defineReactive } from '../observer/index'

export function initProvide(vm: Component) {
  const provide = vm.$options.provide
  if (provide) {
    vm._provided = typeof provide === 'function' ? provide.call(vm) : provide
  }
}

export function initInjections(vm: Component) {
  const result = resolveInject(vm.$options.inject, vm)
  if (result) {
    Object.keys(result).forEach(key => {
      /* istanbul ignore else */
      if (process.env.NODE_ENV !== 'production') {
        defineReactive(vm, key, result[key], () => {
          warn(
            `Avoid mutating an injected value directly since the changes will be ` +
              `overwritten whenever the provided component re-renders. ` +
              `injection being mutated: "${key}"`,
            vm,
          )
        })
      } else {
        defineReactive(vm, key, result[key])
      }
    })
  }
}

export function resolveInject(inject: any, vm: Component): ?Object {
  if (inject) {
    // inject is :any because flow is not smart enough to figure out cached
    // isArray here
    const isArray = Array.isArray(inject)
    const result = Object.create(null)
    const keys = isArray
      ? inject
      : hasSymbol
      ? Reflect.ownKeys(inject)
      : Object.keys(inject)

    for (let i = 0; i < keys.length; i++) {
      const key = keys[i]
      const provideKey = isArray ? key : inject[key]
      let source = vm
      while (source) {
        if (source._provided && provideKey in source._provided) {
          result[key] = source._provided[provideKey]
          break
        }
        source = source.$parent
      }
    }
    return result
  }
}


================================================
FILE: src/core/instance/lifecycle.js
================================================
/* @flow */

import config from '../config'
import Watcher from '../observer/watcher'
import { mark, measure } from '../util/perf'
import { createEmptyVNode } from '../vdom/vnode'
import { observerState } from '../observer/index'
import { updateComponentListeners } from './events'

import {
  warn,
  noop,
  remove,
  handleError,
  emptyObject,
  validateProp,
} from '../util/index'

export let activeInstance: any = null

export function initLifecycle(vm: Component) {
  const options = vm.$options

  // locate first non-abstract parent
  let parent = options.parent
  if (parent && !options.abstract) {
    while (parent.$options.abstract && parent.$parent) {
      parent = parent.$parent
    }
    parent.$children.push(vm)
  }

  vm.$parent = parent
  vm.$root = parent ? parent.$root : vm

  vm.$children = []
  vm.$refs = {}

  vm._watcher = null
  vm._inactive = null
  vm._directInactive = false
  vm._isMounted = false
  vm._isDestroyed = false
  vm._isBeingDestroyed = false
}

export function lifecycleMixin(Vue: Class<Component>) {
  Vue.prototype._update = function(vnode: VNode, hydrating?: boolean) {
    const vm: Component = this
    if (vm._isMounted) {
      callHook(vm, 'beforeUpdate')
    }
    const prevEl = vm.$el
    const prevVnode = vm._vnode
    const prevActiveInstance = activeInstance
    activeInstance = vm
    vm._vnode = vnode
    // Vue.prototype.__patch__ is injected in entry points
    // based on the rendering backend used.
    if (!prevVnode) {
      // initial render
      vm.$el = vm.__patch__(
        vm.$el,
        vnode,
        hydrating,
        false /* removeOnly */,
        vm.$options._parentElm,
        vm.$options._refElm,
      )
    } else {
      // updates
      vm.$el = vm.__patch__(prevVnode, vnode)
    }
    activeInstance = prevActiveInstance
    // update __vue__ reference
    if (prevEl) {
      prevEl.__vue__ = null
    }
    if (vm.$el) {
      vm.$el.__vue__ = vm
    }
    // if parent is an HOC, update its $el as well
    if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
      vm.$parent.$el = vm.$el
    }
    // updated hook is called by the scheduler to ensure that children are
    // updated in a parent's updated hook.
  }

  Vue.prototype.$forceUpdate = function() {
    const vm: Component = this
    if (vm._watcher) {
      vm._watcher.update()
    }
  }

  Vue.prototype.$destroy = function() {
    const vm: Component = this
    if (vm._isBeingDestroyed) {
      return
    }
    callHook(vm, 'beforeDestroy')
    vm._isBeingDestroyed = true
    // remove self from parent
    const parent = vm.$parent
    if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
      remove(parent.$children, vm)
    }
    // teardown watchers
    if (vm._watcher) {
      vm._watcher.teardown()
    }
    let i = vm._watchers.length
    while (i--) {
      vm._watchers[i].teardown()
    }
    // remove reference from data ob
    // frozen object may not have observer.
    if (vm._data.__ob__) {
      vm._data.__ob__.vmCount--
    }
    // call the last hook...
    vm._isDestroyed = true
    // invoke destroy hooks on current rendered tree
    vm.__patch__(vm._vnode, null)
    // fire destroyed hook
    callHook(vm, 'destroyed')
    // turn off all instance listeners.
    vm.$off()
    // remove __vue__ reference
    if (vm.$el) {
      vm.$el.__vue__ = null
    }
    // remove reference to DOM nodes (prevents leak)
    vm.$options._parentElm = vm.$options._refElm = null
  }
}

export function mountComponent(
  vm: Component,
  el: ?Element,
  hydrating?: boolean,
): Component {
  vm.$el = el
  if (!vm.$options.render) {
    vm.$options.render = createEmptyVNode
    if (process.env.NODE_ENV !== 'production') {
      /* istanbul ignore if */
      if (
        (vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
        vm.$options.el ||
        el
      ) {
        warn(
          'You are using the runtime-only build of Vue where the template ' +
            'compiler is not available. Either pre-compile the templates into ' +
            'render functions, or use the compiler-included build.',
          vm,
        )
      } else {
        warn(
          'Failed to mount component: template or render function not defined.',
          vm,
        )
      }
    }
  }
  callHook(vm, 'beforeMount')

  let updateComponent
  /* istanbul ignore if */
  if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
    updateComponent = () => {
      const name = vm._name
      const id = vm._uid
      const startTag = `vue-perf-start:${id}`
      const endTag = `vue-perf-end:${id}`

      mark(startTag)
      const vnode = vm._render()
      mark(endTag)
      measure(`${name} render`, startTag, endTag)

      mark(startTag)
      vm._update(vnode, hydrating)
      mark(endTag)
      measure(`${name} patch`, startTag, endTag)
    }
  } else {
    updateComponent = () => {
      vm._update(vm._render(), hydrating)
    }
  }

  vm._watcher = new Watcher(vm, updateComponent, noop)
  hydrating = false

  // manually mounted instance, call mounted on self
  // mounted is called for render-created child components in its inserted hook
  if (vm.$vnode == null) {
    vm._isMounted = true
    callHook(vm, 'mounted')
  }
  return vm
}

export function updateChildComponent(
  vm: Component,
  propsData: ?Object,
  listeners: ?Object,
  parentVnode: VNode,
  renderChildren: ?Array<VNode>,
) {
  // determine whether component has slot children
  // we need to do this before overwriting $options._renderChildren
  const hasChildren = !!(
    (
      renderChildren || // has new static slots
      vm.$options._renderChildren || // has old static slots
      parentVnode.data.scopedSlots || // has new scoped slots
      vm.$scopedSlots !== emptyObject
    ) // has old scoped slots
  )

  vm.$options._parentVnode = parentVnode
  vm.$vnode = parentVnode // update vm's placeholder node without re-render
  if (vm._vnode) {
    // update child tree's parent
    vm._vnode.parent = parentVnode
  }
  vm.$options._renderChildren = renderChildren

  // update props
  if (propsData && vm.$options.props) {
    observerState.shouldConvert = false
    if (process.env.NODE_ENV !== 'production') {
      observerState.isSettingProps = true
    }
    const props = vm._props
    const propKeys = vm.$options._propKeys || []
    for (let i = 0; i < propKeys.length; i++) {
      const key = propKeys[i]
      props[key] = validateProp(key, vm.$options.props, propsData, vm)
    }
    observerState.shouldConvert = true
    if (process.env.NODE_ENV !== 'production') {
      observerState.isSettingProps = false
    }
    // keep a copy of raw propsData
    vm.$options.propsData = propsData
  }
  // update listeners
  if (listeners) {
    const oldListeners = vm.$options._parentListeners
    vm.$options._parentListeners = listeners
    updateComponentListeners(vm, listeners, oldListeners)
  }
  // resolve slots + force update if has children
  if (hasChildren) {
    vm.$forceUpdate()
  }
}

function isInInactiveTree(vm) {
  while (vm && (vm = vm.$parent)) {
    if (vm._inactive) return true
  }
  return false
}

export function activateChildComponent(vm: Component, direct?: boolean) {
  if (direct) {
    vm._directInactive = false
    if (isInInactiveTree(vm)) {
      return
    }
  } else if (vm._directInactive) {
    return
  }
  if (vm._inactive || vm._inactive === null) {
    vm._inactive = false
    for (let i = 0; i < vm.$children.length; i++) {
      activateChildComponent(vm.$children[i])
    }
    callHook(vm, 'activated')
  }
}

export function deactivateChildComponent(vm: Component, direct?: boolean) {
  if (direct) {
    vm._directInactive = true
    if (isInInactiveTree(vm)) {
      return
    }
  }
  if (!vm._inactive) {
    vm._inactive = true
    for (let i = 0; i < vm.$children.length; i++) {
      deactivateChildComponent(vm.$children[i])
    }
    callHook(vm, 'deactivated')
  }
}

export function callHook(vm: Component, hook: string) {
  const handlers = vm.$options[hook]
  if (handlers) {
    for (let i = 0, j = handlers.length; i < j; i++) {
      try {
        handlers[i].call(vm)
      } catch (e) {
        handleError(e, vm, `${hook} hook`)
      }
    }
  }
  if (vm._hasHookEvent) {
    vm.$emit('hook:' + hook)
  }
}


================================================
FILE: src/core/instance/proxy.js
================================================
/* not type checking this file because flow doesn't play well with Proxy */

import config from 'core/config'
import { warn, makeMap } from '../util/index'

let initProxy

if (process.env.NODE_ENV !== 'production') {
  const allowedGlobals = makeMap(
    'Infinity,undefined,NaN,isFinite,isNaN,' +
      'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
      'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
      'require, toJSON', // for Webpack/Browserify
  )

  const warnNonPresent = (target, key) => {
    warn(
      `Property or method "${key}" is not defined on the instance but ` +
        `referenced during render. Make sure to declare reactive data ` +
        `properties in the data option.`,
      target,
    )
  }

  const hasProxy =
    typeof Proxy !== 'undefined' && Proxy.toString().match(/native code/)

  if (hasProxy) {
    const isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta')
    config.keyCodes = new Proxy(config.keyCodes, {
      set(target, key, value) {
        if (isBuiltInModifier(key)) {
          warn(
            `Avoid overwriting built-in modifier in config.keyCodes: .${key}`,
          )
          return false
        } else {
          target[key] = value
          return true
        }
      },
    })
  }

  const hasHandler = {
    has(target, key) {
      const has = key in target
      const isAllowed = allowedGlobals(key) || key.charAt(0) === '_'
      if (!has && !isAllowed) {
        warnNonPresent(target, key)
      }
      return has || !isAllowed
    },
  }

  const getHandler = {
    get(target, key) {
      // react-vue change ```key === 'toJSON'``` prevent warn in react-native
      if (typeof key === 'string' && !(key in target) && key !== 'toJSON') {
        warnNonPresent(target, key)
      }
      return target[key]
    },
  }

  initProxy = function initProxy(vm) {
    if (hasProxy) {
      // determine which proxy handler to use
      const options = vm.$options
      const handlers =
        options.render && options.render._withStripped ? getHandler : hasHandler
      vm._renderProxy = new Proxy(vm, handlers)
    } else {
      vm._renderProxy = vm
    }
  }
}

export { initProxy }


================================================
FILE: src/core/instance/render-helpers/bind-object-props.js
================================================
/* @flow */

import config from 'core/config'
import { isObject, warn, toObject } from 'core/util/index'

/**
 * Runtime helper for merging v-bind="object" into a VNode's data.
 */
export function bindObjectProps(
  data: any,
  tag: string,
  value: any,
  asProp?: boolean,
): VNodeData {
  if (value) {
    if (!isObject(value)) {
      process.env.NODE_ENV !== 'production' &&
        warn('v-bind without argument expects an Object or Array value', this)
    } else {
      if (Array.isArray(value)) {
        value = toObject(value)
      }
      let hash
      for (const key in value) {
        if (key === 'class' || key === 'style') {
          hash = data
        } else {
          const type = data.attrs && data.attrs.type
          hash =
            asProp || config.mustUseProp(tag, type, key)
              ? data.domProps || (data.domProps = {})
              : data.attrs || (data.attrs = {})
        }
        if (!(key in hash)) {
          hash[key] = value[key]
        }
      }
    }
  }
  return data
}


================================================
FILE: src/core/instance/render-helpers/check-keycodes.js
================================================
/* @flow */

import config from 'core/config'

/**
 * Runtime helper for checking keyCodes from config.
 */
export function checkKeyCodes(
  eventKeyCode: number,
  key: string,
  builtInAlias: number | Array<number> | void,
): boolean {
  const keyCodes = config.keyCodes[key] || builtInAlias
  if (Array.isArray(keyCodes)) {
    return keyCodes.indexOf(eventKeyCode) === -1
  } else {
    return keyCodes !== eventKeyCode
  }
}


================================================
FILE: src/core/instance/render-helpers/render-list.js
================================================
/* @flow */

import { isObject } from 'core/util/index'

/**
 * Runtime helper for rendering v-for lists.
 */
export function renderList(val: any, render: () => VNode): ?Array<VNode> {
  let ret: ?Array<VNode>, i, l, keys, key
  if (Array.isArray(val) || typeof val === 'string') {
    ret = new Array(val.length)
    for (i = 0, l = val.length; i < l; i++) {
      ret[i] = render(val[i], i)
    }
  } else if (typeof val === 'number') {
    ret = new Array(val)
    for (i = 0; i < val; i++) {
      ret[i] = render(i + 1, i)
    }
  } else if (isObject(val)) {
    keys = Object.keys(val)
    ret = new Array(keys.length)
    for (i = 0, l = keys.length; i < l; i++) {
      key = keys[i]
      ret[i] = render(val[key], key, i)
    }
  }
  return ret
}


================================================
FILE: src/core/instance/render-helpers/render-slot.js
================================================
/* @flow */

import { extend, warn } from 'core/util/index'

/**
 * Runtime helper for rendering <slot>
 */
export function renderSlot(
  name: string,
  fallback: ?Array<VNode>,
  props: ?Object,
  bindObject: ?Object,
): ?Array<VNode> {
  const scopedSlotFn = this.$scopedSlots[name]
  if (scopedSlotFn) {
    // scoped slot
    props = props || {}
    if (bindObject) {
      extend(props, bindObject)
    }
    return scopedSlotFn(props) || fallback
  } else {
    const slotNodes = this.$slots[name]
    // warn duplicate slot usage
    if (slotNodes && process.env.NODE_ENV !== 'production') {
      slotNodes._rendered &&
        warn(
          `Duplicate presence of slot "${name}" found in the same render tree ` +
            `- this will likely cause render errors.`,
          this,
        )
      slotNodes._rendered = true
    }
    return slotNodes || fallback
  }
}


================================================
FILE: src/core/instance/render-helpers/render-static.js
================================================
/* @flow */

import { cloneVNode, cloneVNodes } from 'core/vdom/vnode'

/**
 * Runtime helper for rendering static trees.
 */
export function renderStatic(
  index: number,
  isInFor?: boolean,
): VNode | Array<VNode> {
  let tree = this._staticTrees[index]
  // if has already-rendered static tree and not inside v-for,
  // we can reuse the same tree by doing a shallow clone.
  if (tree && !isInFor) {
    return Array.isArray(tree) ? cloneVNodes(tree) : cloneVNode(tree)
  }
  // otherwise, render a fresh tree.
  tree = this._staticTrees[index] = this.$options.staticRenderFns[index].call(
    this._renderProxy,
  )
  markStatic(tree, `__static__${index}`, false)
  return tree
}

/**
 * Runtime helper for v-once.
 * Effectively it means marking the node as static with a unique key.
 */
export function markOnce(
  tree: VNode | Array<VNode>,
  index: number,
  key: string,
) {
  markStatic(tree, `__once__${index}${key ? `_${key}` : ``}`, true)
  return tree
}

function markStatic(tree: VNode | Array<VNode>, key: string, isOnce: boolean) {
  if (Array.isArray(tree)) {
    for (let i = 0; i < tree.length; i++) {
      if (tree[i] && typeof tree[i] !== 'string') {
        markStaticNode(tree[i], `${key}_${i}`, isOnce)
      }
    }
  } else {
    markStaticNode(tree, key, isOnce)
  }
}

function markStaticNode(node, key, isOnce) {
  node.isStatic = true
  node.key = key
  node.isOnce = isOnce
}


================================================
FILE: src/core/instance/render-helpers/resolve-filter.js
================================================
/* @flow */

import { identity, resolveAsset } from 'core/util/index'

/**
 * Runtime helper for resolving filters
 */
export function resolveFilter(id: string): Function {
  return resolveAsset(this.$options, 'filters', id, true) || identity
}


================================================
FILE: src/core/instance/render-helpers/resolve-slots.js
================================================
/* @flow */

/**
 * Runtime helper for resolving raw children VNodes into a slot object.
 */
export function resolveSlots(
  children: ?Array<VNode>,
  context: ?Component,
): { [key: string]: Array<VNode> } {
  const slots = {}
  if (!children) {
    return slots
  }
  const defaultSlot = []
  let name, child
  for (let i = 0, l = children.length; i < l; i++) {
    child = children[i]
    // named slots should only be respected if the vnode was rendered in the
    // same context.
    if (
      (child.context === context || child.functionalContext === context) &&
      child.data &&
      (name = child.data.slot)
    ) {
      const slot = slots[name] || (slots[name] = [])
      if (child.tag === 'template') {
        slot.push.apply(slot, child.children)
      } else {
        slot.push(child)
      }
    } else {
      defaultSlot.push(child)
    }
  }
  // ignore whitespace
  if (!defaultSlot.every(isWhitespace)) {
    slots.default = defaultSlot
  }
  return slots
}

function isWhitespace(node: VNode): boolean {
  return node.isComment || node.text === ' '
}

export function resolveScopedSlots(
  fns: Array<[string, Function]>,
): { [key: string]: Function } {
  const res = {}
  for (let i = 0; i < fns.length; i++) {
    res[fns[i][0]] = fns[i][1]
  }
  return res
}


================================================
FILE: src/core/instance/render.js
================================================
/* @flow */

import {
  warn,
  nextTick,
  toNumber,
  _toString,
  looseEqual,
  emptyObject,
  handleError,
  looseIndexOf,
} from '../util/index'

import VNode, {
  cloneVNodes,
  createTextVNode,
  createEmptyVNode,
} from '../vdom/vnode'

import { createElement } from '../vdom/create-element'
import { renderList } from './render-helpers/render-list'
import { renderSlot } from './render-helpers/render-slot'
import { resolveFilter } from './render-helpers/resolve-filter'
import { checkKeyCodes } from './render-helpers/check-keycodes'
import { bindObjectProps } from './render-helpers/bind-object-props'
import { renderStatic, markOnce } from './render-helpers/render-static'
import {
  // resolveSlots,
  resolveScopedSlots,
} from './render-helpers/resolve-slots'

export function initRender(vm: Component) {
  vm._vnode = null // the root of the child tree
  vm._staticTrees = null
  // const parentVnode = vm.$vnode = vm.$options._parentVnode // the placeholder node in parent tree
  // const renderContext = parentVnode && parentVnode.context
  /**
   * react-vue change
   */
  // vm.$slots = resolveSlots(vm.$options._renderChildren, renderContext)
  vm.$scopedSlots = emptyObject
  // bind the createElement fn to this instance
  // so that we get proper render context inside it.
  // args order: tag, data, children, normalizationType, alwaysNormalize
  // internal version is used by render functions compiled from templates
  vm._c = (a, b, c, d) => createElement(vm, a, b, c, d, false)
  // normalization is always applied for the public version, used in
  // user-written render functions.
  vm.$createElement = (a, b, c, d) => createElement(vm, a, b, c, d, true)
}

export function renderMixin(Vue: Class<Component>) {
  Vue.prototype.$nextTick = function(fn: Function) {
    return nextTick(fn, this)
  }

  Vue.prototype._render = function(): VNode {
    const vm: Component = this
    const { render, staticRenderFns, _parentVnode } = vm.$options

    if (vm._isMounted) {
      // clone slot nodes on re-renders
      for (const key in vm.$slots) {
        vm.$slots[key] = cloneVNodes(vm.$slots[key])
      }
    }

    vm.$scopedSlots =
      (_parentVnode && _parentVnode.data.scopedSlots) || emptyObject

    if (staticRenderFns && !vm._staticTrees) {
      vm._staticTrees = []
    }
    // set parent vnode. this allows render functions to have access
    // to the data on the placeholder node.
    vm.$vnode = _parentVnode
    // render self
    let vnode
    try {
      vnode = render.call(vm._renderProxy, vm.$createElement)
    } catch (e) {
      handleError(e, vm, `render function`)
      // return error render result,
      // or previous vnode to prevent render error causing blank component
      /* istanbul ignore else */
      if (process.env.NODE_ENV !== 'production') {
        vnode = vm.$options.renderError
          ? vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e)
          : vm._vnode
      } else {
        vnode = vm._vnode
      }
    }
    // return empty vnode in case the render function errored out
    if (!(vnode instanceof VNode)) {
      if (process.env.NODE_ENV !== 'production' && Array.isArray(vnode)) {
        warn(
          'Multiple root nodes returned from render function. Render function ' +
            'should return a single root node.',
          vm,
        )
      }
      vnode = createEmptyVNode()
    }
    // set parent
    vnode.parent = _parentVnode
    return vnode
  }

  // internal render helpers.
  // these are exposed on the instance prototype to reduce generated render
  // code size.
  Vue.prototype._o = markOnce
  Vue.prototype._n = toNumber
  Vue.prototype._s = _toString
  Vue.prototype._l = renderList
  Vue.prototype._t = renderSlot
  Vue.prototype._q = looseEqual
  Vue.prototype._i = looseIndexOf
  Vue.prototype._m = renderStatic
  Vue.prototype._f = resolveFilter
  Vue.prototype._k = checkKeyCodes
  Vue.prototype._b = bindObjectProps
  Vue.prototype._v = createTextVNode
  Vue.prototype._e = createEmptyVNode
  Vue.prototype._u = resolveScopedSlots
}


================================================
FILE: src/core/instance/state.js
================================================
/* @flow */

import config from '../config'
import Dep from '../observer/dep'
import Watcher from '../observer/watcher'

import {
  set,
  del,
  observe,
  observerState,
  defineReactive,
} from '../observer/index'

import {
  warn,
  bind,
  noop,
  hasOwn,
  isReserved,
  handleError,
  validateProp,
  isPlainObject,
} from '../util/index'

const sharedPropertyDefinition = {
  enumerable: true,
  configurable: true,
  get: noop,
  set: noop,
}

export function proxy(target: Object, sourceKey: string, key: string) {
  sharedPropertyDefinition.get = function proxyGetter() {
    return this[sourceKey][key]
  }
  sharedPropertyDefinition.set = function proxySetter(val) {
    this[sourceKey][key] = val
  }
  Object.defineProperty(target, key, sharedPropertyDefinition)
}

export function initState(vm: Component) {
  vm._watchers = []
  const opts = vm.$options
  if (opts.props) initProps(vm, opts.props)
  if (opts.methods) initMethods(vm, opts.methods)
  if (opts.data) {
    initData(vm)
  } else {
    observe((vm._data = {}), true /* asRootData */)
  }
  if (opts.computed) initComputed(vm, opts.computed)
  if (opts.watch) initWatch(vm, opts.watch)
}

const isReservedProp = {
  key: 1,
  ref: 1,
  slot: 1,
}

function initProps(vm: Component, propsOptions: Object) {
  const propsData = vm.$options.propsData || {}
  const props = (vm._props = {})
  // cache prop keys so that future props updates can iterate using Array
  // instead of dynamic object key enumeration.
  const keys = (vm.$options._propKeys = [])
  const isRoot = !vm.$parent
  // root instance props should be converted
  observerState.shouldConvert = isRoot
  for (const key in propsOptions) {
    keys.push(key)
    const value = validateProp(key, propsOptions, propsData, vm)
    /* istanbul ignore else */
    if (process.env.NODE_ENV !== 'production') {
      if (isReservedProp[key] || config.isReservedAttr(key)) {
        warn(
          `"${key}" is a reserved attribute and cannot be used as component prop.`,
          vm,
        )
      }
      /**
       * react-vue change
       */
      defineReactive(props, key, value, () => {
        // if (vm.$parent && !observerState.isSettingProps) {
        //   warn(
        //     `Avoid mutating a prop directly since the value will be ` +
        //     `overwritten whenever the parent component re-renders. ` +
        //     `Instead, use a data or computed property based on the prop's ` +
        //     `value. Prop being mutated: "${key}"`,
        //     vm
        //   )
        // }
      })
    } else {
      defineReactive(props, key, value)
    }
    // static props are already proxied on the component's prototype
    // during Vue.extend(). We only need to proxy props defined at
    // instantiation here.
    if (!(key in vm)) {
      proxy(vm, `_props`, key)
    }
  }
  observerState.shouldConvert = true
}

function initData(vm: Component) {
  let data = vm.$options.data
  data = vm._data = typeof data === 'function' ? getData(data, vm) : data || {}
  if (!isPlainObject(data)) {
    data = {}
    process.env.NODE_ENV !== 'production' &&
      warn(
        'data functions should return an object:\n' +
          'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
        vm,
      )
  }
  // proxy data on instance
  const keys = Object.keys(data)
  const props = vm.$options.props
  let i = keys.length
  while (i--) {
    if (props && hasOwn(props, keys[i])) {
      process.env.NODE_ENV !== 'production' &&
        warn(
          `The data property "${keys[i]}" is already declared as a prop. ` +
            `Use prop default value instead.`,
          vm,
        )
    } else if (!isReserved(keys[i])) {
      proxy(vm, `_data`, keys[i])
    }
  }
  // observe data
  observe(data, true /* asRootData */)
}

function getData(data: Function, vm: Component): any {
  try {
    return data.call(vm)
  } catch (e) {
    handleError(e, vm, `data()`)
    return {}
  }
}

const computedWatcherOptions = { lazy: true }

function initComputed(vm: Component, computed: Object) {
  const watchers = (vm._computedWatchers = Object.create(null))

  for (const key in computed) {
    const userDef = computed[key]
    let getter = typeof userDef === 'function' ? userDef : userDef.get
    if (process.env.NODE_ENV !== 'production') {
      if (getter === undefined) {
        warn(
          `No getter function has been defined for computed property "${key}".`,
          vm,
        )
        getter = noop
      }
    }
    // create internal watcher for the computed property.
    watchers[key] = new Watcher(vm, getter, noop, computedWatcherOptions)

    // component-defined computed properties are already defined on the
    // component prototype. We only need to define computed properties defined
    // at instantiation here.
    if (!(key in vm)) {
      defineComputed(vm, key, userDef)
    } else if (process.env.NODE_ENV !== 'production') {
      if (key in vm.$data) {
        warn(`The computed property "${key}" is already defined in data.`, vm)
      } else if (vm.$options.props && key in vm.$options.props) {
        warn(`The computed property "${key}" is already defined as a prop.`, vm)
      }
    }
  }
}

export function defineComputed(
  target: any,
  key: string,
  userDef: Object | Function,
) {
  if (typeof userDef === 'function') {
    sharedPropertyDefinition.get = createComputedGetter(key)
    sharedPropertyDefinition.set = noop
  } else {
    sharedPropertyDefinition.get = userDef.get
      ? userDef.cache !== false
        ? createComputedGetter(key)
        : userDef.get
      : noop
    sharedPropertyDefinition.set = userDef.set ? userDef.set : noop
  }
  Object.defineProperty(target, key, sharedPropertyDefinition)
}

function createComputedGetter(key) {
  return function computedGetter() {
    const watcher = this._computedWatchers && this._computedWatchers[key]
    if (watcher) {
      if (watcher.dirty) {
        watcher.evaluate()
      }
      if (Dep.target) {
        watcher.depend()
      }
      return watcher.value
    }
  }
}

function initMethods(vm: Component, methods: Object) {
  const props = vm.$options.props
  for (const key in methods) {
    vm[key] = methods[key] == null ? noop : bind(methods[key], vm)
    if (process.env.NODE_ENV !== 'production') {
      if (methods[key] == null) {
        warn(
          `method "${key}" has an undefined value in the component definition. ` +
            `Did you reference the function correctly?`,
          vm,
        )
      }
      if (props && hasOwn(props, key)) {
        warn(`method "${key}" has already been defined as a prop.`, vm)
      }
    }
  }
}

function initWatch(vm: Component, watch: Object) {
  for (const key in watch) {
    const handler = watch[key]
    if (Array.isArray(handler)) {
      for (let i = 0; i < handler.length; i++) {
        createWatcher(vm, key, handler[i])
      }
    } else {
      createWatcher(vm, key, handler)
    }
  }
}

function createWatcher(vm: Component, key: string, handler: any) {
  let options
  if (isPlainObject(handler)) {
    options = handler
    handler = handler.handler
  }
  if (typeof handler === 'string') {
    handler = vm[handler]
  }
  vm.$watch(key, handler, options)
}

export function stateMixin(Vue: Class<Component>) {
  // flow somehow has problems with directly declared definition object
  // when using Object.defineProperty, so we have to procedurally build up
  // the object here.
  const dataDef = {}
  dataDef.get = function() {
    return this._data
  }
  const propsDef = {}
  propsDef.get = function() {
    return this._props
  }
  if (process.env.NODE_ENV !== 'production') {
    // eslint-disable-next-line no-unused-vars
    dataDef.set = function(newData: Object) {
      warn(
        'Avoid replacing instance root $data. ' +
          'Use nested data properties instead.',
        this,
      )
    }
    propsDef.set = function() {
      warn(`$props is readonly.`, this)
    }
  }
  Object.defineProperty(Vue.prototype, '$data', dataDef)
  Object.defineProperty(Vue.prototype, '$props', propsDef)

  Vue.prototype.$set = set
  Vue.prototype.$delete = del

  Vue.prototype.$watch = function(
    expOrFn: string | Function,
    cb: Function,
    options?: Object,
  ): Function {
    const vm: Component = this
    options = options || {}
    options.user = true
    const watcher = new Watcher(vm, expOrFn, cb, options)
    if (options.immediate) {
      cb.call(vm, watcher.value)
    }
    return function unwatchFn() {
      watcher.teardown()
    }
  }
}


================================================
FILE: src/core/observer/array.js
================================================
/*
 * not type checking this file because flow doesn't play well with
 * dynamically accessing methods on Array prototype
 */

import { def } from '../util/index'

const arrayProto = Array.prototype
export const arrayMethods = Object.create(arrayProto)

/**
 * Intercept mutating methods and emit events
 */
;['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'].forEach(
  function(method) {
    // cache original method
    const original = arrayProto[method]
    def(arrayMethods, method, function mutator() {
      // avoid leaking arguments:
      // http://jsperf.com/closure-with-arguments
      let i = arguments.length
      const args = new Array(i)
      while (i--) {
        args[i] = arguments[i]
      }
      const result = original.apply(this, args)
      const ob = this.__ob__
      let inserted
      switch (method) {
        case 'push':
          inserted = args
          break
        case 'unshift':
          inserted = args
          break
        case 'splice':
          inserted = args.slice(2)
          break
      }
      if (inserted) ob.observeArray(inserted)
      // notify change
      ob.dep.notify()
      return result
    })
  },
)


================================================
FILE: src/core/observer/dep.js
================================================
/* @flow */

import type Watcher from './watcher'
import { remove } from '../util/index'

let uid = 0

/**
 * A dep is an observable that can have multiple
 * directives subscribing to it.
 */
export default class Dep {
  static target: ?Watcher
  id: number
  subs: Array<Watcher>

  constructor() {
    this.id = uid++
    this.subs = []
  }

  addSub(sub: Watcher) {
    this.subs.push(sub)
  }

  removeSub(sub: Watcher) {
    remove(this.subs, sub)
  }

  depend() {
    if (Dep.target) {
      Dep.target.addDep(this)
    }
  }

  notify() {
    // stabilize the subscriber list first
    const subs = this.subs.slice()
    for (let i = 0, l = subs.length; i < l; i++) {
      subs[i].update()
    }
  }
}

// the current target watcher being evaluated.
// this is globally unique because there could be only one
// watcher being evaluated at any time.
Dep.target = null
const targetStack = []

export function pushTarget(_target: Watcher) {
  if (Dep.target) targetStack.push(Dep.target)
  Dep.target = _target
}

export function popTarget() {
  Dep.target = targetStack.pop()
}


================================================
FILE: src/core/observer/index.js
================================================
/* @flow */

import Dep from './dep'
import { arrayMethods } from './array'
import {
  def,
  isObject,
  isPlainObject,
  hasProto,
  hasOwn,
  warn,
  isServerRendering,
} from '../util/index'

const arrayKeys = Object.getOwnPropertyNames(arrayMethods)

/**
 * By default, when a reactive property is set, the new value is
 * also converted to become reactive. However when passing down props,
 * we don't want to force conversion because the value may be a nested value
 * under a frozen data structure. Converting it would defeat the optimization.
 */
export const observerState = {
  shouldConvert: true,
  isSettingProps: false,
}

/**
 * Observer class that are attached to each observed
 * object. Once attached, the observer converts target
 * object's property keys into getter/setters that
 * collect dependencies and dispatches updates.
 */
export class Observer {
  value: any
  dep: Dep
  vmCount: number // number of vms that has this object as root $data

  constructor(value: any) {
    this.value = value
    this.dep = new Dep()
    this.vmCount = 0
    def(value, '__ob__', this)
    if (Array.isArray(value)) {
      const augment = hasProto ? protoAugment : copyAugment
      augment(value, arrayMethods, arrayKeys)
      this.observeArray(value)
    } else {
      this.walk(value)
    }
  }

  /**
   * Walk through each property and convert them into
   * getter/setters. This method should only be called when
   * value type is Object.
   */
  walk(obj: Object) {
    const keys = Object.keys(obj)
    for (let i = 0; i < keys.length; i++) {
      defineReactive(obj, keys[i], obj[keys[i]])
    }
  }

  /**
   * Observe a list of Array items.
   */
  observeArray(items: Array<any>) {
    for (let i = 0, l = items.length; i < l; i++) {
      observe(items[i])
    }
  }
}

// helpers

/**
 * Augment an target Object or Array by intercepting
 * the prototype chain using __proto__
 */
function protoAugment(target, src: Object) {
  /* eslint-disable no-proto */
  target.__proto__ = src
  /* eslint-enable no-proto */
}

/**
 * Augment an target Object or Array by defining
 * hidden properties.
 */
/* istanbul ignore next */
function copyAugment(target: Object, src: Object, keys: Array<string>) {
  for (let i = 0, l = keys.length; i < l; i++) {
    const key = keys[i]
    def(target, key, src[key])
  }
}

/**
 * Attempt to create an observer instance for a value,
 * returns the new observer if successfully observed,
 * or the existing observer if the value already has one.
 */
export function observe(value: any, asRootData: ?boolean): Observer | void {
  if (!isObject(value)) {
    return
  }
  let ob: Observer | void
  if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
    ob = value.__ob__
  } else if (
    observerState.shouldConvert &&
    !isServerRendering() &&
    (Array.isArray(value) || isPlainObject(value)) &&
    Object.isExtensible(value) &&
    !value._isVue
  ) {
    ob = new Observer(value)
  }
  if (asRootData && ob) {
    ob.vmCount++
  }
  return ob
}

/**
 * Define a reactive property on an Object.
 */
export function defineReactive(
  obj: Object,
  key: string,
  val: any,
  customSetter?: Function,
) {
  const dep = new Dep()

  const property = Object.getOwnPropertyDescriptor(obj, key)
  if (property && property.configurable === false) {
    return
  }

  // cater for pre-defined getter/setters
  const getter = property && property.get
  const setter = property && property.set

  let childOb = observe(val)
  Object.defineProperty(obj, key, {
    enumerable: true,
    configurable: true,
    get: function reactiveGetter() {
      const value = getter ? getter.call(obj) : val
      if (Dep.target) {
        dep.depend()
        if (childOb) {
          childOb.dep.depend()
        }
        if (Array.isArray(value)) {
          dependArray(value)
        }
      }
      return value
    },
    set: function reactiveSetter(newVal) {
      const value = getter ? getter.call(obj) : val
      /* eslint-disable no-self-compare */
      if (newVal === value || (newVal !== newVal && value !== value)) {
        return
      }
      /* eslint-enable no-self-compare */
      if (process.env.NODE_ENV !== 'production' && customSetter) {
        customSetter()
      }
      if (setter) {
        setter.call(obj, newVal)
      } else {
        val = newVal
      }
      childOb = observe(newVal)
      dep.notify()
    },
  })
}

/**
 * Set a property on an object. Adds the new property and
 * triggers change notification if the property doesn't
 * already exist.
 */
export function set(target: Array<any> | Object, key: any, val: any): any {
  if (Array.isArray(target) && typeof key === 'number') {
    target.length = Math.max(target.length, key)
    target.splice(key, 1, val)
    return val
  }
  if (hasOwn(target, key)) {
    target[key] = val
    return val
  }
  const ob = (target: any).__ob__
  if (target._isVue || (ob && ob.vmCount)) {
    process.env.NODE_ENV !== 'production' &&
      warn(
        'Avoid adding reactive properties to a Vue instance or its root $data ' +
          'at runtime - declare it upfront in the data option.',
      )
    return val
  }
  if (!ob) {
    target[key] = val
    return val
  }
  defineReactive(ob.value, key, val)
  ob.dep.notify()
  return val
}

/**
 * Delete a property and trigger change if necessary.
 */
export function del(target: Array<any> | Object, key: any) {
  if (Array.isArray(target) && typeof key === 'number') {
    target.splice(key, 1)
    return
  }
  const ob = (target: any).__ob__
  if (target._isVue || (ob && ob.vmCount)) {
    process.env.NODE_ENV !== 'production' &&
      warn(
        'Avoid deleting properties on a Vue instance or its root $data ' +
          '- just set it to null.',
      )
    return
  }
  if (!hasOwn(target, key)) {
    return
  }
  delete target[key]
  if (!ob) {
    return
  }
  ob.dep.notify()
}

/**
 * Collect dependencies on array elements when the array is touched, since
 * we cannot intercept array element access like property getters.
 */
function dependArray(value: Array<any>) {
  for (let e, i = 0, l = value.length; i < l; i++) {
    e = value[i]
    e && e.__ob__ && e.__ob__.dep.depend()
    if (Array.isArray(e)) {
      dependArray(e)
    }
  }
}


================================================
FILE: src/core/observer/scheduler.js
================================================
/* @flow */

import type Watcher from './watcher'
import config from '../config'
import { callHook, activateChildComponent } from '../instance/lifecycle'

import { warn, nextTick, devtools } from '../util/index'

export const MAX_UPDATE_COUNT = 100

const queue: Array<Watcher> = []
const activatedChildren: Array<Component> = []
let has: { [key: number]: ?true } = {}
let circular: { [key: number]: number } = {}
let waiting = false
let flushing = false
let index = 0

/**
 * Reset the scheduler's state.
 */
function resetSchedulerState() {
  queue.length = activatedChildren.length = 0
  has = {}
  if (process.env.NODE_ENV !== 'production') {
    circular = {}
  }
  waiting = flushing = false
}

/**
 * Flush both queues and run the watchers.
 */
function flushSchedulerQueue() {
  flushing = true
  let watcher, id

  // Sort queue before flush.
  // This ensures that:
  // 1. Components are updated from parent to child. (because parent is always
  //    created before the child)
  // 2. A component's user watchers are run before its render watcher (because
  //    user watchers are created before the render watche
Download .txt
gitextract_npbnms5j/

├── .babelrc
├── .eslintignore
├── .eslintrc
├── .flowconfig
├── .github/
│   ├── FUNDING.yml
│   └── ISSUE_TEMPLATE/
│       ├── ---bug-report.md
│       ├── ---issue-with-the-documentation-or-website.md
│       ├── ---issue-with-vue-native-router.md
│       └── ---questions-or-help-with-usage.md
├── .gitignore
├── .prettierrc
├── CHANGELOG.md
├── COMPONENT.md
├── LICENSE
├── README.md
├── __tests__/
│   └── unit/
│       └── features/
│           └── instance/
│               └── init.spec.js
├── converting-react-native-project.md
├── flow/
│   ├── compiler.js
│   ├── component.js
│   ├── global-api.js
│   ├── modules.js
│   ├── options.js
│   ├── ssr.js
│   └── vnode.js
├── jest.config.json
├── jsconfig.json
├── package.json
├── packages/
│   ├── vue-native-core/
│   │   ├── README.md
│   │   ├── index.js
│   │   └── package.json
│   ├── vue-native-helper/
│   │   ├── README.md
│   │   ├── index.js
│   │   └── package.json
│   ├── vue-native-scripts/
│   │   ├── .npmignore
│   │   ├── README.md
│   │   ├── bin/
│   │   │   └── vue-native-script.js
│   │   ├── index.js
│   │   └── package.json
│   └── vue-native-template-compiler/
│       ├── README.md
│       ├── index.js
│       └── package.json
├── scripts/
│   ├── .eslintrc
│   ├── alias.js
│   ├── build.js
│   ├── ci.sh
│   ├── config.js
│   ├── git-hooks/
│   │   └── pre-commit
│   └── release.sh
├── src/
│   ├── compiler/
│   │   ├── codegen/
│   │   │   ├── events.js
│   │   │   └── index.js
│   │   ├── directives/
│   │   │   ├── bind.js
│   │   │   ├── index.js
│   │   │   └── model.js
│   │   ├── error-detector.js
│   │   ├── helpers.js
│   │   ├── index.js
│   │   ├── optimizer.js
│   │   └── parser/
│   │       ├── entity-decoder.js
│   │       ├── filter-parser.js
│   │       ├── html-parser.js
│   │       ├── index.js
│   │       └── text-parser.js
│   ├── core/
│   │   ├── components/
│   │   │   ├── index.js
│   │   │   └── keep-alive.js
│   │   ├── config.js
│   │   ├── global-api/
│   │   │   ├── assets.js
│   │   │   ├── extend.js
│   │   │   ├── index.js
│   │   │   ├── mixin.js
│   │   │   └── use.js
│   │   ├── index.js
│   │   ├── instance/
│   │   │   ├── events.js
│   │   │   ├── index.js
│   │   │   ├── init.js
│   │   │   ├── inject.js
│   │   │   ├── lifecycle.js
│   │   │   ├── proxy.js
│   │   │   ├── render-helpers/
│   │   │   │   ├── bind-object-props.js
│   │   │   │   ├── check-keycodes.js
│   │   │   │   ├── render-list.js
│   │   │   │   ├── render-slot.js
│   │   │   │   ├── render-static.js
│   │   │   │   ├── resolve-filter.js
│   │   │   │   └── resolve-slots.js
│   │   │   ├── render.js
│   │   │   └── state.js
│   │   ├── observer/
│   │   │   ├── array.js
│   │   │   ├── dep.js
│   │   │   ├── index.js
│   │   │   ├── scheduler.js
│   │   │   └── watcher.js
│   │   ├── util/
│   │   │   ├── debug.js
│   │   │   ├── env.js
│   │   │   ├── error.js
│   │   │   ├── index.js
│   │   │   ├── lang.js
│   │   │   ├── options.js
│   │   │   ├── perf.js
│   │   │   └── props.js
│   │   └── vdom/
│   │       ├── create-component.js
│   │       ├── create-element.js
│   │       ├── create-functional-component.js
│   │       ├── helpers/
│   │       │   ├── extract-props.js
│   │       │   ├── get-first-component-child.js
│   │       │   ├── index.js
│   │       │   ├── merge-hook.js
│   │       │   ├── normalize-children.js
│   │       │   ├── resolve-async-component.js
│   │       │   └── update-listeners.js
│   │       ├── modules/
│   │       │   ├── directives.js
│   │       │   ├── index.js
│   │       │   └── ref.js
│   │       ├── patch.js
│   │       └── vnode.js
│   ├── platforms/
│   │   ├── vue-native/
│   │   │   ├── compiler/
│   │   │   │   ├── codegen/
│   │   │   │   │   ├── BaseGenerator.js
│   │   │   │   │   ├── NativeRenderGenerator.js
│   │   │   │   │   ├── RenderGenerator.js
│   │   │   │   │   ├── WebRenderGenerator.js
│   │   │   │   │   └── index.js
│   │   │   │   ├── config.js
│   │   │   │   ├── constants.js
│   │   │   │   ├── directives/
│   │   │   │   │   ├── html.js
│   │   │   │   │   ├── index.js
│   │   │   │   │   ├── model.js
│   │   │   │   │   └── text.js
│   │   │   │   ├── helpers.js
│   │   │   │   ├── index.js
│   │   │   │   ├── modules/
│   │   │   │   │   ├── events.js
│   │   │   │   │   └── style.js
│   │   │   │   ├── native.js
│   │   │   │   ├── parser/
│   │   │   │   │   ├── filter-parser.js
│   │   │   │   │   └── text-parser.js
│   │   │   │   ├── property/
│   │   │   │   │   ├── ARIADOMPropertyConfig.js
│   │   │   │   │   ├── EventConstant.js
│   │   │   │   │   ├── HTMLDOMPropertyConfig.js
│   │   │   │   │   ├── ReactProps.js
│   │   │   │   │   ├── SVGDOMPropertyConfig.js
│   │   │   │   │   └── index.js
│   │   │   │   ├── util/
│   │   │   │   │   ├── attrs.js
│   │   │   │   │   ├── element.js
│   │   │   │   │   └── index.js
│   │   │   │   └── web.js
│   │   │   ├── compiler.js
│   │   │   ├── index.js
│   │   │   ├── observer.js
│   │   │   ├── runtime/
│   │   │   │   ├── components/
│   │   │   │   │   ├── buildComponent.js
│   │   │   │   │   ├── buildDirective.js
│   │   │   │   │   ├── buildInputComponent.js
│   │   │   │   │   ├── buildMixin.js
│   │   │   │   │   ├── buildNativeComponent.js
│   │   │   │   │   ├── buildWebEmptyComponent.js
│   │   │   │   │   ├── buildWebInputComponent.js
│   │   │   │   │   ├── buildWebTransition.js
│   │   │   │   │   ├── index.js
│   │   │   │   │   └── util.js
│   │   │   │   ├── directives/
│   │   │   │   │   ├── index.js
│   │   │   │   │   └── model.js
│   │   │   │   ├── helpers.js
│   │   │   │   ├── index.js
│   │   │   │   ├── lifeCycle.js
│   │   │   │   ├── render-helpers/
│   │   │   │   │   ├── bindNativeClass.js
│   │   │   │   │   ├── bindNativeStyle.js
│   │   │   │   │   ├── bindWebClass.js
│   │   │   │   │   ├── bindWebStyle.js
│   │   │   │   │   ├── checkKeyCodes.js
│   │   │   │   │   ├── directive.js
│   │   │   │   │   ├── dynamicComponent.js
│   │   │   │   │   ├── event.js
│   │   │   │   │   ├── handleProps.js
│   │   │   │   │   ├── index.js
│   │   │   │   │   ├── mergeCssModule.js
│   │   │   │   │   ├── mergeNativeStyleAndNativeClass.js
│   │   │   │   │   ├── mergeProps.js
│   │   │   │   │   ├── renderList.js
│   │   │   │   │   ├── renderSlot.js
│   │   │   │   │   ├── resolveFilter.js
│   │   │   │   │   ├── template.js
│   │   │   │   │   ├── transitionGroupWeb.js
│   │   │   │   │   └── transitionWeb.js
│   │   │   │   └── render.js
│   │   │   └── scripts/
│   │   │       ├── compiler.js
│   │   │       ├── index.js
│   │   │       ├── transformerPlugin.js
│   │   │       └── util/
│   │   │           ├── addvm.js
│   │   │           ├── constants.js
│   │   │           ├── parseCss.js
│   │   │           └── parseTransform.js
│   │   └── web/
│   │       ├── compiler/
│   │       │   ├── directives/
│   │       │   │   ├── html.js
│   │       │   │   ├── index.js
│   │       │   │   ├── model.js
│   │       │   │   └── text.js
│   │       │   ├── index.js
│   │       │   ├── modules/
│   │       │   │   ├── class.js
│   │       │   │   ├── index.js
│   │       │   │   └── style.js
│   │       │   └── util.js
│   │       ├── compiler.js
│   │       ├── runtime/
│   │       │   ├── class-util.js
│   │       │   ├── components/
│   │       │   │   ├── index.js
│   │       │   │   ├── transition-group.js
│   │       │   │   └── transition.js
│   │       │   ├── directives/
│   │       │   │   ├── index.js
│   │       │   │   ├── model.js
│   │       │   │   └── show.js
│   │       │   ├── index.js
│   │       │   ├── modules/
│   │       │   │   ├── attrs.js
│   │       │   │   ├── class.js
│   │       │   │   ├── dom-props.js
│   │       │   │   ├── events.js
│   │       │   │   ├── index.js
│   │       │   │   ├── style.js
│   │       │   │   └── transition.js
│   │       │   ├── node-ops.js
│   │       │   ├── patch.js
│   │       │   └── transition-util.js
│   │       ├── runtime-with-compiler.js
│   │       ├── runtime.js
│   │       └── util/
│   │           ├── attrs.js
│   │           ├── class.js
│   │           ├── compat.js
│   │           ├── element.js
│   │           ├── index.js
│   │           └── style.js
│   ├── sfc/
│   │   └── parser.js
│   └── shared/
│       ├── constants.js
│       └── util.js
└── types/
    ├── index.d.ts
    ├── options.d.ts
    ├── plugin.d.ts
    ├── test/
    │   ├── augmentation-test.ts
    │   ├── options-test.ts
    │   ├── plugin-test.ts
    │   ├── tsconfig.json
    │   └── vue-test.ts
    ├── typings.json
    ├── vnode.d.ts
    └── vue.d.ts
Download .txt
SYMBOL INDEX (541 symbols across 138 files)

FILE: __tests__/unit/features/instance/init.spec.js
  function noop (line 4) | function noop () {}
  function createCompareFn (line 8) | function createCompareFn (spy) {

FILE: flow/modules.js
  class SourceMapGenerator (line 7) | class SourceMapGenerator {
  class SourceMapConsumer (line 12) | class SourceMapConsumer {
    method originalPositionFor (line 13) | originalPositionFor(position: { line: number; column: number; }): {

FILE: scripts/build.js
  function build (line 23) | function build(builds) {
  function buildEntry (line 40) | function buildEntry(config) {
  function write (line 68) | function write(dest, code, zip) {
  function getSize (line 94) | function getSize(code) {
  function logError (line 98) | function logError(e) {
  function blue (line 102) | function blue(str) {

FILE: scripts/config.js
  function genConfig (line 68) | function genConfig(opts) {

FILE: src/compiler/codegen/events.js
  function genHandlers (line 37) | function genHandlers(
  function genHandler (line 63) | function genHandler(

FILE: src/compiler/codegen/index.js
  function generate (line 26) | function generate(
  function genElement (line 53) | function genElement(el: ASTElement): string {
  function genStatic (line 90) | function genStatic(el: ASTElement): string {
  function genOnce (line 97) | function genOnce(el: ASTElement): string {
  function genIf (line 122) | function genIf(el: any): string {
  function genIfConditions (line 127) | function genIfConditions(conditions: ASTIfConditions): string {
  function genFor (line 147) | function genFor(el: any): string {
  function genData (line 177) | function genData(el: ASTElement): string {
  function genDirectives (line 250) | function genDirectives(el: ASTElement): string | void {
  function genScopedSlots (line 300) | function genScopedSlots(slots: { [key: string]: ASTElement }): string {
  function genScopedSlot (line 306) | function genScopedSlot(key: string, el: ASTElement) {

FILE: src/compiler/directives/bind.js
  function bind (line 3) | function bind(el: ASTElement, dir: ASTDirective) {

FILE: src/compiler/directives/model.js
  function genAssignmentCode (line 36) | function genAssignmentCode(value: string, assignment: string): string {
  function parseModel (line 66) | function parseModel(val: string): Object {
  function next (line 94) | function next(): number {
  function eof (line 98) | function eof(): boolean {
  function isStringStart (line 102) | function isStringStart(chr: number): boolean {
  function parseBracket (line 106) | function parseBracket(chr: number): void {
  function parseString (line 124) | function parseString(chr: number): void {

FILE: src/compiler/error-detector.js
  function checkNode (line 41) | function checkNode(node: ASTNode, errors: Array<string>) {
  function checkEvent (line 67) | function checkEvent(exp: string, text: string, errors: Array<string>) {
  function checkFor (line 79) | function checkFor(node: ASTElement, text: string, errors: Array<string>) {
  function checkIdentifier (line 86) | function checkIdentifier(
  function checkExpression (line 97) | function checkExpression(exp: string, text: string, errors: Array<string...

FILE: src/compiler/helpers.js
  function baseWarn (line 5) | function baseWarn(msg: string) {
  function addProp (line 16) | function addProp(el: ASTElement, name: string, value: string) {
  function addAttr (line 20) | function addAttr(el: ASTElement, name: string, value: string) {
  method if (line 51) | if (
  method parseFilters (line 104) | parseFilters(dynamicValue)
  method let (line 114) | let val

FILE: src/compiler/index.js
  function baseCompile (line 10) | function baseCompile(
  function makeFunction (line 24) | function makeFunction(code, errors) {
  function createCompiler (line 33) | function createCompiler(baseOptions: CompilerOptions) {

FILE: src/compiler/optimizer.js
  function genStaticKeys (line 31) | function genStaticKeys(keys: string): Function {
  function markStatic (line 38) | function markStatic(node: ASTNode) {
  function markStaticRoots (line 61) | function markStaticRoots(node: ASTNode, isInFor: boolean) {
  function walkThroughConditionsBlocks (line 90) | function walkThroughConditionsBlocks(
  function isStatic (line 99) | function isStatic(node: ASTNode): boolean {
  function isDirectChildOfTemplateFor (line 120) | function isDirectChildOfTemplateFor(node: ASTElement): boolean {

FILE: src/compiler/parser/entity-decoder.js
  function decode (line 5) | function decode(html: string): string {

FILE: src/compiler/parser/filter-parser.js
  function parseFilters (line 5) | function parseFilters(exp: string): string {
  function wrapFilter (line 108) | function wrapFilter(exp: string, filter: string): string {

FILE: src/compiler/parser/html-parser.js
  constant IS_REGEX_CAPTURING_BROKEN (line 48) | let IS_REGEX_CAPTURING_BROKEN = false
  function decodeAttr (line 67) | function decodeAttr(value, shouldDecodeNewlines) {
  function parseHTML (line 72) | function parseHTML(html, options) {

FILE: src/compiler/parser/index.js
  function parse (line 49) | function parse(
  function processPre (line 299) | function processPre(el) {
  function processRawAttrs (line 305) | function processRawAttrs(el) {
  function processKey (line 321) | function processKey(el) {
  function processRef (line 333) | function processRef(el) {
  function processFor (line 341) | function processFor(el) {
  function processIf (line 365) | function processIf(el) {
  function processIfConditions (line 384) | function processIfConditions(el, parent) {
  method if (line 402) | if (children[i].type === 1) {
  method warn (line 406) | warn(

FILE: src/core/components/keep-alive.js
  method if (line 14) | if (typeof pattern === 'string') {
  function pruneCache (line 23) | function pruneCache(cache: VNodeCache, current: VNode, filter: Function) {
  function pruneCacheEntry (line 38) | function pruneCacheEntry(vnode: ?VNode) {
  method created (line 53) | created() {
  method destroyed (line 57) | destroyed() {

FILE: src/core/global-api/assets.js
  method if (line 21) | if (!definition) {

FILE: src/core/global-api/extend.js
  function initExtend (line 7) | function initExtend(Vue: GlobalAPI) {
  function initProps (line 88) | function initProps(Comp) {
  function initComputed (line 95) | function initComputed(Comp) {

FILE: src/core/global-api/index.js
  function initGlobalAPI (line 20) | function initGlobalAPI(Vue: GlobalAPI) {

FILE: src/core/global-api/mixin.js
  function initMixin (line 5) | function initMixin(Vue: GlobalAPI) {

FILE: src/core/global-api/use.js
  function initUse (line 5) | function initUse(Vue: GlobalAPI) {

FILE: src/core/instance/events.js
  function initEvents (line 6) | function initEvents(vm: Component) {
  function add (line 27) | function add(event, fn, once) {
  function remove (line 35) | function remove(event, fn) {
  function on (line 72) | function on() {
  method for (line 93) | for (let i = 0, l = event.length; i < l; i++) {

FILE: src/core/instance/index.js
  function Vue (line 17) | function Vue(options) {

FILE: src/core/instance/init.js
  function initMixin (line 15) | function initMixin(Vue: Class<Component>) {
  function initInternalComponent (line 74) | function initInternalComponent(
  function resolveConstructorOptions (line 94) | function resolveConstructorOptions(Ctor: Class<Component>) {
  method if (line 123) | if (latest[key] !== sealed[key]) {

FILE: src/core/instance/inject.js
  function initProvide (line 7) | function initProvide(vm: Component) {
  function initInjections (line 14) | function initInjections(vm: Component) {

FILE: src/core/instance/lifecycle.js
  function initLifecycle (line 21) | function initLifecycle(vm: Component) {
  function lifecycleMixin (line 47) | function lifecycleMixin(Vue: Class<Component>) {
  function isInInactiveTree (line 264) | function isInInactiveTree(vm) {
  function activateChildComponent (line 271) | function activateChildComponent(vm: Component, direct?: boolean) {
  function deactivateChildComponent (line 289) | function deactivateChildComponent(vm: Component, direct?: boolean) {
  function callHook (line 305) | function callHook(vm: Component, hook: string) {

FILE: src/core/instance/proxy.js
  method set (line 31) | set(target, key, value) {
  method has (line 46) | has(target, key) {
  method get (line 57) | get(target, key) {

FILE: src/core/instance/render-helpers/bind-object-props.js
  function bindObjectProps (line 9) | function bindObjectProps(

FILE: src/core/instance/render-helpers/render-list.js
  method key (line 9) | key
  method isObject (line 20) | isObject(val)) {

FILE: src/core/instance/render-helpers/resolve-filter.js
  function resolveFilter (line 8) | function resolveFilter(id: string): Function {

FILE: src/core/instance/render-helpers/resolve-slots.js
  function isWhitespace (line 42) | function isWhitespace(node: VNode): boolean {
  function resolveScopedSlots (line 46) | function resolveScopedSlots(

FILE: src/core/instance/render.js
  function initRender (line 32) | function initRender(vm: Component) {
  function renderMixin (line 52) | function renderMixin(Vue: Class<Component>) {

FILE: src/core/instance/state.js
  function proxy (line 33) | function proxy(target: Object, sourceKey: string, key: string) {
  function initState (line 43) | function initState(vm: Component) {
  function initProps (line 63) | function initProps(vm: Component, propsOptions: Object) {
  function initData (line 110) | function initData(vm: Component) {
  function getData (line 142) | function getData(data: Function, vm: Component): any {
  function initComputed (line 153) | function initComputed(vm: Component, computed: Object) {
  function defineComputed (line 186) | function defineComputed(
  function createComputedGetter (line 205) | function createComputedGetter(key) {
  function initMethods (line 220) | function initMethods(vm: Component, methods: Object) {
  function initWatch (line 239) | function initWatch(vm: Component, watch: Object) {
  function createWatcher (line 252) | function createWatcher(vm: Component, key: string, handler: any) {
  function stateMixin (line 264) | function stateMixin(Vue: Class<Component>) {

FILE: src/core/observer/dep.js
  function pushTarget (line 51) | function pushTarget(_target: Watcher) {
  function popTarget (line 56) | function popTarget() {

FILE: src/core/observer/index.js
  method for (line 93) | for (let i = 0, l = keys.length; i < l; i++) {
  method if (line 105) | if (!isObject(value)) {

FILE: src/core/observer/scheduler.js
  constant MAX_UPDATE_COUNT (line 9) | const MAX_UPDATE_COUNT = 100

FILE: src/core/observer/watcher.js
  function traverse (line 238) | function traverse(val: any) {
  function _traverse (line 243) | function _traverse(val: any, seen: Set) {

FILE: src/core/util/env.js
  method get (line 31) | get() {
  function isNative (line 62) | function isNative(Ctor: any): boolean {
  function nextTickHandler (line 80) | function nextTickHandler() {
  method constructor (line 179) | constructor() {
  method has (line 182) | has(key: string | number) {
  method add (line 185) | add(key: string | number) {
  method clear (line 188) | clear() {

FILE: src/core/util/error.js
  function handleError (line 5) | function handleError(err, vm, info) {

FILE: src/core/util/lang.js
  function isReserved (line 8) | function isReserved(str: string): boolean {

FILE: src/core/util/options.js
  function mergeData (line 43) | function mergeData(to: Object, from: ?Object): Object {
  method for (line 228) | for (const key in props) {
  method mergeField (line 283) | mergeField(key)
  method mergeField (line 290) | mergeField(key) {

FILE: src/core/util/props.js
  function validateProp (line 20) | function validateProp(
  function getPropDefaultValue (line 59) | function getPropDefaultValue(
  function assertProp (line 100) | function assertProp(
  function isType (line 188) | function isType(type, fn) {

FILE: src/core/vdom/create-component.js
  method boolean (line 30) | boolean {
  method if (line 99) | if (isUndef(Ctor)) {
  method if (line 113) | if (process.env.NODE_ENV !== 'production') {

FILE: src/core/vdom/create-element.js
  constant SIMPLE_NORMALIZE (line 18) | const SIMPLE_NORMALIZE = 1
  constant ALWAYS_NORMALIZE (line 19) | const ALWAYS_NORMALIZE = 2
  function createElement (line 23) | function createElement(
  method if (line 49) | if (isDef(data) && isDef((data: any).__ob__)) {
  method for (line 118) | for (let i = 0, l = vnode.children.length; i < l; i++) {

FILE: src/core/vdom/create-functional-component.js
  method for (line 20) | for (const key in propOptions) {
  function mergeProps (line 49) | function mergeProps(to, from) {

FILE: src/core/vdom/helpers/extract-props.js
  method for (line 27) | for (const key in propOptions) {

FILE: src/core/vdom/helpers/merge-hook.js
  function mergeVNodeHook (line 6) | function mergeVNodeHook(def: Object, hookKey: string, hook: Function) {

FILE: src/core/vdom/helpers/normalize-children.js
  function simpleNormalizeChildren (line 18) | function simpleNormalizeChildren(children: any) {
  function normalizeArrayChildren (line 39) | function normalizeArrayChildren(

FILE: src/core/vdom/helpers/resolve-async-component.js
  function ensureCtor (line 5) | function ensureCtor(comp, base) {
  function resolveAsyncComponent (line 9) | function resolveAsyncComponent(

FILE: src/core/vdom/modules/directives.js
  function updateDirectives (line 15) | function updateDirectives(oldVnode: VNodeWithData, vnode: VNodeWithData) {
  function _update (line 21) | function _update(oldVnode, vnode) {
  function normalizeDirectives (line 94) | function normalizeDirectives(
  function getRawDirName (line 114) | function getRawDirName(dir: VNodeDirective): string {
  function callHook (line 120) | function callHook(dir, hook, vnode, oldVnode, isDestroy) {

FILE: src/core/vdom/patch.js
  function sameVnode (line 34) | function sameVnode(a, b) {
  function sameInputType (line 46) | function sameInputType(a, b) {
  function createKeyToOldIdx (line 54) | function createKeyToOldIdx(children, beginIdx, endIdx) {
  function createPatchFunction (line 64) | function createPatchFunction(backend) {

FILE: src/core/vdom/vnode.js
  function createTextVNode (line 66) | function createTextVNode(val: string | number) {
  function cloneVNode (line 74) | function cloneVNode(vnode: VNode): VNode {

FILE: src/platforms/vue-native/compiler/codegen/BaseGenerator.js
  class BaseGenerator (line 5) | class BaseGenerator {
    method constructor (line 6) | constructor(ast, options) {
    method setSlots (line 20) | setSlots(name) {
    method setVariableDependency (line 26) | setVariableDependency(variable) {
    method generate (line 32) | generate() {
    method generateImport (line 39) | generateImport() {
    method generateRender (line 43) | generateRender() {
    method genDependence (line 55) | genDependence() {

FILE: src/platforms/vue-native/compiler/codegen/NativeRenderGenerator.js
  class ReactNativeRenderGenerator (line 12) | class ReactNativeRenderGenerator extends RenderGenerator {
    method constructor (line 13) | constructor(ast, options) {
    method genTag (line 21) | genTag(ast) {
    method genTextExpression (line 42) | genTextExpression(ast) {
    method genText (line 53) | genText(ast) {
    method genProps (line 62) | genProps(ast) {
    method genTemplate (line 109) | genTemplate(ast) {
    method genEventHandler (line 122) | genEventHandler(ast) {
    method genNativeEventHandler (line 134) | genNativeEventHandler(ast) {
    method genNativeStyleProps (line 146) | genNativeStyleProps(ast) {
    method genStyleProps (line 159) | genStyleProps(ast) {
    method genClassProps (line 192) | genClassProps(ast) {
    method isAstTopParent (line 222) | isAstTopParent(ast) {

FILE: src/platforms/vue-native/compiler/codegen/RenderGenerator.js
  class RenderGenerator (line 15) | class RenderGenerator extends BaseGenerator {
    method genElement (line 16) | genElement(ast) {
    method genChildren (line 106) | genChildren(ast) {
    method genTextExpression (line 137) | genTextExpression(ast) {
    method genText (line 145) | genText(ast) {
    method genIf (line 154) | genIf(ast) {
    method genIfConditions (line 159) | genIfConditions(conditions) {
    method genFor (line 179) | genFor(ast) {
    method genSlot (line 199) | genSlot(ast) {
    method genTemplate (line 221) | genTemplate(ast) {
    method genChildrenKey (line 229) | genChildrenKey(ast) {
    method genTransition (line 243) | genTransition(ast) {
    method genTransitionGroup (line 251) | genTransitionGroup(ast) {
    method genProps (line 259) | genProps(ast) {
    method genDirectives (line 349) | genDirectives(ast) {
    method genDirectiveTag (line 368) | genDirectiveTag(ast) {
    method genDirectiveContext (line 375) | genDirectiveContext(ast) {
    method genSlotTarget (line 385) | genSlotTarget(ast) {
    method genKey (line 393) | genKey(ast) {
    method genKeyFor (line 401) | genKeyFor(ast) {
    method genRef (line 415) | genRef(ast) {
    method genIMEResolve (line 434) | genIMEResolve(ast) {
    method genTag (line 443) | genTag(ast) {
    method isWebInput (line 451) | isWebInput(ast) {

FILE: src/platforms/vue-native/compiler/codegen/WebRenderGenerator.js
  class ReactWebRenderGenerator (line 19) | class ReactWebRenderGenerator extends RenderGenerator {
    method genTag (line 23) | genTag(ast) {
    method genProps (line 45) | genProps(ast) {
    method genTemplate (line 74) | genTemplate(ast) {
    method genTransition (line 86) | genTransition(ast) {
    method genTransitionGroup (line 156) | genTransitionGroup(ast) {
    method _genTransitionGroup (line 164) | _genTransitionGroup(ast) {
    method genClassProps (line 216) | genClassProps(ast) {
    method genStyleProps (line 251) | genStyleProps(ast) {
    method genIMEResolve (line 290) | genIMEResolve(ast) {
    method genDirectives (line 300) | genDirectives(ast) {
    method genModelDirectives (line 314) | genModelDirectives(ast, directive) {
    method genHtmlDirectives (line 318) | genHtmlDirectives(ast) {
    method genTextDirectives (line 322) | genTextDirectives(ast) {
    method genEventHandler (line 326) | genEventHandler(ast) {
    method genNativeEventHandler (line 345) | genNativeEventHandler(ast) {
    method isAstTopParent (line 356) | isAstTopParent(ast) {

FILE: src/platforms/vue-native/compiler/config.js
  constant COMMON (line 8) | const COMMON = {
  constant WEB (line 88) | const WEB = {
  constant NATIVE (line 123) | const NATIVE = {

FILE: src/platforms/vue-native/compiler/constants.js
  constant TAB_INDENT (line 1) | const TAB_INDENT = '    '
  constant CREATE_ELEMENT (line 2) | const CREATE_ELEMENT = 'createElement'
  constant COMPONENT (line 3) | const COMPONENT = 'Component'
  constant HELPER_HEADER (line 4) | const HELPER_HEADER = '__react__vue__'
  constant HELPER_HEADER_NATIVE (line 5) | const HELPER_HEADER_NATIVE = '__react__vue__native__'
  constant RENDER_HELPER_MODULE_NAME (line 6) | const RENDER_HELPER_MODULE_NAME = 'vue-native-helper'

FILE: src/platforms/vue-native/compiler/directives/html.js
  function html (line 1) | function html(ast) {

FILE: src/platforms/vue-native/compiler/directives/model.js
  function genCheckboxModel (line 68) | function genCheckboxModel(
  function genRadioModel (line 105) | function genRadioModel(
  function genSelect (line 119) | function genSelect(el: ASTElement, value: string, modifiers: ?ASTModifie...
  function value (line 134) | function genDefaultModel(
  function genComponentModel (line 167) | function genComponentModel(

FILE: src/platforms/vue-native/compiler/directives/text.js
  function text (line 1) | function text(ast) {

FILE: src/platforms/vue-native/compiler/helpers.js
  function specialObserver (line 3) | function specialObserver(obj, cb) {
  function handleUnaryTag (line 21) | function handleUnaryTag(ast) {
  function filterDirective (line 40) | function filterDirective(ast) {
  function filterDirectiveBindProps (line 49) | function filterDirectiveBindProps(ast) {
  function transformSpecialNewlines (line 57) | function transformSpecialNewlines(text) {

FILE: src/platforms/vue-native/compiler/modules/events.js
  constant EVENT_ACTION (line 6) | const EVENT_ACTION = [
  function genHandlers (line 67) | function genHandlers(events, options) {
  function genCustomEventHandlers (line 101) | function genCustomEventHandlers(events, options) {
  function genTransitionEventHandlers (line 135) | function genTransitionEventHandlers(events) {
  function genHandler (line 150) | function genHandler(name, handler) {
  function genCustomHandler (line 199) | function genCustomHandler(name, handler) {
  function genTransitionEventHandler (line 245) | function genTransitionEventHandler(name, handler) {
  function genKeyFilter (line 267) | function genKeyFilter(keys) {
  function genFilterCode (line 273) | function genFilterCode(key) {

FILE: src/platforms/vue-native/compiler/modules/style.js
  function parseStyleText (line 3) | function parseStyleText(cssText) {

FILE: src/platforms/vue-native/compiler/native.js
  function nativeCompiler (line 7) | function nativeCompiler(template, options) {
  function traverse (line 51) | function traverse(ast, options, importObj, parent = null, childIndex) {

FILE: src/platforms/vue-native/compiler/parser/filter-parser.js
  function parseFilters (line 6) | function parseFilters(exp: string): string {
  function wrapFilter (line 109) | function wrapFilter(exp: string, filter: string): string {

FILE: src/platforms/vue-native/compiler/parser/text-parser.js
  function parseText (line 14) | function parseText(text, delimiters) {

FILE: src/platforms/vue-native/compiler/util/element.js
  function isUnknownElement (line 85) | function isUnknownElement(tag: string): boolean {

FILE: src/platforms/vue-native/compiler/web.js
  function compile (line 22) | function compile(template, options) {

FILE: src/platforms/vue-native/observer.js
  function observer (line 8) | function observer(componentClass) {
  function mixinLifecycleEvents (line 38) | function mixinLifecycleEvents(target) {
  method UNSAFE_componentWillMount (line 51) | UNSAFE_componentWillMount() {
  method componentWillUnmount (line 60) | componentWillUnmount() {
  method shouldComponentUpdate (line 63) | shouldComponentUpdate(nextProps, nextState) {
  function patch (line 71) | function patch(target, funcName) {
  function isObjectShallowModified (line 84) | function isObjectShallowModified(prev, next) {

FILE: src/platforms/vue-native/runtime/components/buildComponent.js
  function buildComponent (line 11) | function buildComponent(render, options, config) {

FILE: src/platforms/vue-native/runtime/components/buildDirective.js
  function triggerDirective (line 7) | function triggerDirective(newData, oldData, vm, ref) {
  function buildDirective (line 71) | function buildDirective(Component, createElement) {

FILE: src/platforms/vue-native/runtime/components/buildInputComponent.js
  function buildInputComponent (line 7) | function buildInputComponent(Component, createElement) {

FILE: src/platforms/vue-native/runtime/components/buildMixin.js
  function buildMixin (line 1) | function buildMixin(Component) {

FILE: src/platforms/vue-native/runtime/components/buildNativeComponent.js
  function buildNativeComponent (line 12) | function buildNativeComponent(render, options, config) {

FILE: src/platforms/vue-native/runtime/components/buildWebEmptyComponent.js
  function buildWebEmptyComponent (line 1) | function buildWebEmptyComponent(Component, createElement) {

FILE: src/platforms/vue-native/runtime/components/buildWebTransition.js
  function filterCollection (line 16) | function filterCollection(collection) {
  function getHookArgumentsLength (line 51) | function getHookArgumentsLength(fn) {
  function checkDuration (line 67) | function checkDuration(val, name) {
  function isValidDuration (line 81) | function isValidDuration(val) {
  function addTransitionClass (line 85) | function addTransitionClass(ref, className) {
  function removeTransitionClass (line 89) | function removeTransitionClass(ref, className) {
  function enter (line 122) | function enter({ el, cb }) {
  function leave (line 226) | function leave({ el, cb }) {
  function buildWebTransition (line 299) | function buildWebTransition(Component, createElement) {

FILE: src/platforms/vue-native/runtime/components/util.js
  function isObjectShallowModified (line 3) | function isObjectShallowModified(prev, next) {
  function hasOwn (line 33) | function hasOwn(obj, key) {
  function mergeCssModule (line 37) | function mergeCssModule(computed, cssModules) {
  function pascalCaseTag (line 48) | function pascalCaseTag(tag) {
  function handleComponents (line 60) | function handleComponents(components) {
  function handleDirectives (line 73) | function handleDirectives(directives) {
  function getSlots (line 85) | function getSlots(children) {
  function filterCustomEvent (line 116) | function filterCustomEvent(props) {

FILE: src/platforms/vue-native/runtime/directives/model.js
  function setSelected (line 4) | function setSelected(el, binding, vm) {
  function setCheckBox (line 40) | function setCheckBox(el, binding) {
  method bind (line 53) | bind(el, binding) {
  method update (line 65) | update(el, binding) {

FILE: src/platforms/vue-native/runtime/lifeCycle.js
  function lifeCycleMixin (line 5) | function lifeCycleMixin(Vue: Class<Component>) {

FILE: src/platforms/vue-native/runtime/render-helpers/bindNativeClass.js
  function classBinding (line 1) | function classBinding(c) {
  function bindNativeClass (line 19) | function bindNativeClass(obj) {

FILE: src/platforms/vue-native/runtime/render-helpers/bindNativeStyle.js
  function bindNativeStyle (line 1) | function bindNativeStyle(styleBinding, staticStyle, showStyle) {

FILE: src/platforms/vue-native/runtime/render-helpers/bindWebClass.js
  function bindWebClass (line 1) | function bindWebClass(c) {

FILE: src/platforms/vue-native/runtime/render-helpers/bindWebStyle.js
  function bindWebStyle (line 21) | function bindWebStyle(styleBinding, staticStyle, showStyle) {

FILE: src/platforms/vue-native/runtime/render-helpers/directive.js
  function triggerDirective (line 3) | function triggerDirective(newData, oldData, vm, ref) {
  function isObjectShallowModified (line 61) | function isObjectShallowModified(prev, next) {
  function directive (line 84) | function directive(Component, createElement) {

FILE: src/platforms/vue-native/runtime/render-helpers/dynamicComponent.js
  function dynamicComponent (line 3) | function dynamicComponent(vm, name) {

FILE: src/platforms/vue-native/runtime/render-helpers/event.js
  function event (line 1) | function event(fn) {

FILE: src/platforms/vue-native/runtime/render-helpers/handleProps.js
  function handleProps (line 5) | function handleProps(props, tag) {

FILE: src/platforms/vue-native/runtime/render-helpers/mergeCssModule.js
  function mergeCssModule (line 1) | function mergeCssModule(computed, cssModules) {

FILE: src/platforms/vue-native/runtime/render-helpers/mergeNativeStyleAndNativeClass.js
  function mergeNativeStyleAndNativeClass (line 1) | function mergeNativeStyleAndNativeClass(nativeClass, nativeStyle) {

FILE: src/platforms/vue-native/runtime/render-helpers/mergeProps.js
  function mergeProps (line 1) | function mergeProps() {

FILE: src/platforms/vue-native/runtime/render-helpers/renderSlot.js
  function renderSlot (line 3) | function renderSlot(names, children) {

FILE: src/platforms/vue-native/runtime/render-helpers/template.js
  function template (line 1) | function template(props) {

FILE: src/platforms/vue-native/runtime/render-helpers/transitionGroupWeb.js
  function transitionGroupWeb (line 3) | function transitionGroupWeb(Component, createElement) {

FILE: src/platforms/vue-native/runtime/render-helpers/transitionWeb.js
  function filterCollection (line 12) | function filterCollection(collection) {
  function getHookArgumentsLength (line 47) | function getHookArgumentsLength(fn) {
  function checkDuration (line 63) | function checkDuration(val, name) {
  function isValidDuration (line 77) | function isValidDuration(val) {
  function addTransitionClass (line 81) | function addTransitionClass(ref, className) {
  function removeTransitionClass (line 85) | function removeTransitionClass(ref, className) {
  function enter (line 89) | function enter({ el, cb }) {
  function leave (line 193) | function leave({ el, cb }) {
  function transitionWeb (line 266) | function transitionWeb(Component, createElement) {

FILE: src/platforms/vue-native/runtime/render.js
  function renderMixin (line 5) | function renderMixin(Vue: Class<Component>) {

FILE: src/platforms/vue-native/scripts/compiler.js
  constant DEFAULT_OUTPUT (line 17) | const DEFAULT_OUTPUT = {
  function compileVueToRn (line 25) | function compileVueToRn(resource, filename = 'sfc.vue') {
  function parseTemplate (line 238) | function parseTemplate(code) {
  function generateSourceMap (line 246) | function generateSourceMap(content, filePath) {
  function parseScript (line 255) | function parseScript(code) {
  function traverse (line 263) | function traverse(ast, nodes = []) {
  function getFirstLineWithText (line 274) | function getFirstLineWithText(content, text) {
  function getFirstLineWithoutText (line 282) | function getFirstLineWithoutText(content, text) {
  function getFirstValidLine (line 290) | function getFirstValidLine(content) {

FILE: src/platforms/vue-native/scripts/transformerPlugin.js
  method transform (line 26) | transform({ src, filename, options }) {
  function sourceMapAstInPlace (line 32) | function sourceMapAstInPlace(sourceMap, babelAst) {
  function transform (line 52) | function transform({ src, filename, options }) {

FILE: src/platforms/vue-native/scripts/util/addvm.js
  function addvm (line 16) | function addvm(code) {

FILE: src/platforms/vue-native/scripts/util/constants.js
  constant HELPER_HEADER (line 1) | const HELPER_HEADER = '__react__vue__'
  constant SCRIPT_OPTIONS (line 2) | const SCRIPT_OPTIONS = `${HELPER_HEADER}options`
  constant TEMPLATE_RENDER (line 3) | const TEMPLATE_RENDER = `${HELPER_HEADER}render`
  constant REACT_NATIVE (line 4) | const REACT_NATIVE = `${HELPER_HEADER}ReactNative`
  constant BUILD_COMPONENT (line 5) | const BUILD_COMPONENT = `${HELPER_HEADER}buildNativeComponent`
  constant COMPONENT_BUILDED (line 6) | const COMPONENT_BUILDED = `${HELPER_HEADER}ComponentBuilded`
  constant VUE (line 7) | const VUE = `${HELPER_HEADER}Vue`
  constant REACT (line 8) | const REACT = `${HELPER_HEADER}React`
  constant COMPONENT (line 9) | const COMPONENT = `${HELPER_HEADER}Component`
  constant PROP_TYPE (line 10) | const PROP_TYPE = `${HELPER_HEADER}PropType`
  constant OBSERVER (line 11) | const OBSERVER = `${HELPER_HEADER}observer`
  constant CSS (line 12) | const CSS = `${HELPER_HEADER}css`

FILE: src/platforms/vue-native/scripts/util/parseCss.js
  function camelize (line 5) | function camelize(str) {
  function parseDeclarations (line 9) | function parseDeclarations(declarations) {
  function parseCss (line 36) | function parseCss(ast) {

FILE: src/platforms/vue-native/scripts/util/parseTransform.js
  constant TRANSFORM_TRANSLATE_REGEX (line 1) | const TRANSFORM_TRANSLATE_REGEX = /translate\(([-+]?[\d]*\.?[\d]+)(px)?,...
  constant TRANSFORM_TRANSLATE_X_REGEX (line 2) | const TRANSFORM_TRANSLATE_X_REGEX = /translateX\(([-+]?[\d]*\.?[\d]+)(px...
  constant TRANSFORM_TRANSLATE_Y_REGEX (line 3) | const TRANSFORM_TRANSLATE_Y_REGEX = /translateY\(([-+]?[\d]*\.?[\d]+)(px...
  constant TRANSFORM_ROTATE_REGEX (line 4) | const TRANSFORM_ROTATE_REGEX = /rotate\(([-+]?[\d]*\.?[\d]+)deg\)/
  constant TRANSFORM_ROTATE_X_REGEX (line 5) | const TRANSFORM_ROTATE_X_REGEX = /rotateX\(([-+]?[\d]*\.?[\d]+)deg\)/
  constant TRANSFORM_ROTATE_Y_REGEX (line 6) | const TRANSFORM_ROTATE_Y_REGEX = /rotateY\(([-+]?[\d]*\.?[\d]+)deg\)/
  constant TRANSFORM_ROTATE_Z_REGEX (line 7) | const TRANSFORM_ROTATE_Z_REGEX = /rotateZ\(([-+]?[\d]*\.?[\d]+)deg\)/
  constant TRANSFORM_SCALE_REGEX (line 8) | const TRANSFORM_SCALE_REGEX = /scale\(([-+]?[\d]*\.?[\d]+)\)/
  constant TRANSFORM_SCALE_X_REGEX (line 9) | const TRANSFORM_SCALE_X_REGEX = /scaleX\(([-+]?[\d]*\.?[\d]+)\)/
  constant TRANSFORM_SCALE_Y_REGEX (line 10) | const TRANSFORM_SCALE_Y_REGEX = /scaleY\(([-+]?[\d]*\.?[\d]+)\)/
  constant TRANSFORM_SKEW_X_REGEX (line 11) | const TRANSFORM_SKEW_X_REGEX = /skewX\(([-+]?[\d]*\.?[\d]+)deg\)/
  constant TRANSFORM_SKEW_Y_REGEX (line 12) | const TRANSFORM_SKEW_Y_REGEX = /skewY\(([-+]?[\d]*\.?[\d]+)deg\)/
  function parseTransform (line 14) | function parseTransform(value) {

FILE: src/platforms/web/compiler/directives/html.js
  function html (line 5) | function html(el: ASTElement, dir: ASTDirective) {

FILE: src/platforms/web/compiler/directives/model.js
  constant RANGE_TOKEN (line 11) | const RANGE_TOKEN = '__r'
  constant CHECKBOX_RADIO_TOKEN (line 12) | const CHECKBOX_RADIO_TOKEN = '__c'
  function genCheckboxModel (line 68) | function genCheckboxModel(
  function genRadioModel (line 103) | function genRadioModel(
  function genSelect (line 121) | function genSelect(el: ASTElement, value: string, modifiers: ?ASTModifie...

FILE: src/platforms/web/compiler/directives/text.js
  function text (line 5) | function text(el: ASTElement, dir: ASTDirective) {

FILE: src/platforms/web/compiler/modules/class.js
  function transformNode (line 6) | function transformNode(el: ASTElement, options: CompilerOptions) {
  function genData (line 29) | function genData(el: ASTElement): string {

FILE: src/platforms/web/compiler/modules/style.js
  function transformNode (line 7) | function transformNode(el: ASTElement, options: CompilerOptions) {
  function genData (line 32) | function genData(el: ASTElement): string {

FILE: src/platforms/web/runtime-with-compiler.js
  method if (line 38) | if (typeof template === 'string') {
  method if (line 52) | if (process.env.NODE_ENV !== 'production') {
  method if (line 62) | if (process.env.NODE_ENV !== 'production' && config.performance && mark) {

FILE: src/platforms/web/runtime/components/transition-group.js
  method if (line 50) | if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  method if (line 135) | if (!hasTransition) {

FILE: src/platforms/web/runtime/components/transition.js
  function componentOptions (line 30) | function getRealChild(vnode: ?VNode): ?VNode {
  function isSameChild (line 71) | function isSameChild(child: VNode, oldChild: VNode): boolean {

FILE: src/platforms/web/runtime/directives/model.js
  method inserted (line 21) | inserted(el, binding, vnode) {
  method componentUpdated (line 54) | componentUpdated(el, binding, vnode) {
  function setSelected (line 72) | function setSelected(el, binding, vm) {
  function hasNoMatchingOption (line 108) | function hasNoMatchingOption(value, options) {
  function getValue (line 117) | function getValue(option) {
  function onCompositionStart (line 121) | function onCompositionStart(e) {
  function onCompositionEnd (line 125) | function onCompositionEnd(e) {
  function trigger (line 130) | function trigger(el, type) {

FILE: src/platforms/web/runtime/directives/show.js
  function locateNode (line 7) | function locateNode(vnode: VNode): VNodeWithData {

FILE: src/platforms/web/runtime/modules/attrs.js
  function updateAttrs (line 16) | function updateAttrs(oldVnode: VNodeWithData, vnode: VNodeWithData) {
  function setAttr (line 52) | function setAttr(el: Element, key: string, value: any) {

FILE: src/platforms/web/runtime/modules/class.js
  function updateClass (line 7) | function updateClass(oldVnode: any, vnode: any) {

FILE: src/platforms/web/runtime/modules/dom-props.js
  function updateDOMProps (line 5) | function updateDOMProps(oldVnode: VNodeWithData, vnode: VNodeWithData) {
  function shouldUpdateValue (line 51) | function shouldUpdateValue(
  function isDirty (line 64) | function isDirty(elm: acceptValueElm, checkVal: string): boolean {
  function isInputChanged (line 69) | function isInputChanged(elm: any, newVal: string): boolean {

FILE: src/platforms/web/runtime/modules/events.js
  function normalizeEvents (line 15) | function normalizeEvents(on) {
  function add (line 34) | function add(
  function remove (line 61) | function remove(
  function updateDOMListeners (line 70) | function updateDOMListeners(oldVnode: VNodeWithData, vnode: VNodeWithDat...

FILE: src/platforms/web/runtime/modules/style.js
  function updateStyle (line 47) | function updateStyle(oldVnode: VNodeWithData, vnode: VNodeWithData) {

FILE: src/platforms/web/runtime/modules/transition.js
  function leave (line 161) | function leave(vnode: VNodeWithData, rm: Function) {
  function checkDuration (line 266) | function checkDuration(val, name, vnode) {
  function isValidDuration (line 282) | function isValidDuration(val) {
  function getHookArgumentsLength (line 292) | function getHookArgumentsLength(fn: Function): boolean {
  function _enter (line 307) | function _enter(_: any, vnode: VNodeWithData) {
  method if (line 319) | if (vnode.data.show !== true) {

FILE: src/platforms/web/runtime/node-ops.js
  function createElement (line 5) | function createElement(tagName: string, vnode: VNode): Element {
  function createElementNS (line 21) | function createElementNS(namespace: string, tagName: string): Element {
  function createTextNode (line 25) | function createTextNode(text: string): Text {
  function createComment (line 29) | function createComment(text: string): Comment {
  function insertBefore (line 33) | function insertBefore(
  function removeChild (line 41) | function removeChild(node: Node, child: Node) {
  function appendChild (line 45) | function appendChild(node: Node, child: Node) {
  function tagName (line 57) | function tagName(node: Element): string {
  function setTextContent (line 61) | function setTextContent(node: Node, text: string) {
  function setAttribute (line 65) | function setAttribute(node: Element, key: string, val: string) {

FILE: src/platforms/web/runtime/transition-util.js
  method if (line 8) | if (!def) {
  method if (line 46) | if (
  method while (line 190) | while (delays.length < durations.length) {

FILE: src/platforms/web/util/class.js
  function genClassForVnode (line 5) | function genClassForVnode(vnode: VNode): string {
  function mergeClassData (line 23) | function mergeClassData(
  function genClassFromData (line 36) | function genClassFromData(data: Object): string {
  function stringifyClass (line 50) | function stringifyClass(value: any): string {

FILE: src/platforms/web/util/compat.js
  function shouldDecode (line 6) | function shouldDecode(content: string, encoded: string): boolean {

FILE: src/platforms/web/util/element.js
  function isUnknownElement (line 52) | function isUnknownElement(tag: string): boolean {

FILE: src/platforms/web/util/index.js
  method if (line 13) | if (typeof el === 'string') {

FILE: src/platforms/web/util/style.js
  function getStyle (line 41) | function getStyle(vnode: VNode, checkChild: boolean): Object {

FILE: src/sfc/parser.js
  function parseComponent (line 19) | function parseComponent(

FILE: src/shared/constants.js
  constant SSR_ATTR (line 1) | const SSR_ATTR = 'data-server-rendered'
  constant ASSET_TYPES (line 35) | const ASSET_TYPES = ['component', 'directive', 'filter']
  constant LIFECYCLE_HOOKS (line 37) | const LIFECYCLE_HOOKS = [

FILE: src/shared/util.js
  function isUndef (line 5) | function isUndef(v: any): boolean {
  function isDef (line 9) | function isDef(v: any): boolean {
  function isTrue (line 13) | function isTrue(v: any): boolean {
  function isPrimitive (line 20) | function isPrimitive(value: any): boolean {
  function isObject (line 29) | function isObject(obj: mixed): boolean {
  constant OBJECT_STRING (line 38) | const OBJECT_STRING = '[object Object]'
  function isPlainObject (line 39) | function isPlainObject(obj: any): boolean {
  function _toString (line 46) | function _toString(val: any): string {
  method if (line 88) | if (arr.length) {
  method for (line 175) | for (const key in _from) {
  method if (line 187) | if (arr[i]) {

FILE: types/index.d.ts
  type CreateElement (line 9) | type CreateElement = V.CreateElement;
  type Component (line 11) | type Component = Options.Component;
  type AsyncComponent (line 12) | type AsyncComponent = Options.AsyncComponent;
  type ComponentOptions (line 13) | type ComponentOptions<V extends Vue> = Options.ComponentOptions<V>;
  type FunctionalComponentOptions (line 14) | type FunctionalComponentOptions = Options.FunctionalComponentOptions;
  type RenderContext (line 15) | type RenderContext = Options.RenderContext;
  type PropOptions (line 16) | type PropOptions = Options.PropOptions;
  type ComputedOptions (line 17) | type ComputedOptions<V extends Vue> = Options.ComputedOptions<V>;
  type WatchHandler (line 18) | type WatchHandler<V extends Vue> = Options.WatchHandler<V, any>;
  type WatchOptions (line 19) | type WatchOptions = Options.WatchOptions;
  type DirectiveFunction (line 20) | type DirectiveFunction = Options.DirectiveFunction;
  type DirectiveOptions (line 21) | type DirectiveOptions = Options.DirectiveOptions;
  type PluginFunction (line 23) | type PluginFunction<T> = Plugin.PluginFunction<T>;
  type PluginObject (line 24) | type PluginObject<T> = Plugin.PluginObject<T>;
  type VNodeChildren (line 26) | type VNodeChildren = VNode.VNodeChildren;
  type VNodeChildrenArrayContents (line 27) | type VNodeChildrenArrayContents = VNode.VNodeChildrenArrayContents;
  type VNode (line 28) | type VNode = VNode.VNode;
  type VNodeComponentOptions (line 29) | type VNodeComponentOptions = VNode.VNodeComponentOptions;
  type VNodeData (line 30) | type VNodeData = VNode.VNodeData;
  type VNodeDirective (line 31) | type VNodeDirective = VNode.VNodeDirective;
  class Vue (line 35) | class Vue extends V.Vue {}

FILE: types/options.d.ts
  type Constructor (line 4) | type Constructor = {
  type Component (line 8) | type Component = typeof Vue | ComponentOptions<Vue> | FunctionalComponen...
  type AsyncComponent (line 9) | type AsyncComponent = (
  type ComponentOptions (line 14) | interface ComponentOptions<V extends Vue> {
  type FunctionalComponentOptions (line 59) | interface FunctionalComponentOptions {
  type RenderContext (line 66) | interface RenderContext {
  type PropOptions (line 75) | interface PropOptions {
  type ComputedOptions (line 82) | interface ComputedOptions<V> {
  type WatchHandler (line 88) | type WatchHandler<V, T> = (this: V, val: T, oldVal: T) => void;
  type WatchOptions (line 90) | interface WatchOptions {
  type DirectiveFunction (line 95) | type DirectiveFunction = (
  type DirectiveOptions (line 102) | interface DirectiveOptions {

FILE: types/plugin.d.ts
  type PluginFunction (line 3) | type PluginFunction<T> = (Vue: typeof _Vue, options?: T) => void;
  type PluginObject (line 5) | interface PluginObject<T> {

FILE: types/test/augmentation-test.ts
  type Vue (line 5) | interface Vue {
  type ComponentOptions (line 19) | interface ComponentOptions<V extends Vue> {

FILE: types/test/options-test.ts
  type Component (line 4) | interface Component extends Vue {
  method data (line 9) | data() {
  method validator (line 22) | validator(value) {
  method aDouble (line 31) | aDouble(this: Component) {
  method get (line 35) | get(this: Component) {
  method set (line 38) | set(this: Component, v: number) {
  method plus (line 45) | plus() {
  method handler (line 55) | handler(val, oldVal) {
  method render (line 63) | render(createElement) {
  method beforeCreate (line 116) | beforeCreate() {
  method created (line 119) | created() {}
  method beforeDestroy (line 120) | beforeDestroy() {}
  method destroyed (line 121) | destroyed() {}
  method beforeMount (line 122) | beforeMount() {}
  method mounted (line 123) | mounted() {}
  method beforeUpdate (line 124) | beforeUpdate() {}
  method updated (line 125) | updated() {}
  method activated (line 126) | activated() {}
  method deactivated (line 127) | deactivated() {}
  method bind (line 131) | bind() {}
  method inserted (line 132) | inserted() {}
  method update (line 133) | update() {}
  method componentMounted (line 134) | componentMounted() {}
  method unbind (line 135) | unbind() {}
  method b (line 137) | b(el, binding, vnode, oldVnode) {
  method double (line 154) | double(value: number) {
  method render (line 166) | render (h) {
  method render (line 186) | render (h) {
  method render (line 199) | render(createElement, context) {

FILE: types/test/plugin-test.ts
  class Option (line 4) | class Option {
  method install (line 10) | install(Vue, option) {

FILE: types/test/vue-test.ts
  class Test (line 3) | class Test extends Vue {
    method testProperties (line 6) | testProperties() {
    method testReification (line 25) | testReification() {
    method testMethods (line 32) | testMethods() {
    method testConfig (line 54) | static testConfig() {
    method testMethods (line 68) | static testMethods() {

FILE: types/vnode.d.ts
  type ScopedSlot (line 3) | type ScopedSlot = (props: any) => VNodeChildrenArrayContents | string;
  type VNodeChildren (line 5) | type VNodeChildren = VNodeChildrenArrayContents | [ScopedSlot] | string;
  type VNodeChildrenArrayContents (line 6) | interface VNodeChildrenArrayContents {
  type VNode (line 10) | interface VNode {
  type VNodeComponentOptions (line 28) | interface VNodeComponentOptions {
  type VNodeData (line 36) | interface VNodeData {
  type VNodeDirective (line 62) | interface VNodeDirective {

FILE: types/vue.d.ts
  type CreateElement (line 14) | type CreateElement = {
  class Vue (line 31) | class Vue {
Condensed preview — 237 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (573K chars).
[
  {
    "path": ".babelrc",
    "chars": 212,
    "preview": "{\n  \"env\": {\n    \"test\": {\n      \"presets\": [\n        [\"@babel/preset-env\", {\n          \"targets\": {\"node\": \"current\"},\n"
  },
  {
    "path": ".eslintignore",
    "chars": 19,
    "preview": "flow\ndist\npackages\n"
  },
  {
    "path": ".eslintrc",
    "chars": 608,
    "preview": "{\n  \"root\": true,\n  \"parserOptions\": {\n    \"parser\": \"babel-eslint\",\n    \"ecmaVersion\": 2018,\n    \"sourceType\": \"module\""
  },
  {
    "path": ".flowconfig",
    "chars": 877,
    "preview": "[ignore]\n.*/__tests__/.*\n.*/node_modules/.*\n.*/examples/.*\n.*/packages/.*\n.*/scripts/.*\n\n[include]\n\n[libs]\nflow\n\n[option"
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 403,
    "preview": "# These are supported funding model platforms\n\ngithub: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [u"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/---bug-report.md",
    "chars": 991,
    "preview": "---\nname: \"\\U0001F41E Bug report\"\nabout: Spotted a bug in Vue Native?\ntitle: ''\nlabels: ''\n\n---\n\n**Description of the bu"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/---issue-with-the-documentation-or-website.md",
    "chars": 492,
    "preview": "---\nname: \"\\U0001F4D6 Issue with the documentation or website\"\nabout: Spotted something incorrect or outdated in the doc"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/---issue-with-vue-native-router.md",
    "chars": 422,
    "preview": "---\nname: \"\\U0001F9ED Issue with Vue Native Router\"\nabout: Having trouble with Vue Native Router?\ntitle: ''\nlabels: ''\n\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/---questions-or-help-with-usage.md",
    "chars": 390,
    "preview": "---\nname: \"\\U0001F9D0 Questions or help with usage\"\nabout: Need help with code or Vue Native usage?\ntitle: 'Question: '\n"
  },
  {
    "path": ".gitignore",
    "chars": 180,
    "preview": ".DS_Store\n.vscode\n.idea\n\nnode_modules\n\n*.log\n\ndist/*.gz\ndist/*.map\ndist/vue.common.min.js\n\ncoverage\n\npackages/**/build.j"
  },
  {
    "path": ".prettierrc",
    "chars": 89,
    "preview": "{\n  \"parser\": \"babel\",\n  \"semi\": false,\n  \"trailingComma\": \"all\",\n  \"singleQuote\": true\n}"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 421,
    "preview": "# Changelog\nAll notable changes to this project will be documented in this file.\n\n## [ 0.0.1 ] - 2018-08-01\n### :zap: Im"
  },
  {
    "path": "COMPONENT.md",
    "chars": 7331,
    "preview": "# Vue Component API\n> Vue component actually runs in the React runtime. It means, you can not access [VNode](https://vue"
  },
  {
    "path": "LICENSE",
    "chars": 1091,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2013-present, Yuxi (Evan) You\n\nPermission is hereby granted, free of charge, to any"
  },
  {
    "path": "README.md",
    "chars": 5448,
    "preview": "## ⚠️ This project has been deprecated and is no longer maintained ⚠️\n\n# Vue Native\n\n[![No Maintenance Intended](https:/"
  },
  {
    "path": "__tests__/unit/features/instance/init.spec.js",
    "chars": 1805,
    "preview": "import Vue from 'vue-native/index'\n\ndescribe('Initialization', () => {\n  function noop () {}\n\n  let asserted\n\n  function"
  },
  {
    "path": "converting-react-native-project.md",
    "chars": 3302,
    "preview": "## Setting up a React Native project for Vue Native\n\n[Vue Native CLI](https://github.com/GeekyAnts/vue-native-cli) is th"
  },
  {
    "path": "flow/compiler.js",
    "chars": 4731,
    "preview": "declare type CompilerOptions = {\n  warn?: Function; // allow customizing warning in different environments; e.g. node\n  "
  },
  {
    "path": "flow/component.js",
    "chars": 4143,
    "preview": "import type { Config } from '../src/core/config'\nimport type VNode from '../src/core/vdom/vnode'\nimport type Watcher fro"
  },
  {
    "path": "flow/global-api.js",
    "chars": 791,
    "preview": "declare interface GlobalAPI {\n  cid: number;\n  options: Object;\n  config: Config;\n  util: Object;\n\n  extend: (options: O"
  },
  {
    "path": "flow/modules.js",
    "chars": 1022,
    "preview": "declare module 'he' {\n  declare function escape(html: string): string;\n  declare function decode(html: string): string;\n"
  },
  {
    "path": "flow/options.js",
    "chars": 2128,
    "preview": "declare type InternalComponentOptions = {\n  _isComponent: true;\n  parent: Component;\n  propsData: ?Object;\n  _parentVnod"
  },
  {
    "path": "flow/ssr.js",
    "chars": 446,
    "preview": "declare type ComponentWithCacheContext = {\n  type: 'ComponentWithCache';\n  bufferIndex: number;\n  buffer: Array<string>;"
  },
  {
    "path": "flow/vnode.js",
    "chars": 1728,
    "preview": "declare type VNodeChildren = Array<?VNode | string | VNodeChildren> | string\n\ndeclare type VNodeComponentOptions = {\n  C"
  },
  {
    "path": "jest.config.json",
    "chars": 746,
    "preview": "{\n  \"verbose\": true,\n  \"testMatch\": [\n    \"<rootDir>/**/__tests__/**/*.(test|spec).js\"\n  ],\n  \"moduleDirectories\": [\n   "
  },
  {
    "path": "jsconfig.json",
    "chars": 414,
    "preview": "{\n  \"compilerOptions\": {\n    \"moduleResolution\": \"node\",\n    \"baseUrl\": \"src\",\n    \"paths\": {\n      \"vue/*\": [\"platforms"
  },
  {
    "path": "package.json",
    "chars": 2579,
    "preview": "{\n  \"name\": \"vue-native-core\",\n  \"version\": \"0.3.1\",\n  \"description\": \"Create mobile apps using vuejs\",\n  \"main\": \"packa"
  },
  {
    "path": "packages/vue-native-core/README.md",
    "chars": 403,
    "preview": "# vue-native-core\n\n> This package is auto-generated. For pull requests please work with [src/platforms/vue-native/index."
  },
  {
    "path": "packages/vue-native-core/index.js",
    "chars": 35,
    "preview": "module.exports = require('./build')"
  },
  {
    "path": "packages/vue-native-core/package.json",
    "chars": 612,
    "preview": "{\n  \"name\": \"vue-native-core\",\n  \"version\": \"0.3.1\",\n  \"description\": \"Library with core functionalities to create Vue N"
  },
  {
    "path": "packages/vue-native-helper/README.md",
    "chars": 423,
    "preview": "# vue-native-helper\n\n> This package is auto-generated. For pull requests please work with [src/platforms/vue-native/runt"
  },
  {
    "path": "packages/vue-native-helper/index.js",
    "chars": 35,
    "preview": "module.exports = require('./build')"
  },
  {
    "path": "packages/vue-native-helper/package.json",
    "chars": 582,
    "preview": "{\n  \"name\": \"vue-native-helper\",\n  \"version\": \"0.3.1\",\n  \"description\": \"Helper library with utilities for vue-native-co"
  },
  {
    "path": "packages/vue-native-scripts/.npmignore",
    "chars": 72,
    "preview": "node_modules\nnpm-debug.log\ntest/output\ndocs/_book\n.DS_Store\n.idea\n*.iml\n"
  },
  {
    "path": "packages/vue-native-scripts/README.md",
    "chars": 4007,
    "preview": "# vue-native-scripts\n\n> This package is auto-generated. For pull requests please work with [src/platforms/vue-native/scr"
  },
  {
    "path": "packages/vue-native-scripts/bin/vue-native-script.js",
    "chars": 520,
    "preview": "#!/usr/bin/env node\n\nconst spawn = require('cross-spawn');\nconst script = process.argv[2];\nconst args = process.argv.sli"
  },
  {
    "path": "packages/vue-native-scripts/index.js",
    "chars": 38,
    "preview": "module.exports = require('./build.js')"
  },
  {
    "path": "packages/vue-native-scripts/package.json",
    "chars": 1064,
    "preview": "{\n  \"name\": \"vue-native-scripts\",\n  \"version\": \"0.3.1\",\n  \"description\": \"Compile Vue Native components to React Native\""
  },
  {
    "path": "packages/vue-native-template-compiler/README.md",
    "chars": 425,
    "preview": "# vue-native-template-compiler\n\n> This package is auto-generated. For pull requests please work with [src/platforms/vue-"
  },
  {
    "path": "packages/vue-native-template-compiler/index.js",
    "chars": 35,
    "preview": "module.exports = require('./build')"
  },
  {
    "path": "packages/vue-native-template-compiler/package.json",
    "chars": 762,
    "preview": "{\n  \"name\": \"vue-native-template-compiler\",\n  \"version\": \"0.3.1\",\n  \"description\": \"Vue Native template compiler, depend"
  },
  {
    "path": "scripts/.eslintrc",
    "chars": 76,
    "preview": "\n{\n  \"env\": {\n    \"es6\": true,\n  },\n  \"rules\": {\n    \"camelcase\": 0,\n  },\n}\n"
  },
  {
    "path": "scripts/alias.js",
    "chars": 459,
    "preview": "const path = require('path')\n\nmodule.exports = {\n  vue: path.resolve(__dirname, '../src/platforms/web/runtime-with-compi"
  },
  {
    "path": "scripts/build.js",
    "chars": 2216,
    "preview": "const fs = require('fs')\nconst path = require('path')\nconst zlib = require('zlib')\nconst rollup = require('rollup')\ncons"
  },
  {
    "path": "scripts/ci.sh",
    "chars": 148,
    "preview": "set -e\nnpm test\n\n# report coverage stats for non-PRs\nif [[ -z $CI_PULL_REQUEST ]]; then\n  cat ./coverage/lcov.info | ./n"
  },
  {
    "path": "scripts/config.js",
    "chars": 2747,
    "preview": "const path = require('path')\nconst buble = require('rollup-plugin-buble')\nconst alias = require('rollup-plugin-alias')\nc"
  },
  {
    "path": "scripts/git-hooks/pre-commit",
    "chars": 190,
    "preview": "#!/usr/bin/env bash\n\nfiles_to_lint=$(git diff --cached --name-only --diff-filter=ACM | grep '\\.js$')\n\nif [ -n \"$files_to"
  },
  {
    "path": "scripts/release.sh",
    "chars": 2203,
    "preview": "set -e\n\nCURRENT_BRANCH=$(git branch --show-current)\nif [ $CURRENT_BRANCH != \"master\" ]; then\n  echo \"This script can onl"
  },
  {
    "path": "src/compiler/codegen/events.js",
    "chars": 3597,
    "preview": "/* @flow */\n\nconst fnExpRE = /^\\s*([\\w$_]+|\\([^)]*?\\))\\s*=>|^function\\s*\\(/\nconst simplePathRE = /^\\s*[A-Za-z_$][\\w$]*(?"
  },
  {
    "path": "src/compiler/codegen/index.js",
    "chars": 11557,
    "preview": "/* @flow */\n\nimport { genHandlers } from './events'\nimport { baseWarn, pluckModuleFunction } from '../helpers'\nimport ba"
  },
  {
    "path": "src/compiler/directives/bind.js",
    "chars": 236,
    "preview": "/* @flow */\n\nexport default function bind(el: ASTElement, dir: ASTDirective) {\n  el.wrapData = (code: string) => {\n    r"
  },
  {
    "path": "src/compiler/directives/index.js",
    "chars": 117,
    "preview": "/* @flow */\n\nimport bind from './bind'\nimport { noop } from 'shared/util'\n\nexport default {\n  bind,\n  cloak: noop,\n}\n"
  },
  {
    "path": "src/compiler/directives/model.js",
    "chars": 2851,
    "preview": "/* @flow */\n\n/**\n * Cross-platform code generation for component v-model\n */\nexport function genComponentModel(\n  el: AS"
  },
  {
    "path": "src/compiler/error-detector.js",
    "chars": 3418,
    "preview": "/* @flow */\n\nimport { dirRE, onRE } from './parser/index'\n\n// these keywords should not appear inside expressions, but o"
  },
  {
    "path": "src/compiler/helpers.js",
    "chars": 3063,
    "preview": "/* @flow */\n\nimport { parseFilters } from './parser/filter-parser'\n\nexport function baseWarn(msg: string) {\n  console.er"
  },
  {
    "path": "src/compiler/index.js",
    "chars": 4550,
    "preview": "/* @flow */\n\nimport { parse } from './parser/index'\nimport { optimize } from './optimizer'\nimport { generate } from './c"
  },
  {
    "path": "src/compiler/optimizer.js",
    "chars": 3544,
    "preview": "/* @flow */\n\nimport { makeMap, isBuiltInTag, cached, no } from 'shared/util'\n\nlet isStaticKey\nlet isPlatformReservedTag\n"
  },
  {
    "path": "src/compiler/parser/entity-decoder.js",
    "chars": 184,
    "preview": "/* @flow */\n\nlet decoder\n\nexport function decode(html: string): string {\n  decoder = decoder || document.createElement('"
  },
  {
    "path": "src/compiler/parser/filter-parser.js",
    "chars": 2753,
    "preview": "/* @flow */\n\nconst validDivisionCharRE = /[\\w).+\\-_$\\]]/\n\nexport function parseFilters(exp: string): string {\n  let inSi"
  },
  {
    "path": "src/compiler/parser/html-parser.js",
    "chars": 9201,
    "preview": "/**\n * Not type-checking this file because it's mostly vendor code.\n */\n\n/*!\n * HTML Parser By John Resig (ejohn.org)\n *"
  },
  {
    "path": "src/compiler/parser/index.js",
    "chars": 19786,
    "preview": "/* @flow */\n\nimport { decode } from 'he'\nimport { parseHTML } from './html-parser'\nimport { parseText } from './text-par"
  },
  {
    "path": "src/compiler/parser/text-parser.js",
    "chars": 1140,
    "preview": "/* @flow */\n\nimport { cached } from 'shared/util'\nimport { parseFilters } from './filter-parser'\n\nconst defaultTagRE = /"
  },
  {
    "path": "src/core/components/index.js",
    "chars": 70,
    "preview": "import KeepAlive from './keep-alive'\n\nexport default {\n  KeepAlive,\n}\n"
  },
  {
    "path": "src/core/components/keep-alive.js",
    "chars": 2628,
    "preview": "/* @flow */\n\nimport { getFirstComponentChild } from 'core/vdom/helpers/index'\n\ntype VNodeCache = { [key: string]: ?VNode"
  },
  {
    "path": "src/core/config.js",
    "chars": 2360,
    "preview": "/* @flow */\n\nimport { no, noop, identity } from 'shared/util'\n\nimport { LIFECYCLE_HOOKS } from 'shared/constants'\n\nexpor"
  },
  {
    "path": "src/core/global-api/assets.js",
    "chars": 1667,
    "preview": "/* @flow */\n\nimport config from '../config'\nimport { ASSET_TYPES } from 'shared/constants'\nimport {\n  warn,\n  // isPlain"
  },
  {
    "path": "src/core/global-api/extend.js",
    "chars": 2848,
    "preview": "/* @flow */\n\nimport { ASSET_TYPES } from 'shared/constants'\nimport { warn, extend, mergeOptions } from '../util/index'\ni"
  },
  {
    "path": "src/core/global-api/index.js",
    "chars": 1498,
    "preview": "/* @flow */\n\nimport config from '../config'\nimport { initUse } from './use'\nimport { initMixin } from './mixin'\nimport {"
  },
  {
    "path": "src/core/global-api/mixin.js",
    "chars": 202,
    "preview": "/* @flow */\n\nimport { mergeOptions } from '../util/index'\n\nexport function initMixin(Vue: GlobalAPI) {\n  Vue.mixin = fun"
  },
  {
    "path": "src/core/global-api/use.js",
    "chars": 536,
    "preview": "/* @flow */\n\nimport { toArray } from '../util/index'\n\nexport function initUse(Vue: GlobalAPI) {\n  Vue.use = function(plu"
  },
  {
    "path": "src/core/index.js",
    "chars": 287,
    "preview": "import Vue from './instance/index'\nimport { initGlobalAPI } from './global-api/index'\nimport { isServerRendering } from "
  },
  {
    "path": "src/core/instance/events.js",
    "chars": 3676,
    "preview": "/* @flow */\n\nimport { updateListeners } from '../vdom/helpers/index'\nimport { toArray, tip, hyphenate, formatComponentNa"
  },
  {
    "path": "src/core/instance/index.js",
    "chars": 1108,
    "preview": "import { initMixin } from './init'\nimport { stateMixin } from './state'\n/**\n * react-vue change\n */\n// import { renderMi"
  },
  {
    "path": "src/core/instance/init.js",
    "chars": 4348,
    "preview": "/* @flow */\n\nimport config from '../config'\nimport { initProxy } from './proxy'\nimport { initState } from './state'\nimpo"
  },
  {
    "path": "src/core/instance/inject.js",
    "chars": 1738,
    "preview": "/* @flow */\n\nimport { hasSymbol } from 'core/util/env'\nimport { warn } from '../util/index'\nimport { defineReactive } fr"
  },
  {
    "path": "src/core/instance/lifecycle.js",
    "chars": 8341,
    "preview": "/* @flow */\n\nimport config from '../config'\nimport Watcher from '../observer/watcher'\nimport { mark, measure } from '../"
  },
  {
    "path": "src/core/instance/proxy.js",
    "chars": 2248,
    "preview": "/* not type checking this file because flow doesn't play well with Proxy */\n\nimport config from 'core/config'\nimport { w"
  },
  {
    "path": "src/core/instance/render-helpers/bind-object-props.js",
    "chars": 1030,
    "preview": "/* @flow */\n\nimport config from 'core/config'\nimport { isObject, warn, toObject } from 'core/util/index'\n\n/**\n * Runtime"
  },
  {
    "path": "src/core/instance/render-helpers/check-keycodes.js",
    "chars": 430,
    "preview": "/* @flow */\n\nimport config from 'core/config'\n\n/**\n * Runtime helper for checking keyCodes from config.\n */\nexport funct"
  },
  {
    "path": "src/core/instance/render-helpers/render-list.js",
    "chars": 757,
    "preview": "/* @flow */\n\nimport { isObject } from 'core/util/index'\n\n/**\n * Runtime helper for rendering v-for lists.\n */\nexport fun"
  },
  {
    "path": "src/core/instance/render-helpers/render-slot.js",
    "chars": 884,
    "preview": "/* @flow */\n\nimport { extend, warn } from 'core/util/index'\n\n/**\n * Runtime helper for rendering <slot>\n */\nexport funct"
  },
  {
    "path": "src/core/instance/render-helpers/render-static.js",
    "chars": 1412,
    "preview": "/* @flow */\n\nimport { cloneVNode, cloneVNodes } from 'core/vdom/vnode'\n\n/**\n * Runtime helper for rendering static trees"
  },
  {
    "path": "src/core/instance/render-helpers/resolve-filter.js",
    "chars": 245,
    "preview": "/* @flow */\n\nimport { identity, resolveAsset } from 'core/util/index'\n\n/**\n * Runtime helper for resolving filters\n */\ne"
  },
  {
    "path": "src/core/instance/render-helpers/resolve-slots.js",
    "chars": 1293,
    "preview": "/* @flow */\n\n/**\n * Runtime helper for resolving raw children VNodes into a slot object.\n */\nexport function resolveSlot"
  },
  {
    "path": "src/core/instance/render.js",
    "chars": 4086,
    "preview": "/* @flow */\n\nimport {\n  warn,\n  nextTick,\n  toNumber,\n  _toString,\n  looseEqual,\n  emptyObject,\n  handleError,\n  looseIn"
  },
  {
    "path": "src/core/instance/state.js",
    "chars": 8571,
    "preview": "/* @flow */\n\nimport config from '../config'\nimport Dep from '../observer/dep'\nimport Watcher from '../observer/watcher'\n"
  },
  {
    "path": "src/core/observer/array.js",
    "chars": 1186,
    "preview": "/*\n * not type checking this file because flow doesn't play well with\n * dynamically accessing methods on Array prototyp"
  },
  {
    "path": "src/core/observer/dep.js",
    "chars": 1086,
    "preview": "/* @flow */\n\nimport type Watcher from './watcher'\nimport { remove } from '../util/index'\n\nlet uid = 0\n\n/**\n * A dep is a"
  },
  {
    "path": "src/core/observer/index.js",
    "chars": 6278,
    "preview": "/* @flow */\n\nimport Dep from './dep'\nimport { arrayMethods } from './array'\nimport {\n  def,\n  isObject,\n  isPlainObject,"
  },
  {
    "path": "src/core/observer/scheduler.js",
    "chars": 3926,
    "preview": "/* @flow */\n\nimport type Watcher from './watcher'\nimport config from '../config'\nimport { callHook, activateChildCompone"
  },
  {
    "path": "src/core/observer/watcher.js",
    "chars": 5899,
    "preview": "/* @flow */\n\nimport { queueWatcher } from './scheduler'\nimport Dep, { pushTarget, popTarget } from './dep'\n\nimport {\n  w"
  },
  {
    "path": "src/core/util/debug.js",
    "chars": 2620,
    "preview": "import config from '../config'\nimport { noop } from 'shared/util'\n\nexport let warn = noop\nexport let tip = noop\nexport l"
  },
  {
    "path": "src/core/util/env.js",
    "chars": 5520,
    "preview": "/* @flow */\n\nimport { noop } from 'shared/util'\nimport { handleError } from './error'\n\n// can we use __proto__?\nexport c"
  },
  {
    "path": "src/core/util/error.js",
    "chars": 495,
    "preview": "import config from '../config'\nimport { warn } from './debug'\nimport { inBrowser } from './env'\n\nexport function handleE"
  },
  {
    "path": "src/core/util/index.js",
    "chars": 222,
    "preview": "export * from 'shared/util'\nexport * from './lang'\nexport * from './env'\nexport * from './options'\nexport * from './debu"
  },
  {
    "path": "src/core/util/lang.js",
    "chars": 807,
    "preview": "/* @flow */\n\nexport const emptyObject = Object.freeze({})\n\n/**\n * Check if a string starts with $ or _\n */\nexport functi"
  },
  {
    "path": "src/core/util/options.js",
    "chars": 7946,
    "preview": "/* @flow */\n\nimport config from '../config'\nimport { warn } from './debug'\nimport { set } from '../observer/index'\n\nimpo"
  },
  {
    "path": "src/core/util/perf.js",
    "chars": 523,
    "preview": "import { inBrowser } from './env'\n\nexport let mark\nexport let measure\n\nif (process.env.NODE_ENV !== 'production') {\n  co"
  },
  {
    "path": "src/core/util/props.js",
    "chars": 4725,
    "preview": "/* @flow */\n\nimport {\n  hasOwn,\n  isObject,\n  isPlainObject,\n  capitalize,\n  hyphenate,\n} from 'shared/util'\nimport { ob"
  },
  {
    "path": "src/core/vdom/create-component.js",
    "chars": 6881,
    "preview": "/* @flow */\n\nimport VNode from './vnode'\nimport { resolveConstructorOptions } from 'core/instance/init'\nimport { queueAc"
  },
  {
    "path": "src/core/vdom/create-element.js",
    "chars": 3368,
    "preview": "/* @flow */\n\nimport config from '../config'\nimport VNode, { createEmptyVNode } from './vnode'\nimport { createComponent }"
  },
  {
    "path": "src/core/vdom/create-functional-component.js",
    "chars": 1558,
    "preview": "/* @flow */\n\nimport VNode from './vnode'\nimport { createElement } from './create-element'\nimport { resolveInject } from "
  },
  {
    "path": "src/core/vdom/helpers/extract-props.js",
    "chars": 1865,
    "preview": "/* @flow */\n\nimport {\n  tip,\n  hasOwn,\n  isDef,\n  isUndef,\n  hyphenate,\n  formatComponentName,\n} from 'core/util/index'\n"
  },
  {
    "path": "src/core/vdom/helpers/get-first-component-child.js",
    "chars": 321,
    "preview": "/* @flow */\n\nimport { isDef } from 'shared/util'\n\nexport function getFirstComponentChild(children: ?Array<VNode>): ?VNod"
  },
  {
    "path": "src/core/vdom/helpers/index.js",
    "chars": 232,
    "preview": "/* @flow */\n\nexport * from './merge-hook'\nexport * from './extract-props'\nexport * from './update-listeners'\nexport * fr"
  },
  {
    "path": "src/core/vdom/helpers/merge-hook.js",
    "chars": 899,
    "preview": "/* @flow */\n\nimport { createFnInvoker } from './update-listeners'\nimport { remove, isDef, isUndef, isTrue } from 'shared"
  },
  {
    "path": "src/core/vdom/helpers/normalize-children.js",
    "chars": 2669,
    "preview": "/* @flow */\n\nimport VNode, { createTextVNode } from 'core/vdom/vnode'\nimport { isDef, isUndef, isPrimitive } from 'share"
  },
  {
    "path": "src/core/vdom/helpers/resolve-async-component.js",
    "chars": 2873,
    "preview": "/* @flow */\n\nimport { warn, once, isDef, isUndef, isTrue, isObject } from 'core/util/index'\n\nfunction ensureCtor(comp, b"
  },
  {
    "path": "src/core/vdom/helpers/update-listeners.js",
    "chars": 1817,
    "preview": "/* @flow */\n\nimport { warn } from 'core/util/index'\nimport { cached, isUndef } from 'shared/util'\n\nconst normalizeEvent "
  },
  {
    "path": "src/core/vdom/modules/directives.js",
    "chars": 3188,
    "preview": "/* @flow */\n\nimport { emptyNode } from 'core/vdom/patch'\nimport { resolveAsset, handleError } from 'core/util/index'\nimp"
  },
  {
    "path": "src/core/vdom/modules/index.js",
    "chars": 96,
    "preview": "import directives from './directives'\nimport ref from './ref'\n\nexport default [ref, directives]\n"
  },
  {
    "path": "src/core/vdom/modules/ref.js",
    "chars": 996,
    "preview": "/* @flow */\n\nimport { remove } from 'shared/util'\n\nexport default {\n  create(_: any, vnode: VNodeWithData) {\n    registe"
  },
  {
    "path": "src/core/vdom/patch.js",
    "chars": 22978,
    "preview": "/**\n * Virtual DOM patching algorithm based on Snabbdom by\n * Simon Friis Vindum (@paldepind)\n * Licensed under the MIT "
  },
  {
    "path": "src/core/vdom/vnode.js",
    "chars": 2676,
    "preview": "/* @flow */\n\nexport default class VNode {\n  tag: string | void\n  data: VNodeData | void\n  children: ?Array<VNode>\n  text"
  },
  {
    "path": "src/platforms/vue-native/compiler/codegen/BaseGenerator.js",
    "chars": 3125,
    "preview": "import { COMMON, WEB, NATIVE } from '../config'\nimport { specialObserver } from '../helpers'\nimport { RENDER_HELPER_MODU"
  },
  {
    "path": "src/platforms/vue-native/compiler/codegen/NativeRenderGenerator.js",
    "chars": 5726,
    "preview": "import RenderGenerator from './RenderGenerator'\n\nimport { camelize, capitalize } from 'shared/util'\n\nimport { genHandler"
  },
  {
    "path": "src/platforms/vue-native/compiler/codegen/RenderGenerator.js",
    "chars": 11461,
    "preview": "import changeCase from 'change-case'\nimport { camelize } from 'shared/util'\nimport { COMMON } from '../config'\nimport { "
  },
  {
    "path": "src/platforms/vue-native/compiler/codegen/WebRenderGenerator.js",
    "chars": 9295,
    "preview": "import { baseWarn } from 'compiler/helpers'\nimport { camelize, capitalize } from 'shared/util'\nimport RenderGenerator fr"
  },
  {
    "path": "src/platforms/vue-native/compiler/codegen/index.js",
    "chars": 168,
    "preview": "import WebRenderGenerator from './WebRenderGenerator'\nimport NativeRenderGenerator from './NativeRenderGenerator'\n\nexpor"
  },
  {
    "path": "src/platforms/vue-native/compiler/config.js",
    "chars": 3337,
    "preview": "import {\n  TAB_INDENT,\n  CREATE_ELEMENT,\n  HELPER_HEADER,\n  COMPONENT,\n} from './constants'\n\nconst COMMON = {\n  createEl"
  },
  {
    "path": "src/platforms/vue-native/compiler/constants.js",
    "chars": 369,
    "preview": "const TAB_INDENT = '    '\nconst CREATE_ELEMENT = 'createElement'\nconst COMPONENT = 'Component'\nconst HELPER_HEADER = '__"
  },
  {
    "path": "src/platforms/vue-native/compiler/directives/html.js",
    "chars": 262,
    "preview": "export default function html(ast) {\n  const obj = {}\n  const directive = ast.directives.filter(v => v.name === 'html')[0"
  },
  {
    "path": "src/platforms/vue-native/compiler/directives/index.js",
    "chars": 110,
    "preview": "import model from './model'\nimport html from './html'\nimport text from './text'\n\nexport { model, html, text }\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/directives/model.js",
    "chars": 6247,
    "preview": "/* @flow */\n\nimport config from 'core/config'\nimport { addHandler, addAttr, getBindingAttr } from 'compiler/helpers'\nimp"
  },
  {
    "path": "src/platforms/vue-native/compiler/directives/text.js",
    "chars": 229,
    "preview": "export default function text(ast) {\n  const children = []\n  const directive = ast.directives.filter(v => v.name === 'tex"
  },
  {
    "path": "src/platforms/vue-native/compiler/helpers.js",
    "chars": 1388,
    "preview": "import { isUnaryTag } from './util/index'\n\nexport function specialObserver(obj, cb) {\n  for (const key in obj) {\n    con"
  },
  {
    "path": "src/platforms/vue-native/compiler/index.js",
    "chars": 47,
    "preview": "export * from './web'\nexport * from './native'\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/modules/events.js",
    "chars": 7851,
    "preview": "import changeCase from 'change-case'\nimport { COMMON } from '../config'\n\nconst fnExpRE = /^\\s*([\\w$_]+|\\([^)]*?\\))\\s*=>|"
  },
  {
    "path": "src/platforms/vue-native/compiler/modules/style.js",
    "chars": 528,
    "preview": "import changeCase from 'change-case'\n\nexport default function parseStyleText(cssText) {\n  const res = {}\n  const listDel"
  },
  {
    "path": "src/platforms/vue-native/compiler/native.js",
    "chars": 2372,
    "preview": "import _ from 'lodash'\n\nimport { parse, processAttrs } from 'compiler/parser/index'\n\nimport { NativeRenderGenerator } fr"
  },
  {
    "path": "src/platforms/vue-native/compiler/parser/filter-parser.js",
    "chars": 2875,
    "preview": "/* @flow */\nimport { COMMON } from 'vue-native/compiler/config'\n\nconst validDivisionCharRE = /[\\w).+\\-_$\\]]/\n\nexport fun"
  },
  {
    "path": "src/platforms/vue-native/compiler/parser/text-parser.js",
    "chars": 1151,
    "preview": "import { cached } from 'shared/util'\nimport { parseFilters } from './filter-parser'\nimport { COMMON } from 'vue-native/c"
  },
  {
    "path": "src/platforms/vue-native/compiler/property/ARIADOMPropertyConfig.js",
    "chars": 1800,
    "preview": "/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-s"
  },
  {
    "path": "src/platforms/vue-native/compiler/property/EventConstant.js",
    "chars": 1947,
    "preview": "/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-s"
  },
  {
    "path": "src/platforms/vue-native/compiler/property/HTMLDOMPropertyConfig.js",
    "chars": 6619,
    "preview": "/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-s"
  },
  {
    "path": "src/platforms/vue-native/compiler/property/ReactProps.js",
    "chars": 329,
    "preview": "var reactProps = {\n  children: true,\n  dangerouslySetInnerHTML: true,\n  key: true,\n  ref: true,\n\n  autoFocus: true,\n  de"
  },
  {
    "path": "src/platforms/vue-native/compiler/property/SVGDOMPropertyConfig.js",
    "chars": 7296,
    "preview": "/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-s"
  },
  {
    "path": "src/platforms/vue-native/compiler/property/index.js",
    "chars": 874,
    "preview": "import ARIADOMPropertyConfig from './ARIADOMPropertyConfig'\nimport HTMLDOMPropertyConfig from './HTMLDOMPropertyConfig'\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/util/attrs.js",
    "chars": 1584,
    "preview": "/* @flow */\n\nimport { makeMap } from 'shared/util'\n\n// these are reserved for web because they are directly compiled awa"
  },
  {
    "path": "src/platforms/vue-native/compiler/util/element.js",
    "chars": 3635,
    "preview": "/* @flow */\n\nimport { inBrowser } from 'core/util/env'\nimport { makeMap } from 'shared/util'\nimport { COMMON, WEB } from"
  },
  {
    "path": "src/platforms/vue-native/compiler/util/index.js",
    "chars": 50,
    "preview": "export * from './attrs'\nexport * from './element'\n"
  },
  {
    "path": "src/platforms/vue-native/compiler/web.js",
    "chars": 719,
    "preview": "import { parse } from 'compiler/parser/index'\n\nimport { WebRenderGenerator } from 'vue-native/compiler/codegen/index'\n\ni"
  },
  {
    "path": "src/platforms/vue-native/compiler.js",
    "chars": 93,
    "preview": "/* @flow */\n\nexport { parseComponent } from 'sfc/parser'\nexport * from './compiler/index.js'\n"
  },
  {
    "path": "src/platforms/vue-native/index.js",
    "chars": 127,
    "preview": "/** @flow */\n\nimport Vue from './runtime/index'\nimport observer from './observer'\n\nVue.observer = observer\n\nexport defau"
  },
  {
    "path": "src/platforms/vue-native/observer.js",
    "chars": 2787,
    "preview": "/**\n * Reference to mobx https://github.com/mobxjs/mobx-react-vue/blob/master/src/observer.js\n */\n\nimport React from 're"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildComponent.js",
    "chars": 4214,
    "preview": "import {\n  isObjectShallowModified,\n  mergeCssModule,\n  handleComponents,\n  handleDirectives,\n  getSlots,\n  pascalCaseTa"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildDirective.js",
    "chars": 4847,
    "preview": "import { COMMON } from 'vue-native/compiler/config'\n\nimport { handleProps } from '../render-helpers/handleProps'\n\nimport"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildInputComponent.js",
    "chars": 1336,
    "preview": "import { WEB } from 'vue-native/compiler/config'\n\nimport { buildMixin } from './buildMixin'\n\nimport { handleProps } from"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildMixin.js",
    "chars": 817,
    "preview": "export function buildMixin(Component) {\n  return class Mixin extends Component {\n    constructor(props) {\n      super(pr"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildNativeComponent.js",
    "chars": 4540,
    "preview": "import { deprecatedPackages } from 'shared/constants'\n\nimport {\n  isObjectShallowModified,\n  handleComponents,\n  handleD"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildWebEmptyComponent.js",
    "chars": 1486,
    "preview": "export function buildWebEmptyComponent(Component, createElement) {\n  return class EmptyComponent extends Component {\n   "
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildWebInputComponent.js",
    "chars": 147,
    "preview": "import { buildInputComponent } from './buildInputComponent'\n\nconst buildWebInputComponent = buildInputComponent\n\nexport "
  },
  {
    "path": "src/platforms/vue-native/runtime/components/buildWebTransition.js",
    "chars": 14209,
    "preview": "import { addClass, removeClass } from 'web/runtime/class-util.js'\nimport {\n  nextFrame,\n  resolveTransition,\n  whenTrans"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/index.js",
    "chars": 352,
    "preview": "export { buildComponent } from './buildComponent'\nexport { buildDirective } from './buildDirective'\nexport { buildWebTra"
  },
  {
    "path": "src/platforms/vue-native/runtime/components/util.js",
    "chars": 3126,
    "preview": "import { COMMON } from 'vue-native/compiler/config'\n\nexport function isObjectShallowModified(prev, next) {\n  // if (prev"
  },
  {
    "path": "src/platforms/vue-native/runtime/directives/index.js",
    "chars": 57,
    "preview": "import model from './model'\n\nexport default {\n  model,\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/directives/model.js",
    "chars": 1950,
    "preview": "import { looseEqual, looseIndexOf } from 'shared/util'\nimport { warn } from 'core/util/index'\n\nfunction setSelected(el, "
  },
  {
    "path": "src/platforms/vue-native/runtime/helpers.js",
    "chars": 205,
    "preview": "import platformDirectives from './directives/index.js'\n\nexport { platformDirectives }\nexport * from './render-helpers/in"
  },
  {
    "path": "src/platforms/vue-native/runtime/index.js",
    "chars": 172,
    "preview": "import Vue from 'core/index'\n\nimport { lifeCycleMixin } from './lifeCycle'\nimport { renderMixin } from './render'\n\nlifeC"
  },
  {
    "path": "src/platforms/vue-native/runtime/lifeCycle.js",
    "chars": 1250,
    "preview": "// @flow\n\nimport { remove } from 'core/util/index'\n\nexport function lifeCycleMixin(Vue: Class<Component>) {\n  Vue.protot"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/bindNativeClass.js",
    "chars": 792,
    "preview": "function classBinding(c) {\n  const type = Object.prototype.toString.call(c)\n  if (type === '[object Object]') {\n    retu"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/bindNativeStyle.js",
    "chars": 627,
    "preview": "export function bindNativeStyle(styleBinding, staticStyle, showStyle) {\n  if (styleBinding === undefined) {\n    styleBin"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/bindWebClass.js",
    "chars": 361,
    "preview": "export function bindWebClass(c) {\n  const type = Object.prototype.toString.call(c)\n  if (type === '[object Object]') {\n "
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/bindWebStyle.js",
    "chars": 1229,
    "preview": "import { cached, camelize } from 'shared/util'\n\nconst prefixes = ['Webkit', 'Moz', 'ms']\n\nlet testEl\nconst normalize = c"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/checkKeyCodes.js",
    "chars": 640,
    "preview": "/* @flow */\nimport { warn } from 'core/util/index'\n/**\n * Runtime helper for checking keyCodes.\n */\nexport function chec"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/directive.js",
    "chars": 4888,
    "preview": "import { COMMON } from 'vue-native/compiler/config'\n\nfunction triggerDirective(newData, oldData, vm, ref) {\n  let direct"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/dynamicComponent.js",
    "chars": 283,
    "preview": "import { pascalCaseTag } from '../components/util.js'\n\nexport function dynamicComponent(vm, name) {\n  let componentName\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/event.js",
    "chars": 167,
    "preview": "export function event(fn) {\n  if (Array.isArray(fn)) {\n    return function() {\n      return fn.map(v => v.apply(this, ar"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/handleProps.js",
    "chars": 695,
    "preview": "import { HELPER_HEADER } from 'vue-native/compiler/constants'\nimport propertyMap from 'vue-native/compiler/property/inde"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/index.js",
    "chars": 763,
    "preview": "/**\n * @flow\n */\nexport * from 'shared/util'\nexport { renderList } from './renderList'\nexport { renderSlot } from './ren"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/mergeCssModule.js",
    "chars": 276,
    "preview": "export function mergeCssModule(computed, cssModules) {\n  const _computed = Object.create(computed || null)\n  Object.keys"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/mergeNativeStyleAndNativeClass.js",
    "chars": 769,
    "preview": "export function mergeNativeStyleAndNativeClass(nativeClass, nativeStyle) {\n  let resultant = []\n  if (nativeClass) {\n   "
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/mergeProps.js",
    "chars": 700,
    "preview": "export function mergeProps() {\n  const args = Array.prototype.slice.call(arguments, 0).filter(v => v)\n  const obj = {}\n "
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/renderList.js",
    "chars": 70,
    "preview": "export { renderList } from 'core/instance/render-helpers/render-list'\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/renderSlot.js",
    "chars": 1476,
    "preview": "import { COMMON } from 'vue-native/compiler/config'\n\nexport function renderSlot(names, children) {\n  const hitSlot = {}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/resolveFilter.js",
    "chars": 76,
    "preview": "export { resolveFilter } from 'core/instance/render-helpers/resolve-filter'\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/template.js",
    "chars": 60,
    "preview": "export function template(props) {\n  return props.children\n}\n"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/transitionGroupWeb.js",
    "chars": 237,
    "preview": "// unfinished\n\nexport function transitionGroupWeb(Component, createElement) {\n  return class TransitionGroup extends Com"
  },
  {
    "path": "src/platforms/vue-native/runtime/render-helpers/transitionWeb.js",
    "chars": 13071,
    "preview": "import { addClass, removeClass } from 'web/runtime/class-util.js'\nimport {\n  nextFrame,\n  resolveTransition,\n  whenTrans"
  },
  {
    "path": "src/platforms/vue-native/runtime/render.js",
    "chars": 196,
    "preview": "// @flow\n\nimport { nextTick } from 'core/util/index'\n\nexport function renderMixin(Vue: Class<Component>) {\n  Vue.prototy"
  },
  {
    "path": "src/platforms/vue-native/scripts/compiler.js",
    "chars": 8695,
    "preview": "// const fs = require('fs')\nimport * as compiler from 'vue-native-template-compiler'\nimport cssParse from 'css-parse'\nim"
  },
  {
    "path": "src/platforms/vue-native/scripts/index.js",
    "chars": 143,
    "preview": "import { compileVueToRn } from './compiler'\nimport { transform } from './transformerPlugin'\n\nexport default {\n  compileV"
  },
  {
    "path": "src/platforms/vue-native/scripts/transformerPlugin.js",
    "chars": 2611,
    "preview": "import semver from 'semver'\nimport traverse from 'babel-traverse'\nimport { SourceMapConsumer } from 'source-map'\n\nimport"
  },
  {
    "path": "src/platforms/vue-native/scripts/util/addvm.js",
    "chars": 2027,
    "preview": "import { transform } from 'babel-core'\nimport constants from './constants'\n\nconst names =\n  'Infinity,undefined,NaN,isFi"
  },
  {
    "path": "src/platforms/vue-native/scripts/util/constants.js",
    "chars": 744,
    "preview": "const HELPER_HEADER = '__react__vue__'\nconst SCRIPT_OPTIONS = `${HELPER_HEADER}options`\nconst TEMPLATE_RENDER = `${HELPE"
  },
  {
    "path": "src/platforms/vue-native/scripts/util/parseCss.js",
    "chars": 1389,
    "preview": "import { parseTransform } from './parseTransform'\n\nconst camelizeRE = /-(\\w)/g\n\nfunction camelize(str) {\n  return str.re"
  },
  {
    "path": "src/platforms/vue-native/scripts/util/parseTransform.js",
    "chars": 3117,
    "preview": "const TRANSFORM_TRANSLATE_REGEX = /translate\\(([-+]?[\\d]*\\.?[\\d]+)(px)?,[\\s]+([-+]?[\\d]*\\.?[\\d]+)(px)?\\)/\nconst TRANSFOR"
  },
  {
    "path": "src/platforms/web/compiler/directives/html.js",
    "chars": 197,
    "preview": "/* @flow */\n\nimport { addProp } from 'compiler/helpers'\n\nexport default function html(el: ASTElement, dir: ASTDirective)"
  },
  {
    "path": "src/platforms/web/compiler/directives/index.js",
    "chars": 125,
    "preview": "import model from './model'\nimport text from './text'\nimport html from './html'\n\nexport default {\n  model,\n  text,\n  htm"
  },
  {
    "path": "src/platforms/web/compiler/directives/model.js",
    "chars": 5122,
    "preview": "/* @flow */\n\nimport config from 'core/config'\nimport { addHandler, addProp, getBindingAttr } from 'compiler/helpers'\nimp"
  },
  {
    "path": "src/platforms/web/compiler/directives/text.js",
    "chars": 199,
    "preview": "/* @flow */\n\nimport { addProp } from 'compiler/helpers'\n\nexport default function text(el: ASTElement, dir: ASTDirective)"
  },
  {
    "path": "src/platforms/web/compiler/index.js",
    "chars": 675,
    "preview": "/* @flow */\n\nimport { isUnaryTag, canBeLeftOpenTag } from './util'\nimport { genStaticKeys } from 'shared/util'\nimport { "
  },
  {
    "path": "src/platforms/web/compiler/modules/class.js",
    "chars": 1241,
    "preview": "/* @flow */\n\nimport { parseText } from 'compiler/parser/text-parser'\nimport { getAndRemoveAttr, getBindingAttr, baseWarn"
  },
  {
    "path": "src/platforms/web/compiler/modules/index.js",
    "chars": 87,
    "preview": "import klass from './class'\nimport style from './style'\n\nexport default [klass, style]\n"
  },
  {
    "path": "src/platforms/web/compiler/modules/style.js",
    "chars": 1344,
    "preview": "/* @flow */\n\nimport { parseText } from 'compiler/parser/text-parser'\nimport { parseStyleText } from 'web/util/style'\nimp"
  },
  {
    "path": "src/platforms/web/compiler/util.js",
    "chars": 917,
    "preview": "/* @flow */\n\nimport { makeMap } from 'shared/util'\n\nexport const isUnaryTag = makeMap(\n  'area,base,br,col,embed,frame,h"
  },
  {
    "path": "src/platforms/web/compiler.js",
    "chars": 120,
    "preview": "/* @flow */\n\nexport { parseComponent } from 'sfc/parser'\nexport { compile, compileToFunctions } from './compiler/index'\n"
  },
  {
    "path": "src/platforms/web/runtime/class-util.js",
    "chars": 1280,
    "preview": "/* @flow */\n\n/**\n * Add class with compatibility for SVG since classList is not supported on\n * SVG elements in IE\n */\ne"
  },
  {
    "path": "src/platforms/web/runtime/components/index.js",
    "chars": 140,
    "preview": "import Transition from './transition'\nimport TransitionGroup from './transition-group'\n\nexport default {\n  Transition,\n "
  },
  {
    "path": "src/platforms/web/runtime/components/transition-group.js",
    "chars": 5640,
    "preview": "/* @flow */\n\n// Provides transition support for list items.\n// supports move transitions using the FLIP technique.\n\n// B"
  }
]

// ... and 37 more files (download for full content)

About this extraction

This page contains the full source code of the GeekyAnts/vue-native-core GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 237 files (523.2 KB), approximately 146.6k tokens, and a symbol index with 541 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!