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

Feat/migrate sui react router to esm #1378

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions packages/sui-react-router/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
src
test
CHANGELOG.md
3 changes: 1 addition & 2 deletions packages/sui-react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@s-ui/react-router",
"version": "1.14.0",
"description": "",
"type": "module",
"main": "lib/index.js",
"scripts": {
"lib": "babel --presets sui ./src --out-dir ./lib",
Expand All @@ -16,8 +17,6 @@
"prop-types": "15",
"react": "16 || 17"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"classnames": "2.2.5",
Expand Down
1 change: 0 additions & 1 deletion packages/sui-react-router/src/.npmignore

This file was deleted.

10 changes: 6 additions & 4 deletions packages/sui-react-router/src/browserHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

// from: https://github.com/ReactTraining/react-router/blob/v3/modules/useRouterHistory.js
import canUseDOM from './internal/canUseDOM.js'
import createBrowserHistory from 'history/lib/createBrowserHistory'
import useBasename from 'history/lib/useBasename'
import useQueries from 'history/lib/useQueries'
import createMemoryHistory from './createMemoryHistory.js'
import {
createHistory as createBrowserHistory,
createMemoryHistory,
useBasename,
useQueries
} from 'history'

/** If we're on the server, we must be sure importing this file doesn't break anything */
const browserHistory = canUseDOM
Expand Down
8 changes: 5 additions & 3 deletions packages/sui-react-router/src/createMemoryHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

// from: https://github.com/ReactTraining/react-router/blob/v3/modules/createMemoryHistory.js

import useQueries from 'history/lib/useQueries'
import useBasename from 'history/lib/useBasename'
import baseCreateMemoryHistory from 'history/lib/createMemoryHistory'
import {
createMemoryHistory as baseCreateMemoryHistory,
useBasename,
useQueries
} from 'history'

export default function createMemoryHistory(options) {
// signatures and type checking differ between `useQueries` and
Expand Down
2 changes: 1 addition & 1 deletion packages/sui-react-router/src/match.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check
// from: https://github.com/ReactTraining/react-router/blob/v3/modules/match.js

import {REPLACE} from 'history/lib/Actions'
import {REPLACE} from 'history/lib/Actions.js'
import {fromReactTreeToJSON} from './internal/ReactUtils.js'
import {createTransitionManager} from './internal/createTransitionManager.js'
import {
Expand Down