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

Plugin config update react-jsonschema-form #518

Closed

Conversation

webmasterkai
Copy link
Contributor

I noticed react-jsonschema-form was outdated so I updated. It moves to 1.x. The breaking change looks to be a switch to the ajv validator (rjsf-team/react-jsonschema-form/pull/711).

I needed the update because of some conditional field things I was trying to do.

The package-lock for the main app got an update based on previous changes to package.json.

@webmasterkai
Copy link
Contributor Author

Including monorepo code

@tkurki
Copy link
Member

tkurki commented Apr 21, 2018

So this is Work In Progress, not to be merged? I would have preferred unrelated stuff, like react-jsonschema-form version bump, separately.

@webmasterkai
Copy link
Contributor Author

I can just remove those commits.

@webmasterkai webmasterkai force-pushed the plugin-config-update branch from acac818 to 9ff4b80 Compare April 21, 2018 17:45
@webmasterkai
Copy link
Contributor Author

Okay, I think that worked. Removed extra commits. I did the following.

git checkout {commit-hash}
git push -f origin HEAD^:plugin-config-update

@tkurki
Copy link
Member

tkurki commented Apr 21, 2018

What kind of issues did you have with json loader? I assume it was there for a reason, but I can't vouch for that.

@webmasterkai
Copy link
Contributor Author

The webpack config was probably copy pasted from somewhere else. Since webpack >= v2.0.0, importing of JSON files will work by default so it's not needed.
Also the two files in src don't import json anyway so we're good there too. :-)

@webmasterkai
Copy link
Contributor Author

The problem was on npm run build

ERROR in ./node_modules/react-jsonschema-form/node_modules/ajv/lib/ajv.js
Module not found: Error: Can't resolve 'json' in '/Users/kaicurry/node/signalk-server-node/packages/plugin-config'
BREAKING CHANGE: It's no longer allowed to omit the '-loader' suffix when using loaders.
                 You need to specify 'json-loader' instead of 'json',
                 see https://webpack.js.org/guides/migrating/#automatic-loader-module-name-extension-removed
 @ ./node_modules/react-jsonschema-form/node_modules/ajv/lib/ajv.js 452:19-62
 @ ./node_modules/react-jsonschema-form/lib/validate.js
 @ ./node_modules/react-jsonschema-form/lib/components/Form.js
 @ ./node_modules/react-jsonschema-form/lib/index.js
 @ ./src/ConfigurationForm.jsx
 @ ./src/main.jsx
 @ multi whatwg-fetch ./src/main.jsx

It's an easy enough fix if the json loader is required but I don't see how it is.

@tkurki
Copy link
Member

tkurki commented Apr 22, 2018

I merged this as 5b21320, 5c2f760 and bd17c22.

  • rewrote the commit messages to include the reasoning & to change the commit title to be in line with others in this repo
  • moved plugin-config/package-lock.json update after the jsonschema version bump, because package.json change drives the package-lock change
  • removed the root package-lock.json update, as it was unrelated

Thanks!

@tkurki tkurki closed this Apr 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants