Skip to content

Commit

Permalink
Auto update
Browse files Browse the repository at this point in the history
  • Loading branch information
shenyunjie committed Nov 10, 2017
1 parent b706d15 commit ad2592b
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 32 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miox",
"version": "5.1.8",
"version": "5.1.9",
"description": "[Modern infrastructure of complex SPA] Miox 可以自动帮你处理路由切换、webview 生命周期管理等各种单页应用会面临的问题,让你专注于 webview 内的业务开发。Miox 实现了生命周期和路由管理的最佳实践,避免了不统一的开发方式可能造成的性能下降和错误,并且可以平滑接入",
"author": "沈赟杰",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/miox-animation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miox-animation",
"version": "5.1.8",
"version": "5.1.9",
"main": "build/index.js",
"files": [
"build",
Expand Down
2 changes: 1 addition & 1 deletion src/miox-compose/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miox-compose",
"version": "5.1.8",
"version": "5.1.9",
"main": "build/index.js",
"files": [
"build",
Expand Down
2 changes: 1 addition & 1 deletion src/miox-css/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miox-css",
"version": "5.1.8",
"version": "5.1.9",
"description": "miox css",
"main": "index.css",
"author": "沈赟杰",
Expand Down
2 changes: 1 addition & 1 deletion src/miox-koa-vue2x-server-render/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miox-koa-vue2x-server-render",
"version": "5.1.8",
"version": "5.1.9",
"main": "build/index.js",
"files": [
"build",
Expand Down
2 changes: 1 addition & 1 deletion src/miox-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miox-react",
"version": "5.1.8",
"version": "5.1.9",
"main": "build/index.js",
"files": [
"build",
Expand Down
4 changes: 2 additions & 2 deletions src/miox-router/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "miox-router",
"version": "5.1.8",
"version": "5.1.9",
"main": "build/index.js",
"files": [
"build",
"package.json"
],
"dependencies": {
"path-to-regexp": "^2.0.0",
"miox-compose": "^5.1.8"
"miox-compose": "^5.1.9"
}
}
4 changes: 2 additions & 2 deletions src/miox-vue2x-classify/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "miox-vue2x-classify",
"version": "5.1.8",
"version": "5.1.9",
"main": "build/index.js",
"files": [
"build",
"package.json"
],
"peerDependencies": {
"vue": "^2.5.2"
"vue": "^2.x"
}
}
4 changes: 2 additions & 2 deletions src/miox-vue2x-container/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miox-vue2x-container",
"version": "5.1.8",
"version": "5.1.9",
"main": "build/index.js",
"files": [
"build",
Expand All @@ -10,6 +10,6 @@
"is-class": "0.0.4"
},
"peerDependencies": {
"vue": "^2.5.2"
"vue": "^2.x"
}
}
2 changes: 1 addition & 1 deletion src/miox-vue2x-webpack-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miox-vue2x-webpack-config",
"version": "5.1.8",
"version": "5.1.9",
"main": "build/index.js",
"files": [
"build",
Expand Down
4 changes: 2 additions & 2 deletions src/miox-vue2x/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miox-vue2x",
"version": "5.1.8",
"version": "5.1.9",
"main": "build/index.js",
"files": [
"build",
Expand All @@ -10,6 +10,6 @@
"is-class": "0.0.4"
},
"peerDependencies": {
"vue": "^2.5.2"
"vue": "^2.x"
}
}
8 changes: 3 additions & 5 deletions src/miox/build/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,9 @@ var Miox = function (_MiddleWare) {
while (1) {
switch (_context6.prev = _context6.next) {
case 0:
_context6.next = 2;
return _this3.push(value.url);

case 2:
return _context6.abrupt('return', _context6.sent);
_this3.redirectAction = true;
_context6.next = 3;
return _this3.go(value.url);

case 3:
case 'end':
Expand Down
21 changes: 13 additions & 8 deletions src/miox/build/lib/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ exports.default = function () {

case 97:
if (!(app.history.stacks.length > app.options.max)) {
_context4.next = 108;
_context4.next = 111;
break;
}

Expand All @@ -552,15 +552,20 @@ exports.default = function () {
return _context4.abrupt('break', 105);

case 105:
if (!(app.webView !== remindExtra)) {
_context4.next = 108;
if (!(app.redirectAction && app.webView === remindExtra)) {
_context4.next = 109;
break;
}

_context4.next = 108;
delete app.redirectAction;
_context4.next = 111;
break;

case 109:
_context4.next = 111;
return destroyWebViews(remindExtra);

case 108:
case 111:

/**
* 此时我们可以完全认定,
Expand All @@ -581,13 +586,13 @@ exports.default = function () {

if (app.tick) delete app.tick;
// 触发额外事件
_context4.next = 114;
_context4.next = 117;
return resolveEventEmitter(webViews.events);

case 114:
case 117:
return _context4.abrupt('return', webViews.activeWebView);

case 115:
case 118:
case 'end':
return _context4.stop();
}
Expand Down
4 changes: 2 additions & 2 deletions src/miox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miox",
"version": "5.1.8",
"version": "5.1.9",
"main": "build/index.js",
"files": [
"build",
Expand All @@ -9,7 +9,7 @@
"dependencies": {
"flatten": "^1.0.2",
"is-class": "0.0.4",
"miox-compose": "^5.1.8",
"miox-compose": "^5.1.9",
"url": "^0.11.0"
}
}
5 changes: 4 additions & 1 deletion src/miox/src/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,10 @@ export default class Miox extends MiddleWare {
if (this.env === 'server') {
throw value;
} else {
return async () => await this.push(value.url);
return async () => {
this.redirectAction = true;
await this.go(value.url);
}
}
} else {
try{
Expand Down
6 changes: 5 additions & 1 deletion src/miox/src/lib/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,11 @@ export default async(app, engine, webview, data) => {
break;
}

if (app.webView !== remindExtra) {
// 如果是redirect:302,同时之前的webview与现在新增的webview是同一个,
// 那么我们不销毁
if (app.redirectAction && app.webView === remindExtra) {
delete app.redirectAction;
} else {
await destroyWebViews(remindExtra);
}
}
Expand Down

0 comments on commit ad2592b

Please sign in to comment.