-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
Added migration guide from 3 to 4 to docs #1395
Open
piotrpospiech
wants to merge
2
commits into
docs
Choose a base branch
from
migrating-3-to-4-docs
base: docs
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+38
−2
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
id: migrating-4-to-4 | ||
title: Migrating v3 to v4 | ||
sidebar_position: 4 | ||
--- | ||
|
||
This guide is designed to help you through the migration. If you went through it and encountered any problems - do let us know. For more information on why certain changes were made, see the [CHANGELOG.md](https://github.com/vazco/uniforms/blob/master/CHANGELOG.md). When migrating to v4, use the newest version. Gradual updates will take more time and won't ease this process. | ||
|
||
## Breaking API changes | ||
|
||
- `AutoFields` component in all themes now renders a `React.Fragment` instead of a `div`. Explicitly render a wrapper component around if you need one. | ||
- Dropped support for `initialCount` in bridges and `ListField`s. Pass a model object to the form with the appropriate amount of initial items instead. | ||
- Removed the `autoField` prop from `QuickForm`, `AutoForm`, and `AutoFields` components in all themes. Use `AutoField.componentDetectorContext.Provider` instead. | ||
- `componentDetector` in `AutoField` components now always takes precedence over `component` property on a schema. This may make your `AutoField` render a different component when you were using both previously. If that's the case, move your schema's `component` definition to a `AutoField.componentDetectorContext.Provider` instead. | ||
- The constructors for all our bridges now accept an object (e.g., `{schema, validator}`) instead of individual parameters. This applies to `SimpleSchema2Bridge`, `JSONSchemaBridge`, and `ZodBridge`. Please update your constructor calls accordingly. | ||
- `getInitialValue` returns empty array or object instead of `undefined` for `ListField` and `NestField`. | ||
- `Bridge.getProps` method accepts only `name` argument now. Additional arguments are no longer supported. | ||
- Replaced `allowedValues` with `options` prop | ||
- AntD theme uses `v5` of `antd` package. Update your project to use `v5` of `antd` package. | ||
- MUI theme uses `v6` of `@mui/material` package. Update your project to use `v6` of `@mui/material` package. | ||
- Initial render doesn't trigger individual field `onChange` functions anymore. [#1343](https://github.com/vazco/uniforms/pull/1343) | ||
|
||
## Deprecated packages | ||
|
||
The following packages are deprecated and are no longer supported in v4.0.0. | ||
|
||
- Deprecate `uniforms-bootstrap3` package | ||
- Deprecate `uniforms-material` package | ||
- Deprecate `uniforms-bridge-simple-schema` package | ||
- Deprecate `uniforms-bridge-graphql` package | ||
|
||
If you want to continue using these packages, you can use the following commands to download the latest version of the package: | ||
|
||
``` | ||
npx gitget https://github.com/vazco/uniforms/tree/v3.10.2/packages/<uniforms-package-name> | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We recommend using identical versions of all uniforms packages, so let's also point it out here so they won't use uniforms v4 with uniforms-material v3.