Skip to content

Commit d4f4f44

Browse files
committed
release v1.0.8
1 parent 49e256b commit d4f4f44

File tree

4 files changed

+34
-128
lines changed

4 files changed

+34
-128
lines changed

build/build.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,23 @@ else {
180180
console.log('\nPlease specify the package you want to build. [native, runtime, browser, vue]')
181181
}
182182

183+
function copyReadme (pkgName) {
184+
if (pkgName === 'weex-vue-render') {
185+
const fromMd = fs.readFileSync(resolve('README.md'))
186+
const toMdPath = resolve('packages/weex-vue-render/README.md')
187+
fs.outputFileSync(toMdPath, fromMd)
188+
}
189+
}
190+
183191
function copyVersion (pkgName) {
184-
if (pkgName === 'vue') {
192+
if (pkgName === 'weex-vue-render') {
185193
const fromPkg = fs.readJsonSync(resolve('package.json'))
186-
const toPkgPath = resolve('packages/weex-vue-render')
194+
const toPkgPath = resolve('packages/weex-vue-render/package.json')
187195
const toPkg = fs.readJsonSync(toPkgPath)
188196
toPkg.version = fromPkg.version
189-
fs.outputJsonSync(toPkgPath, toPkg)
197+
fs.outputJsonSync(toPkgPath, toPkg, {
198+
spaces: 2
199+
})
190200
}
191201
}
192202

@@ -254,6 +264,7 @@ function build (name) {
254264
fs.copy(config.output.file, utils.resolve(`public/assets/${basename}`))
255265
// cpy version info to packages/weex-vue-render
256266
copyVersion(pkgName)
267+
copyReadme(pkgName)
257268
const cjsConfig = getConfig(pkgName, false, {
258269
format: 'cjs',
259270
_isProd: true

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "weex-vue-render",
3-
"description": "Web renderer for weex project.",
4-
"version": "1.0.7",
3+
"description": "Web renderer for weex project written in Vue DSL.",
4+
"version": "1.0.8",
55
"license": "Apache-2.0",
66
"main": "dist/index.common.js",
77
"keywords": [

packages/weex-vue-render/README.md

Lines changed: 13 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
Web renderer for weex project. Support Vue 2.x syntax.
44

5+
[![build](https://travis-ci.org/weexteam/weex-vue-render.svg?branch=master)](https://travis-ci.org/weexteam/weex-vue-render)
6+
[![vuejs2.x](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://img.shields.io/badge/vue-2.x-brightgreen.svg)
7+
[![pkg](https://img.shields.io/npm/v/weex-vue-render.svg?style=flat)](https://npmjs.com/package/weex-vue-render)
8+
[![down](https://img.shields.io/npm/dm/weex-vue-render.svg)](https://npmjs.com/package/weex-vue-render)
9+
[![Package Quality](http://npm.packagequality.com/shield/weex-vue-render.svg)](http://packagequality.com/#?package=weex-vue-render)
10+
511
## How To Use
612

713
We strongly suggest you use v1.x instead of 0.12.x, according to performance issue.
@@ -120,125 +126,14 @@ You should use the previous mentioned plugins in your vue-loader configuration.
120126
| **exclusive styles** | limit | none | wirte them in `<style>` tag for better performance. |
121127
| | image attr: 'resize' | none | due to involving style changing, the 'resize' attribute shouldn't be a attribute binding like `:resize="someVar"`, instead you should use static attribute like `resize="cover"`. In other words, it shouldn't be updated. |
122128
| **ref** | what `this.$refs.xx` will get | always instance of VueComponent | HTMLElement for div, image and text; VueComponent for other components. |
123-
# weex-vue-render
124-
125-
Web renderer for weex project. Support Vue 2.x syntax.
126129

127-
## How To Use
128-
129-
We strongly suggest you use v1.x instead of 0.12.x, according to performance issue.
130+
## Develop
130131

131132
```shell
132-
npm install weex-vue-render
133-
```
134-
135-
```javascript
136-
// import vue runtime.
137-
const Vue = require('vue/dist/vue.runtime.common').default
138-
// import weex-vue-render
139-
const weex = require('weex-vue-render')
140-
// init the weex instance.
141-
weex.init(Vue)
142-
// import your .vue App.
143-
const App = require('App.vue')
144-
// must have a '#root' element in your html body.
145-
App.$el = '#root'
146-
// instantiate
147-
new App()
148-
```
149-
150-
> If import the UMD formated bundle to the html, then you dont't have to call `init` manually.
151-
152-
```html
153-
<script>{{Vue runtime}}</script>
154-
<script>{{weex-vue-render}}</script>
155-
<script>{{your web.bundle.js}}</script>
133+
# build for weex-vue-render package
134+
npm run build
135+
# debug and serve examples
136+
npm run dev
137+
# build and run test cases
138+
npm run test
156139
```
157-
158-
### pack your .vue file to web.bundle.js
159-
160-
> You should pack your web.bundle.js and native.bundle.js separately. Use weex-loader for native packing and use vue-loader for web packing.
161-
162-
Use [vue-loader](https://github.com/vuejs/vue-loader) to pack your code for web.bundle.js.
163-
164-
If you are using weex-vue-render@**1.x** , You should definitely use below plugins to get things work:
165-
166-
* weex-vue-precompiler
167-
* autoprefixer
168-
* postcss-plugin-weex
169-
* postcss-plugin-px2rem
170-
171-
> We use weex-vue-precompiler instead of `$processStyle` in 1.x verison.
172-
173-
Now, how to use this plugins to pack you web.bundle.js ? We use them in the vue-loader option.
174-
175-
Here is a vue-loader option example:
176-
177-
```javascript
178-
{ // webpack config.
179-
vue: {
180-
optimizeSSR: false,
181-
postcss: [
182-
// to convert weex exclusive styles.
183-
require('postcss-plugin-weex')(),
184-
require('autoprefixer')({
185-
browsers: ['> 0.1%', 'ios >= 8', 'not ie < 12']
186-
}),
187-
require('postcss-plugin-px2rem')({
188-
// base on 750px standard.
189-
rootValue: 75,
190-
// to leave 1px alone.
191-
minPixelValue: 1.01
192-
})
193-
],
194-
compilerModules: [
195-
{
196-
postTransformNode: el => {
197-
// to convert vnode for weex components.
198-
require('weex-vue-precompiler')()(el)
199-
}
200-
}
201-
]
202-
}
203-
}
204-
```
205-
206-
> You should use a .js file as your webpack entry, not the Main.vue or App.vue file.
207-
208-
The content of your entry file `main.js` should be like this:
209-
210-
```javascript
211-
// import Vue runtime if you like.
212-
// import weex-vue-render if you like.
213-
// init weex if you imported it.
214-
// at least it should have this:
215-
import App from './your/App.vue'
216-
App.el = '#root'
217-
new Vue(App)
218-
```
219-
220-
## How to Migrate from 0.12.x to 1.x
221-
222-
> Why should I update to 1.x ?
223-
224-
The answer is **enoumouse change in rendering performance** with a few minor updates in your code is definitely worth to try.
225-
226-
### packing configuration
227-
228-
You should use the previous mentioned plugins in your vue-loader configuration.
229-
230-
### check your code
231-
232-
| category | rules | 0.12.x | 1.x |
233-
| --- | ---- | ------ | ----- |
234-
| **render function** | events binding | none | should add attrs as `data-evt-xxevent`. e.g. If binding a `appear` listener, you should add `attrs: { 'data-evt-appear': '' }` to your render data. |
235-
| | `click` event | none | should bind `weex$tap` event on web platform, and `click` event in other platforms. |
236-
| | tag name | none | when you use `createElement` to create a `image` element, you should create a `figure` element in web platform. With `text` you should use `p`. |
237-
| | attribute `src` for `img` | none | when you `createElement`, use a extra attr `data-img-src` for `figure` element, value of which is exactly the same as value of `src`. |
238-
| **styles** | style binding | none | better performance for binding object literal like `:style="{width:w,height:h}"` instead of object variable like `:style="someObj"` |
239-
| | styles in `animation.transition` | none | should add css prefix manualy if needed. We suggest you use [transition](https://weex-project.io/references/common-style.html#transition-v0-16-0) to implement animation. |
240-
| **events** | to emit a click event | just $emit a click event | you should $emit `weex$tap` event on web platform. |
241-
| | to emit a scroll event | just $emit a scroll event | you should $emit `weex$scroll` event on web platform. |
242-
| **exclusive styles** | limit | none | wirte them in `<style>` tag for better performance. |
243-
| | image attr: 'resize' | none | due to involving style changing, the 'resize' attribute shouldn't be a attribute binding like `:resize="someVar"`, instead you should use static attribute like `resize="cover"`. In other words, it shouldn't be updated. |
244-
| **ref** | what `this.$refs.xx` will get | always instance of VueComponent | HTMLElement for div, image and text; VueComponent for other components. |

packages/weex-vue-render/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "weex-vue-render",
3-
"version": "1.0.7",
4-
"description": "Web renderer for weex project.",
3+
"version": "1.0.8",
4+
"description": "Web renderer for weex project written in Vue DSL.",
55
"license": "Apache-2.0",
66
"main": "dist/index.common.js",
77
"repository": {
88
"type": "git",
9-
"url": "[email protected]:MrRaindrop/weex-vue-render.git"
9+
"url": "[email protected]:weexteam/weex-vue-render.git"
1010
},
11-
"homepage": "https://github.com/MrRaindrop/weex-vue-render",
11+
"homepage": "https://github.com/weexteam/weex-vue-render",
1212
"bugs": {
13-
"url": "https://github.com/MrRaindrop/weex-vue-render/issues"
13+
"url": "https://github.com/weexteam/weex-vue-render/issues"
1414
},
1515
"keywords": [
1616
"weex",

0 commit comments

Comments
 (0)