8000 feat: <router-view> nested in <Frame> (#286) · ukik/nativescript-vue@4738789 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4738789

Browse files
bundyorigor789
authored andcommitted
feat: <router-view> nested in <Frame> (nativescript-vue#286)
* chore: update backers * feat: Starting router chores * horror: Juggling router-views * fix: rollup * fix: Add a missing method. * add: frame transition support * fix: back transition not detected add: back transition auto flips direction (for predefined {N} transitions) - configurable with back-transition="flip|mirror" - default: flip. * chore: Remove some nextTicks that are seemingly not needed. chore: cache regexps. add: Try adding some profiling stats. * add: remove buble in order to use ES2015+ as both Android and iOS engines are quite new. add: Add some ES2015+ operators where possible add: return elements where they should be returnes add: start implementing support for push/replace/go with animation object. fix: change one deprecated command * fix: specifying Page transition on push/replace/go. chore: convert NativeScriptHistory to class. * fix: remove the back-transition setting, as it breaks page reusability. This breaks ListView events after back navigation though. * fix: the back problem (hopefully) - needs more testing first * fix: remove buble references fix: speed up default slide transitions to match Angular ones add: prop.decode modifier to decode HTML entities * fix: the page is still reactive while leaving it - causes changes to $route to be visible. * fix: really destroy the page when it should be (previous on back navigation) * fix: router back on app root * fix: iOS back button skips the router chore: some formatting * fix: rename transition props to ios:transition and android:transition
1 parent 3700b52 commit 4738789

File tree

14 files changed

+410
-198
lines changed

14 files changed

+410
-198
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ and these awesome backers:
6464
- Andy Drexler
6565
- ChiwalahSoftware
6666
- Nayir Chami
67+
- Teon Ooi
6768

6869
If you'd like to join them, please consider [becoming a backer / sponsor on Patreon](https://www.patreon.com/rigor789).
6970

build/config.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const alias = require('rollup-plugin-alias')
22
const commonjs = require('rollup-plugin-commonjs')
33
const resolve = require('rollup-plugin-node-resolve')
4-
const buble = require('rollup-plugin-buble')
54
const replace = require('rollup-plugin-replace')
65
const flow = require('rollup-plugin-flow-no-whitespace')
76
const path = require('path')
@@ -65,6 +64,9 @@ const genConfig = (name) => {
6564
treeshake: {
6665
pureExternalModules: id => id.startsWith('weex')
6766
},
67+
watch: {
68+
chokidar: false
69+
},
6870
plugins: [
6971
replace({
7072
__WEEX__: false,
@@ -75,11 +77,6 @@ const genConfig = (name) => {
7577
'process.env.NS_VUE_VERSION': `'${NSVueVersion}'`
7678
}),
7779
flow(),
78-
buble({
79-
transforms: {
80-
dangerousForOf: true
81-
}
82-
}),
8380
alias(aliases),
8481
resolve(),
8582
commonjs(),

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"test": "jest",
1212
"tdd": "jest --watch",
1313
"samples": "node build/sample-runner.js",
14-
"dev": "rollup -c build/config.js -w --o samples/app/nativescript-vue.js --environment TARGET:nativescript-vue",
14+
"dev": "rollup -c build/config.js -w --o dist/index.js --environment TARGET:nativescript-vue",
1515
"build": "node build/build.js",
1616
"build:docs": "cd docs && npm run build",
1717
"prettier": "prettier --no-semi --single-quote --write \"{{platform,__test__}/**/*.js,samples/app/*.js}\"",
@@ -37,8 +37,8 @@
3737
"homepage": "https://github.com/rigor789/nativescript-vue#readme",
3838
"nativescript": {
3939
"platforms": {
40-
"android": "3.4.0",
41-
"ios": "3.4.0"
40+
"android": "4.1.2",
41+
"ios": "4.1.0"
4242
},
4343
"plugin": {
4444
"vue": "true",
@@ -64,18 +64,17 @@
6464
"jest-junit": "^3.5.0",
6565
"lint-staged": "^6.1.0",
6666
"prettier": "^1.10.2",
67-
"rollup": "^0.55.3",
67+
"rollup": "^0.62.0",
6868
"rollup-plugin-alias": "^1.4.0",
69-
"rollup-plugin-buble": "^0.18.0",
70-
"rollup-plugin-commonjs": "^8.3.0",
69+
"rollup-plugin-commonjs": "^9.1.3",
7170
"rollup-plugin-flow-no-whitespace": "^1.0.0",
72-
"rollup-plugin-node-resolve": "^3.0.2",
71+
"rollup-plugin-node-resolve": "^3.3.0",
7372
"rollup-plugin-replace": "^2.0.0",
7473
"rollup-plugin-resolve-aliases": "^0.2.0",
7574
"rollup-watch": "^4.3.1",
7675
"semver": "^5.5.0",
7776
"set-value": "^2.0.0",
78-
"tns-core-modules": "4.0.0",
77+
"tns-core-modules": "4.1.0",
7978
"util-inspect": "^0.1.8",
8079
"vue": "^2.5.16"
8180
},

platform/nativescript/element-registry.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import * as builtInComponents from './runtime/components'
22

33
const elementMap = new Map()
4+
const nativeRegExp = /Native/gi
5+
const dashRegExp = /-/g
46

57
const defaultViewMeta = {
68
skipAddToDom: false,
@@ -13,8 +15,8 @@ const defaultViewMeta = {
1315

1416
export function normalizeElementName(elementName) {
1517
return `native${elementName
16-
.replace(/Native/gi, '')
17-
.replace(/-/g, '')
18+
.replace(nativeRegExp, '')
19+
.replace(dashRegExp, '')
1820
.toLowerCase()}`
1921
}
2022

platform/nativescript/framework.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import application from 'tns-core-modules/application'
99
import Vue from './runtime/index'
1010
import ModalPlugin from './plugins/modal-plugin'
1111
import NavigatorPlugin from './plugins/navigator-plugin'
12-
// import RouterPlugin from './plugins/router-plugin'
12+
import RouterPlugin from './plugins/router-plugin'
1313

1414
import { setVue } from './util'
1515

@@ -19,18 +19,20 @@ setVue(Vue)
1919

2020
Vue.use(ModalPlugin)
2121
Vue.use(NavigatorPlugin)
22-
// Vue.use(RouterPlugin)
22+
Vue.use(RouterPlugin)
23+
24+
const newLineRegExp = /\\n/g
2325

2426
console.log = (function(log, inspect, Vue) {
25-
return function() {
26-
return log.apply(
27+
return function(...args) {
28+
return log.call(
2729
this,
28-
Array.prototype.map.call(arguments, function(arg) {
30+
...Array.prototype.map.call(args, function(arg) {
2931
return inspect(arg, {
3032
depth: 2,
3133
colors: Vue.config.debug,
3234
showHidden: true
33-
}).replace(/\\n/g, '\n')
35+
}).replace(newLineRegExp, '\n')
3436
})
3537
)
3638
}

0 commit comments

Comments
 (0)
0