Commit 3e00ae94 by Wee

refactor: basic implement live and scroll resume.

parent 9703b4b5
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var LiveRoute_1 = require("./LiveRoute");
exports.default = LiveRoute_1.LiveRoute;
exports.default = LiveRoute_1.default;
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;AAAA,yCAAuC;AAEvC,kBAAe,qBAAS,CAAA"}
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;AAAA,yCAAmC;AAEnC,kBAAe,mBAAS,CAAA"}
\ No newline at end of file
{
"name": "react-live-route",
"version": "2.0.7",
"version": "3.0.0",
"description": "A living route for react-router v4",
"repository": "fi3ework/react-live-route",
"license": "MIT",
......@@ -17,8 +17,8 @@
"test:watch": "jest --watch"
},
"peerDependencies": {
"react": ">=15",
"react-router-dom": ">=4 < 4.4"
"react": ">=16.3",
"react-router-dom": ">=4"
},
"files": [
"dist/"
......@@ -28,13 +28,11 @@
"invariant": "^2.2.4",
"prop-types": "^15.6.1",
"react-is": "^16.7.0",
"tiny-invariant": "^1.0.3",
"tiny-warning": "^1.0.2",
"warning": "^4.0.1"
},
"devDependencies": {
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"@types/jest": "^24.0.9",
"@types/react": "^16.7.18",
"@types/react-dom": "^16.0.11",
......@@ -42,6 +40,10 @@
"coveralls": "^3.0.3",
"jest": "^24.5.0",
"jest-environment-jsdom": "^24.5.0",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-testing-library": "^6.0.0",
"ts-jest": "^24.0.0",
"tslint": "^5.14.0",
......
import { LiveRoute } from './LiveRoute'
import LiveRoute from './LiveRoute'
export default LiveRoute
// import pathToRegexp from 'path-to-regexp'
// const cache = {}
// const cacheLimit = 10000
// let cacheCount = 0
// function compilePath(path, options) {
// const cacheKey = `${options.end}${options.strict}${options.sensitive}`
// const pathCache = cache[cacheKey] || (cache[cacheKey] = {})
// if (pathCache[path]) return pathCache[path]
// const keys = []
// const regexp = pathToRegexp(path, keys, options)
// const result = { regexp, keys }
// if (cacheCount < cacheLimit) {
// pathCache[path] = result
// cacheCount++
// }
// return result
// }
// /**
// * Public API for matching a URL pathname to a path.
// */
// function matchPath(pathname, options = {}) {
// if (typeof options === 'string') options = { path: options }
// const { path, exact = false, strict = false, sensitive = false } = options
// const paths = [].concat(path)
// return paths.reduce((matched, path) => {
// if (matched) return matched
// const { regexp, keys } = compilePath(path, {
// end: exact,
// strict,
// sensitive
// })
// const match = regexp.exec(pathname)
// if (!match) return null
// const [url, ...values] = match
// const isExact = pathname === url
// if (exact && !isExact) return null
// return {
// path, // the path used to match
// url: path === '/' && url === '' ? '/' : url, // the matched portion of the URL
// isExact, // whether or not we matched exactly
// params: keys.reduce((memo, key, index) => {
// memo[key.name] = values[index]
// return memo
// }, {})
// }
// }, null)
// }
// export default matchPath
{
"compilerOptions": {
"baseUrl": ".",
"paths": { "*": ["types/*"] },
"alwaysStrict": true,
"declaration": true,
"removeComments": false,
......
{
"extends": ["tslint-config-alloy", "tslint-config-prettier"]
"extends": ["tslint-config-alloy", "tslint-config-prettier"],
"rules": {
"no-non-null-assertion": false
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment