You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JsonFormsAngularService is not provided in the root anymore.
1
+
# Migration guide
2
+
3
+
## Migrating to JSON Forms 3.0 for React users
4
+
5
+
With version 3.0 of JSON Forms, we removed the `json-schema-ref-parser` dependency within the core package.
6
+
This change only affects users of the React variant, Vue and Angular users are not affected.
7
+
8
+
`json-schema-ref-parser` was used to resolve external JSON Schema references.
9
+
As a side effect it also resolved 'internal' references and therefore simplified the JSON Schema for JSON Forms' processing.
10
+
However that resolving was quite slow, the JSON Schema was mutated in place and `json-schema-ref-parser` brought in Node-only dependencies which needed to be polyfilled.
11
+
Also all users of JSON Forms React had to pay the resolving effort, whether they needed it or not.
12
+
13
+
Most React users should be unaffected by this change and don't need to spend any migration efforts.
14
+
However when you relied on the resolving of external JSON Schema references via the `refParserOptions` or use complicated references setups which can't yet be handled by JSON Forms' internal processing, you can resolve the JSON Schema before handing it over to JSON Forms.
15
+
16
+
Note that we're aware of some regressions caused by removing `json-schema-ref-parser` which occur when not handing over a resolved JSON Schema to JSON Forms.
17
+
We're working on removing these edge cases during the JSON Forms 3.0 alpha period.
18
+
You can always restore the old behavior when following the approach described below.
19
+
20
+
To restore the old behavior, you can use `json-schema-ref-parser` or other libraries like `json-refs` to resolve references on your own before passing the schema to JSON Forms.
The complexity of the migration of an existing JSON Forms 1.x application, which is based on AngularJS, to JSON Forms 2.x depends on the feature set you use.
156
232
157
-
## Architectural changes in JSON Forms 2.x
233
+
### Architectural changes in JSON Forms 2.x
234
+
158
235
There are two big changes between JSON Forms 1 and JSON Forms 2 you need to understand when migrating your existing application.
159
236
160
237
1. JSON Forms 2.x does not rely on any specific UI framework [or library]. The `2.0.0` initial release featured renderers based on [React](https://reactjs.org). An [Angular](https://angular.io) based renderer set was released with `2.1.0`.
161
238
162
239
2. Since JSON Forms 2.x maintains its internal state via [redux](https://redux.js.org/), you will need to add it as a dependency to your application.
163
240
164
-
## Steps for upgrading your application to JSON Forms 2.x
241
+
### Steps for upgrading your application to JSON Forms 2.x
242
+
243
+
#### Step 1: Update your UI schemata
165
244
166
-
### Step 1: Update your UI schemata
167
245
There is only one minor change in the UI schemata. The UI Schema for controls was simplified and the bulky `ref` object inside `scope` was removed.
168
246
169
247
Instead of:
248
+
170
249
```ts
171
250
const uischema = {
172
251
type: 'Control',
@@ -175,20 +254,26 @@ const uischema = {
175
254
}
176
255
}
177
256
```
257
+
178
258
simply write:
259
+
179
260
```ts
180
261
const uischema = {
181
262
type: 'Control',
182
263
scope: '#/properties/name'
183
264
}
184
265
```
266
+
185
267
Otherwise the UI schema remains unchanged and works like in JSON Forms 1.x.
186
268
187
-
### Step 2: Use JSON Forms 2.x in your application
269
+
#### Step 2: Use JSON Forms 2.x in your application
270
+
188
271
As JSON Forms 2 does not rely on any specific UI framework or library you can choose which renderer set you want to use. The React Material renderer set is the most polished one at the moment, followed by Angular Material and the Vanilla renderer sets.
189
272
190
-
#### Use with React
191
-
Please refer to the React [Tutorial](http://jsonforms.io/docs/tutorial).
273
+
##### Use with React
274
+
275
+
Please refer to the React [tutorial](http://jsonforms.io/docs/tutorial).
276
+
277
+
#### Step 3: Migrate Custom Renderers
192
278
193
-
### Step 3: Migrate Custom Renderers
194
279
Any custom renderer needs to be re-factored to conform to the new custom renderer style in JSON Forms 2.x. You can find instructions how to implement Custom controls based on React [here](http://jsonforms.io/docs/custom-renderers). While you need to change a lot except for the template, the good news it that writing custom renderers became much simpler in JSON Forms 2 since the framework will trigger rendering and re-rendering in case of changes to the data or other state. In many cases this means you will be able to streamline your code for custom renderers significantly.
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,12 @@ Please see the official JSON Forms website, [jsonforms.io](https://jsonforms.io)
15
15
For more info about the seed app, please see the corresponding README file of the [seed repo](https://github.com/eclipsesource/jsonforms-react-seed).
16
16
For a more detailed tutorial about the usage of JSON Forms, please see [this tutorial](http://jsonforms.io/docs/tutorial).
17
17
18
+
## Upgrading to JSON Forms 3.0 Alpha
19
+
20
+
With version 3.0 of JSON Forms we removed `json-schema-ref-parser` from the core package.
21
+
This change only affects users of the React variant (Vue and Angular are not affected) and even for React only a few users will need to adjust their code.
22
+
To avoid issues and for more information, please have a look at our [migration guide](https://github.com/eclipsesource/jsonforms/blob/master/MIGRATION.md).
23
+
18
24
## Feedback, Help and Support
19
25
20
26
If you encounter any problems feel free to [open an issue](https://github.com/eclipsesource/jsonforms/issues/new/choose) on the repo.
0 commit comments