You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+55-32Lines changed: 55 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,55 +1,78 @@
1
-
# Vue Native: Read more at [vue-native.io](https://vue-native.io)
1
+
# Vue Native
2
+
2
3
[](#backers)
3
4
[](#sponsors)
4
5
5
-
### Start with the Vue Native CLI
6
+
Visit our website at [vue-native.io](https://vue-native.io) or read the official documentation [here](https://vue-native.io/docs/installation.html).
6
7
7
-
The Vue Native CLI is used to generate a `Vue Native` app, which is a React Native API wrapper. This means that with Vue Native, you can do anything that could be done with React Native.
8
+
## Build native mobile apps using Vue
8
9
9
-
The Vue Native CLI generates a simple single page application (SPA) using [expo-cli](https://github.com/expo/expo-cli) and
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
11
11
12
-
## Installation Prerequisites
12
+
-**The simplicity of Vue.js.** Incrementally build user interfaces with the familiar syntax of HTML and CSS in single file components.
13
+
-**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.
13
14
14
-
You should have expo-cli or react-native-cli installed as a global dependency
15
+
## Contents
16
+
-[Documentation](#documentation)
17
+
-[Installation](#installation)
18
+
-[Project setup with Vue Native CLI](#project-setup-with-vue-native-cli)
19
+
-[Using Vue Native with a pre-existing React Native or Expo project](#using-vue-native-in-a-react-native-project)
For React Native ClI => npm install react-native-cli -g
18
-
```
27
+
## Documentation
19
28
20
-
```
21
-
For CRNA => npm install expo-cli -g
22
-
```
29
+
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.
30
+
31
+
The source for the Vue Native documentation and website is hosted on a separate repo, [here](https://github.com/GeekyAnts/vue-native-website)
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.
41
+
42
+
## Project setup with Vue Native CLI
31
43
44
+
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).
45
+
46
+
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).
47
+
48
+
With the CLI, generating a Vue Native project is as easy as running the command
32
49
```
33
50
$ vue-native init <projectName>
34
51
```
35
52
36
-
## NOTE:
53
+
## Using Vue Native in a React Native project
37
54
38
-
```
39
-
'AlertIOS',
40
-
'AsyncStorage',
41
-
'ImageStore',
42
-
'ListView',
43
-
'MaskedViewIOS',
44
-
'NetInfo',
45
-
'Slider',
46
-
'SwipeableListView',
47
-
'ViewPagerAndroid',
48
-
'WebView',
49
-
```
50
-
The above modules are set to be removed from future core react-native.
51
-
Hence these modules can no longer be imported from vue-native.
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).
56
+
57
+
These instructions can also be used to set up a Vue Native project from scratch.
58
+
59
+
## React Native components that can't be used out of the box
60
+
61
+
The following modules are set to be removed from React Native in the future.
62
+
Hence these modules are no longer made available with Vue Native.
63
+
- AlertIOS
64
+
- AsyncStorage
65
+
- ImageStore
66
+
- ListView
67
+
- MaskedViewIOS
68
+
- NetInfo
69
+
- Slider
70
+
- SwipeableListView
71
+
- ViewPagerAndroid
72
+
- WebView
73
+
74
+
If you still wish to use them, you can import them explicitly from `react-native` (until they are removed) or from their individual forked packages.
75
+
For more information, refer to [this page](https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059#lean-core-is-underway).
## Setting up a React Native project for Vue Native
2
+
3
+
[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.
4
+
5
+
### Step 1: Install
6
+
7
+
The following packages are required as runtime dependencies by Vue Native:
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):
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:
49
+
50
+
```js
51
+
// For React Native version 0.59 or later
52
+
var upstreamTransformer =require("metro-react-native-babel-transformer");
53
+
54
+
// You will need to use different transformers for different React Native versions
55
+
// However, versions older than v0.59 are no longer supported by Vue Native
56
+
57
+
// For React Native version 0.56 - 0.58
58
+
// var upstreamTransformer = require("metro/src/reactNativeTransformer");
59
+
60
+
// For React Native version 0.52 - 0.55
61
+
// var upstreamTransformer = require("metro/src/transformer");
62
+
63
+
// For React Native version 0.47 - 0.51
64
+
// var upstreamTransformer = require("metro-bundler/src/transformer");
65
+
66
+
// For React Native version 0.46
67
+
// var upstreamTransformer = require("metro-bundler/build/transformer");
68
+
69
+
var vueNaiveScripts =require("vue-native-scripts");
70
+
var vueExtensions = ["vue"]; // <-- Add other extensions if needed.
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.
81
+
82
+
## Using Vue Native components and `.vue` files
83
+
84
+
In the React Native application, you can simply `import` your Vue components as follows
85
+
86
+
```
87
+
import VueComponent from './VueComponent.vue'
88
+
```
89
+
90
+
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.
# Vue Native: Read more at [vue-native.io](https://vue-native.io)
1
+
# vue-native-core
2
2
3
-
### Start with the Vue Native CLI
3
+
> 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).
4
4
5
-
The Vue Native CLI is used to generate a `Vue Native` app, which is a React Native API wrapper. This means that with Vue Native, you can do anything that could be done with React Native.
5
+
Find the `vue-native-core` repository [here](https://github.com/GeekyAnts/vue-native-core).
6
6
7
-
The Vue Native CLI generates a simple single page appliction (SPA) using [create-react-native-app](https://github.com/react-community/create-react-native-app) and
> This package is auto-generated. For pull requests please see [--todo][src/platforms/react/runtime]().
3
+
> 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).
4
+
5
+
Find the `vue-native-core` repository [here](https://github.com/GeekyAnts/vue-native-core).
6
+
7
+
For the official documentation, visit [this](https://vue-native.io/docs/installation.html) website.
Compile And Transform Vue component to React Native.
3
+
> 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).
4
4
5
-
## Install
5
+
Compile and transform Vue components to React Native.
6
+
7
+
Find the `vue-native-core` repository [here](https://github.com/GeekyAnts/vue-native-core).
8
+
9
+
For the official documentation, visit [this](https://vue-native.io/docs/installation.html) website.
10
+
11
+
## Usage
12
+
13
+
[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.
6
14
7
15
### Step 1: Install
8
16
17
+
The following packages are required as runtime dependencies by Vue Native:
Add this to your `rn-cli.config.js` (make one to your project's root if you don't have one already):
32
+
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):
Create `vueTransformerPlugin.js` file to your project's root and specify supported extensions:
58
+
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:
30
59
31
60
```js
32
-
// For React Native version 0.52 or later
33
-
var upstreamTransformer =require("metro/src/transformer");
61
+
// For React Native version 0.59 or later
62
+
var upstreamTransformer =require("metro-react-native-babel-transformer");
63
+
64
+
// You will need to use different transformers for different React Native versions
65
+
// However, versions older than v0.59 are no longer supported by Vue Native
66
+
67
+
// For React Native version 0.56 - 0.58
68
+
// var upstreamTransformer = require("metro/src/reactNativeTransformer");
69
+
70
+
// For React Native version 0.52 - 0.55
71
+
// var upstreamTransformer = require("metro/src/transformer");
34
72
35
-
// For React Native version 0.47-0.51
73
+
// For React Native version 0.47 - 0.51
36
74
// var upstreamTransformer = require("metro-bundler/src/transformer");
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.
53
91
54
-
For react-native packager can not bundle`.vue`file, this scripts just compiled the file with `.vue` suffixed and generated a same name file with `.js` suffixed.
92
+
## Using Vue Native components and`.vue`files
55
93
56
-
In the react native application, you can simply `import` your Vue components as following
94
+
In the React Native application, you can simply `import` your Vue components as follows
57
95
58
96
```
59
97
import VueComponent from './VueComponent.vue'
60
98
```
61
99
62
-
There should be a file named `VueComponent.vue` in the corresponding folder, and the transformer would be parse this file and send it to the react native packager.
100
+
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.
> This package is auto-generated. For pull requests please see [--todo][src/platforms/react-vue/compiler/index.js]().
3
+
> 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).
4
+
5
+
Find the `vue-native-core` repository [here](https://github.com/GeekyAnts/vue-native-core).
6
+
7
+
For the official documentation, visit [this](https://vue-native.io/docs/installation.html) website.
0 commit comments