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

Documentation for unpkg is incorrect #3262

Closed
4 tasks done
hughjdavey opened this issue Nov 29, 2022 · 7 comments
Closed
4 tasks done

Documentation for unpkg is incorrect #3262

hughjdavey opened this issue Nov 29, 2022 · 7 comments
Assignees

Comments

@hughjdavey
Copy link

hughjdavey commented Nov 29, 2022

Prerequisites

What theme are you using?

mui

Version

^4.1.1 locally but latest on the JSFiddle - https://jsfiddle.net/mdeazLy3/1/

Current Behavior

Error stacks are being truncated if a custom validation function is used, even if the function doesn't modify the errors object

Expected Behavior

Error stacks should stay the same

Steps To Reproduce

See this JSFiddle - https://jsfiddle.net/mdeazLy3/1/

  • Create a form with a schema
  • Look at the error list
  • Add a custom validate function
  • Look at the error list again and see the stacks are truncated

Environment

- OS: Windows 10
- Node: 16.x.x
- npm: 8.x.x

Anything else?

Form on the right has a custom validate function that does nothing (just returns errors as per the docs). The forms share a schema. To see the schema and the forms please see the JSFiddle here - https://jsfiddle.net/mdeazLy3/1/

image

@hughjdavey hughjdavey added bug needs triage Initial label given, to be assigned correct labels and assigned labels Nov 29, 2022
@hughjdavey hughjdavey changed the title <title> Error stacks are truncated when custom validation function is used Nov 29, 2022
@heath-freenome
Copy link
Member

Can you update your fiddle to use the latest @rjsf/core package instead of the ancient (and no longer supported) react-jsonschema-form and let me know if this is still a problem?

@heath-freenome heath-freenome added awaiting response and removed needs triage Initial label given, to be assigned correct labels and assigned labels Dec 2, 2022
@hughjdavey
Copy link
Author

hughjdavey commented Dec 6, 2022

@heath-freenome Can you point me to the URL I need? I tried to use the one from the docs which is https://unpkg.com/@rjsf/core/dist/react-jsonschema-form.js - but it doesn't seem to exist

image

@heath-freenome
Copy link
Member

Can you try using npm install @rjsf/[email protected]? I am not sure we push to unpkg.com anymore

@hughjdavey
Copy link
Author

hughjdavey commented Dec 7, 2022

Thanks for getting abck to me. It looks like the file react-jsonschema-form.js is no longer in your packages. unpkg.com allows you to access a fille from npm with the syntax unpkg.com/:package@:version/:file and, for example, https://unpkg.com/@rjsf/[email protected]/dist/core.cjs.production.min.js works. Just the https://unpkg.com/@rjsf/core/dist/react-jsonschema-form.js mentioned in the docs doesn't. I looked into the @rjsf/[email protected] using runpkg and indeed the file is no longer there:

image

So should I just use core.cjs.production.min.js instead?

@heath-freenome
Copy link
Member

So we have a doc issue to fix... and yes use that one instead

heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this issue Dec 8, 2022
Fixed rjsf-team#3169 by merging `extraErrors` in while preventing duplicates
- Updated `@rjsf/utils` to make the `mergeObjects()` function support a `preventDuplicates` mode when concatenating arrays
  - Updated the tests to verify this new feature
- Updated `@rjsf/core` to use the `preventDuplicates` mode when merging `extraErrors` when not live validating
- Updated `validation.md` to remove extraneous leading space to fix rjsf-team#3282
- Updated `utility-functions.md` to document the new mode
- Updated `index.md` to provide the proper `core.cjs.production.min.js` package name for `unpkg.com` fixing rjsf-team#3262
- Updated the `CHANGELOG.md` accordingly
@hughjdavey
Copy link
Author

hughjdavey commented Dec 9, 2022

Just tried to reproduce in CodePen and you're right it doesn't happen in 5.0.0-beta.13. But yeh you're right about the doc issue - the CDN instructions don't work anymore. I managed to get it working with Skypack in my CodePen - you can do

import Form from "https://cdn.skypack.dev/@rjsf/[email protected]";

which works well. Here is the CodePen if you are interested,. Thanks for your time with this.

@heath-freenome heath-freenome self-assigned this Dec 9, 2022
@heath-freenome heath-freenome changed the title Error stacks are truncated when custom validation function is used Documentation for unpkg is incorrect Dec 9, 2022
heath-freenome added a commit that referenced this issue Dec 9, 2022
* fix: Prevent duplicated extraErrors when not live validating
Fixed #3169 by merging `extraErrors` in while preventing duplicates
- Updated `@rjsf/utils` to make the `mergeObjects()` function support a `preventDuplicates` mode when concatenating arrays
  - Updated the tests to verify this new feature
- Updated `@rjsf/core` to use the `preventDuplicates` mode when merging `extraErrors` when not live validating
- Updated `validation.md` to remove extraneous leading space to fix #3282
- Updated `utility-functions.md` to document the new mode
- Updated `index.md` to provide the proper `core.cjs.production.min.js` package name for `unpkg.com` fixing #3262
- Updated the `CHANGELOG.md` accordingly

* - Responded to reviewer feedback

* - Fixed url for unpkg directory
@heath-freenome
Copy link
Member

Fixed the doc issue with #3288

shijistar pushed a commit to shijistar/react-jsonschema-form that referenced this issue Jun 8, 2023
…m#3288)

* fix: Prevent duplicated extraErrors when not live validating
Fixed rjsf-team#3169 by merging `extraErrors` in while preventing duplicates
- Updated `@rjsf/utils` to make the `mergeObjects()` function support a `preventDuplicates` mode when concatenating arrays
  - Updated the tests to verify this new feature
- Updated `@rjsf/core` to use the `preventDuplicates` mode when merging `extraErrors` when not live validating
- Updated `validation.md` to remove extraneous leading space to fix rjsf-team#3282
- Updated `utility-functions.md` to document the new mode
- Updated `index.md` to provide the proper `core.cjs.production.min.js` package name for `unpkg.com` fixing rjsf-team#3262
- Updated the `CHANGELOG.md` accordingly

* - Responded to reviewer feedback

* - Fixed url for unpkg directory
shijistar pushed a commit to shijistar/react-jsonschema-form that referenced this issue Jun 8, 2023
…m#3288)

* fix: Prevent duplicated extraErrors when not live validating
Fixed rjsf-team#3169 by merging `extraErrors` in while preventing duplicates
- Updated `@rjsf/utils` to make the `mergeObjects()` function support a `preventDuplicates` mode when concatenating arrays
  - Updated the tests to verify this new feature
- Updated `@rjsf/core` to use the `preventDuplicates` mode when merging `extraErrors` when not live validating
- Updated `validation.md` to remove extraneous leading space to fix rjsf-team#3282
- Updated `utility-functions.md` to document the new mode
- Updated `index.md` to provide the proper `core.cjs.production.min.js` package name for `unpkg.com` fixing rjsf-team#3262
- Updated the `CHANGELOG.md` accordingly

* - Responded to reviewer feedback

* - Fixed url for unpkg directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants