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

Avoid importing the whole of react-icons (if treeshaking is broken) #3046

Merged
merged 15 commits into from
Sep 1, 2022
Merged
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ should change the heading of the (upcoming) version to include a major version b
- Upgraded from the `1.x` to `2.x` version of `semantic-ui-react`
- Added support for `schema.examples` in the material ui theme fixing (https://github.com/rjsf-team/react-jsonschema-form/issues/2368, https://github.com/rjsf-team/react-jsonschema-form/issues/2557)

## @rjsf/bootstrap-4
- Avoid importing the whole of `react-icons` (https://github.com/rjsf-team/react-jsonschema-form/pull/3046)
fregante marked this conversation as resolved.
Show resolved Hide resolved

## Dev / docs / playground
- Fixed missing `playground` import error by adding `source-map-loader`
- Fixed up the incorrectly formatted `5.x Migration Guide`
Expand Down
32 changes: 20 additions & 12 deletions packages/bootstrap-4/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/bootstrap-4/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@
],
"license": "MIT",
"dependencies": {
"react-icons": "^4.4.0"
"@react-icons/all-files": "^4.1.0"
}
}
2 changes: 1 addition & 1 deletion packages/bootstrap-4/src/AddButton/AddButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";

import { IconButtonProps } from "@rjsf/utils";
import Button from "react-bootstrap/Button";
import { BsPlus } from "react-icons/bs";
import { BsPlus } from "@react-icons/all-files/bs/BsPlus";

const AddButton: React.ComponentType<IconButtonProps> = (props) => (
<Button
Expand Down
5 changes: 3 additions & 2 deletions packages/bootstrap-4/src/IconButton/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from "react";
import { IconButtonProps } from "@rjsf/utils";
import Button, { ButtonProps } from "react-bootstrap/Button";
import { IoIosRemove } from "react-icons/io";
import { AiOutlineArrowUp, AiOutlineArrowDown } from "react-icons/ai";
import { IoIosRemove } from "@react-icons/all-files/io/IoIosRemove";
import { AiOutlineArrowUp } from "@react-icons/all-files/ai/AiOutlineArrowUp";
import { AiOutlineArrowDown } from "@react-icons/all-files/ai/AiOutlineArrowDown";

const IconButton = (props: IconButtonProps & ButtonProps) => {
const { icon, iconType, className, ...otherProps } = props;
Expand Down