Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] feat: upgrade history v5 #5626

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/preset-built-in/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"cliui": "6.0.0",
"es5-imcompatible-versions": "^0.1.62",
"fork-ts-checker-webpack-plugin": "5.0.12",
"history-with-query": "4.10.3",
"@umijs/history": "5.0.0-beta.1",
"joi2types": "~1.0.7",
"merge-stream": "2.0.0",
"multer": "1.4.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/preset-built-in/src/plugins/features/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default (api: IApi) => {
),
// 替换成带 query 的 history
// 由于用了 query-string,会额外引入 7.6K(压缩后,gzip 前),考虑换轻量的实现
history: dirname(require.resolve('history-with-query/package.json')),
history: dirname(require.resolve('@umijs/history/package.json')),
},
},
});
Expand Down
2 changes: 1 addition & 1 deletion packages/renderer-react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FunctionComponent } from 'react';
import { History, Location } from 'history-with-query';
import { History, Location } from '@umijs/history';
import { match } from 'react-router-dom';

export interface IComponent extends FunctionComponent {
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"dependencies": {
"@types/react-router": "5.1.8",
"@types/react-router-dom": "5.1.5",
"history-with-query": "4.10.3",
"@umijs/history": "5.0.0-beta.1",
"react-router": "5.2.0",
"react-router-dom": "5.2.0",
"use-subscription": "1.4.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export {
createBrowserHistory,
createHashHistory,
createMemoryHistory,
} from 'history-with-query';
export type { MemoryHistory } from 'history-with-query';
} from '@umijs/history';
export type { MemoryHistory } from '@umijs/history';

export { default as Plugin, ApplyPluginsType } from './Plugin/Plugin';
export { default as dynamic } from './dynamic/dynamic';
2 changes: 1 addition & 1 deletion packages/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import webpack from 'webpack';
import WebpackChain from 'webpack-chain';
import { Express, NextFunction, RequestHandler } from 'express';
import { Request, Response } from 'express-serve-static-core';
import { History, Location } from 'history-with-query';
import { History, Location } from '@umijs/history';

export enum BundlerConfigType {
csr = 'csr',
Expand Down
34 changes: 19 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,13 @@
dependencies:
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.7.6":
version "7.12.5"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e"
integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg==
dependencies:
regenerator-runtime "^0.13.4"

"@babel/template@^7.10.4":
version "7.10.4"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.10.4.tgz#3251996c4200ebc71d1a8fc405fba940f36ba278"
Expand Down Expand Up @@ -3826,6 +3833,14 @@
stylelint-declaration-block-no-ignored-properties "^2.1.0"
stylelint-order "^3.0.0"

"@umijs/history@5.0.0-beta.1":
version "5.0.0-beta.1"
resolved "https://registry.yarnpkg.com/@umijs/history/-/history-5.0.0-beta.1.tgz#82820802f558e56d7468ec7e4a3edcd4e332aee9"
integrity sha512-kNLvy+LJB7/AWAKMV5bACsRpIlPdpOckXlyWSPrTI07ytdIG+kbW/J25OgtFlgjvZunFOVXtkxYLYNoAsxyQ4g==
dependencies:
"@babel/runtime" "^7.7.6"
query-string "^6.13.6"

"@umijs/plugin-analytics@^0.2.2":
version "0.2.2"
resolved "https://registry.yarnpkg.com/@umijs/plugin-analytics/-/plugin-analytics-0.2.2.tgz#575fd231d4327ea13413217aa1b5fc6bdd89465e"
Expand Down Expand Up @@ -8198,18 +8213,6 @@ hex-color-regex@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e"

history-with-query@4.10.3:
version "4.10.3"
resolved "https://registry.yarnpkg.com/history-with-query/-/history-with-query-4.10.3.tgz#9430a6f59a223796a68a436c0c4c7590233805a6"
dependencies:
"@babel/runtime" "^7.1.2"
loose-envify "^1.2.0"
query-string "^6.11.0"
resolve-pathname "^3.0.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"
value-equal "^1.0.1"

history@^4.9.0:
version "4.10.1"
resolved "https://registry.yarnpkg.com/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3"
Expand Down Expand Up @@ -12678,9 +12681,10 @@ query-string@^4.1.0:
object-assign "^4.1.0"
strict-uri-encode "^1.0.0"

query-string@^6.11.0:
version "6.12.0"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.12.0.tgz#fa0fe5b3ddf4d040d1236b80672949ab33d5cf80"
query-string@^6.13.6:
version "6.13.6"
resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.13.6.tgz#e5ac7c74f2a5da43fbca0b883b4f0bafba439966"
integrity sha512-/WWZ7d9na6s2wMEGdVCVgKWE9Rt7nYyNIf7k8xmHXcesPMlEzicWo3lbYwHyA4wBktI2KrXxxZeACLbE84hvSQ==
dependencies:
decode-uri-component "^0.2.0"
split-on-first "^1.0.0"
Expand Down