Skip to content

Commit

Permalink
feat(v3): navigator
Browse files Browse the repository at this point in the history
  • Loading branch information
fxy060608 committed Oct 14, 2019
1 parent 5c1d23b commit 5b4abb6
Show file tree
Hide file tree
Showing 60 changed files with 26,794 additions and 44,318 deletions.
4 changes: 2 additions & 2 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ if (process.env.UNI_PLATFORM === 'app-plus' && process.env.UNI_VIEW === 'true')
filename = 'view'
entry = './lib/' + process.env.UNI_PLATFORM + '/view.js'
}

service.run('build', {
name,
filename,
watch: process.env.UNI_WATCH === 'true',
target: 'lib',
formats: process.env.UNI_WATCH === 'true' ? 'umd' : 'umd-min',
entry,
clean: !process.env.UNI_VIEW
clean: !process.env.UNI_VIEW,
mode: process.env.NODE_ENV
}).then(function () {
if (process.env.UNI_UI !== 'true' && process.env.UNI_VIEW !== 'true') {
generateApiManifest(
Expand Down
10 changes: 7 additions & 3 deletions build/rollup.config.app.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,24 @@ if (process.env.UNI_SERVICE === 'legacy') {
output.format = 'iife'
output.name = 'serviceContext'
output.banner =
`export function createServiceContext(Vue, weex, plus, __uniConfig, __uniRoutes, UniServiceJSBridge,instanceContext){
`export function createServiceContext(Vue, weex, plus, UniServiceJSBridge,instanceContext){
var localStorage = plus.storage
var setTimeout = instanceContext.setTimeout
var clearTimeout = instanceContext.clearTimeout
var setInterval = instanceContext.setInterval
var clearInterval = instanceContext.clearInterval
var clearInterval = instanceContext.clearInterval
var __uniConfig = instanceContext.__uniConfig
var __uniRoutes = instanceContext.__uniRoutes
`
output.footer =
`
var uni = serviceContext.uni
var getApp = serviceContext.getApp
var getCurrentPages = serviceContext.getCurrentPages
var __definePage = serviceContext.__definePage
var __registerPage = serviceContext.__registerPage
var __registerPage = serviceContext.__registerPage
return serviceContext \n}
`
Expand Down
3 changes: 2 additions & 1 deletion lib/apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ const third = [
'onPush',
'offPush',
'requireNativePlugin',
'upx2px'
'upx2px',
'registerPlus'
]

const apis = [
Expand Down
11 changes: 6 additions & 5 deletions lib/app-plus/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@ import 'uni-core/view/index.css'

import {
definePage
} from 'uni-platform/view/framework/page'
} from 'uni-platform/page-factory'

import {
registerConfig
} from 'uni-platform/view/framework/config'
getCurrentPages
} from 'uni-platform/view/framework/page'

import ViewPlugin from 'uni-platform/view/framework/plugins/index'

global.UniViewJSBridge = {
publishHandler: UniViewJSBridge.publishHandler,
subscribeHandler: UniViewJSBridge.subscribeHandler
}

global.getCurrentPages = getCurrentPages

global.__registerConfig = registerConfig
global.__registerPage = definePage
global.__definePage = definePage

global.Vue = Vue

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"build:app:v3": "npm run lint && npm run build:app:service && npm run dev:app:view",
"build:app:service": "cross-env UNI_PLATFORM=app-plus rollup -c build/rollup.config.app.js",
"build:app:view": "cross-env NODE_ENV=production UNI_WATCH=false UNI_PLATFORM=app-plus UNI_VIEW=true node build/build.js",
"dev:app:view": "cross-env NODE_ENV=production UNI_WATCH=true UNI_PLATFORM=app-plus UNI_VIEW=true node build/build.js",
"dev:app:view": "cross-env NODE_ENV=development UNI_WATCH=true UNI_PLATFORM=app-plus UNI_VIEW=true node build/build.js",
"build:app:nvue": "cross-env UNI_PLATFORM=app-plus-nvue rollup -c build/rollup.config.app.js",
"build:app:legacy": "cross-env UNI_PLATFORM=app-plus-nvue UNI_SERVICE=legacy rollup -c build/rollup.config.app.js",
"build:mp-qq": "cross-env UNI_PLATFORM=mp-qq rollup -c build/rollup.config.mp.js",
Expand Down
Loading

0 comments on commit 5b4abb6

Please sign in to comment.