Skip to content

Commit

Permalink
vendor redux-first-router-link forwardRef support
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Feb 20, 2023
1 parent 34f07d9 commit 84eb5b3
Show file tree
Hide file tree
Showing 11 changed files with 312 additions and 33 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build
vendor
static/app/js
22 changes: 12 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/map-gl-native/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/material-native/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/react/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
/components/
/inputs/
/views/
/vendor/
/__tests__/
7 changes: 4 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"scripts": {
"test": "cd ../../ && npm run jest packages/react",
"build": "npm run babel && npm run prettier",
"rollup": "cd ../../ && npm run rollup -- -c packages/react/rollup.config.js",
"babel": "cd ../../ && npm run babel -- packages/react/src --out-dir packages/react/",
"prettier": "cd ../../ && npm run prettier -- --write packages/react/",
"lint": "cd ../../ && npm run eslint packages/react/{,src/,src/*/,src/*/*/}*.js"
Expand All @@ -34,12 +35,12 @@
"formik": "^2.2.9",
"param-case": "^3.0.4",
"pascal-case": "^3.1.2",
"react-redux": "^8.0.5",
"redux-first-router-link": "^2.1.1"
"react-redux": "^8.0.5"
},
"devDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-test-renderer": "^18.2.0"
"react-test-renderer": "^18.2.0",
"redux-first-router-link": "https://github.com/faceyspacey/redux-first-router-link/archive/e68b143.tar.gz"
}
}
30 changes: 30 additions & 0 deletions packages/react/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import babel from "@rollup/plugin-babel";

export default [
{
input: "node_modules/redux-first-router-link/src/index.js",
plugins: [
babel({
plugins: ["@babel/plugin-transform-flow-strip-types"],
}),
{
resolveId(id) {
if (
id === "rudy-history/PathUtils" ||
id === "redux-first-router" ||
id === "rudy-match-path"
) {
return {
id: "./redux-first-router.js",
external: true,
};
}
},
},
],
external: ["react", "react-redux"],
output: {
file: "packages/react/src/vendor/redux-first-router-link.js",
},
},
];
6 changes: 2 additions & 4 deletions packages/react/src/components/ButtonLink.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from "react";
import * as ReduxFirstRouterLink from "redux-first-router-link";

const { NavLink } = ReduxFirstRouterLink;
import Link from "./Link.js";

export default function ButtonLink(props) {
return (
<NavLink
<Link
style={{
textDecoration: "none",
border: "1px solid #eee",
Expand Down
10 changes: 2 additions & 8 deletions packages/react/src/components/Link.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
import React from "react";
import * as ReduxFirstRouterLink from "redux-first-router-link";

const { NavLink } = ReduxFirstRouterLink;

export default function Link(props) {
return <NavLink {...props} />;
}
import { NavLink as Link } from "../vendor/redux-first-router-link.js";
export default Link;
Loading

0 comments on commit 84eb5b3

Please sign in to comment.