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

Build all packages with TypeScript, including core #2799

Merged
merged 30 commits into from
May 6, 2022

Conversation

nickgros
Copy link
Contributor

@nickgros nickgros commented Apr 9, 2022

Reasons for making this change

  • Reduce risk of bugs and improve ability to reason with the logic in this library using types

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

@nickgros
Copy link
Contributor Author

Note--should configure build scripts as in #2810 to ensure we output UMD builds

Copy link
Member

@epicfaace epicfaace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add registry={registry} here:

<Widget
autofocus={autofocus}
disabled={disabled}
formContext={formContext}
id={idSchema && idSchema.$id}
multiple
onBlur={onBlur}
onChange={onChange}
onFocus={onFocus}
options={options}
rawErrors={rawErrors}
readonly={readonly}
schema={schema}
title={schema.title || name} // Why not props.title?
value={formData}
/>

@nickgros nickgros marked this pull request as ready for review May 3, 2022 21:22
packages/antd/tsconfig.json Outdated Show resolved Hide resolved
Comment on lines -1 to -7
import React from 'react';
import ArrayFieldTemplate from '../ArrayFieldTemplate';
import ErrorList from '../ErrorList';
import Fields from '../Fields';
import FieldTemplate from '../FieldTemplate';
import ObjectFieldTemplate from '../ObjectFieldTemplate';
import SubmitButton from '../SubmitButton';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused imports

packages/fluent-ui/src/SelectWidget/SelectWidget.tsx Outdated Show resolved Hide resolved
packages/fluent-ui/src/RangeWidget/RangeWidget.tsx Outdated Show resolved Hide resolved
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add the missing newline at the end of the file?

packages/fluent-ui/src/DateWidget/DateWidget.tsx Outdated Show resolved Hide resolved
packages/fluent-ui/src/DateWidget/DateWidget.tsx Outdated Show resolved Hide resolved
packages/fluent-ui/src/DateWidget/DateWidget.tsx Outdated Show resolved Hide resolved
packages/fluent-ui/src/ColorWidget/ColorWidget.tsx Outdated Show resolved Hide resolved
packages/fluent-ui/src/ColorWidget/ColorWidget.tsx Outdated Show resolved Hide resolved
packages/core/jest.config.js Outdated Show resolved Hide resolved
tsconfig.base.json Outdated Show resolved Hide resolved
Comment on lines -1 to -7
import React from 'react';
import ArrayFieldTemplate from '../ArrayFieldTemplate';
import ErrorList from '../ErrorList';
import Fields from '../Fields';
import FieldTemplate from '../FieldTemplate';
import ObjectFieldTemplate from '../ObjectFieldTemplate';
import SubmitButton from '../SubmitButton';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused imports

Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
tsconfig.base.json Outdated Show resolved Hide resolved
Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
@nickgros nickgros merged commit 724fb0b into rjsf-team:master May 6, 2022
@lpillonel
Copy link
Contributor

Since this commit, I am facing some issues regarding tests (at least) :

  • Tests are failing on core when we trigger them with lerna run test, even if it says the contrary (see below)
  • Tests can't be executed directly in packages/core as tsdx is not a dependency in core's package.json
@rjsf/core:   console.error
@rjsf/core:     Error: Uncaught [Error: Could not find a definition for #/definitions/nonexistent.]
@rjsf/core:         at reportException (/Users/luca/imtf/react-jsonschema-form/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:62:24)
@rjsf/core:         at innerInvokeEventListeners (/Users/luca/imtf/react-jsonschema-form/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:332:9)
@rjsf/core:         at invokeEventListeners (/Users/luca/imtf/react-jsonschema-form/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:267:3)
@rjsf/core:         at HTMLUnknownElementImpl._dispatch (/Users/luca/imtf/react-jsonschema-form/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:214:9)
@rjsf/core:         at HTMLUnknownElementImpl.dispatchEvent (/Users/luca/imtf/react-jsonschema-form/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:87:17)
@rjsf/core:         at HTMLUnknownElement.dispatchEvent (/Users/luca/imtf/react-jsonschema-form/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:144:23)
@rjsf/core:         at Object.invokeGuardedCallbackDev (/Users/luca/imtf/react-jsonschema-form/packages/core/node_modules/react-dom/cjs/react-dom.development.js:397:16)
@rjsf/core:         at invokeGuardedCallback (/Users/luca/imtf/react-jsonschema-form/packages/core/node_modules/react-dom/cjs/react-dom.development.js:454:31)
@rjsf/core:         at beginWork$$1 (/Users/luca/imtf/react-jsonschema-form/packages/core/node_modules/react-dom/cjs/react-dom.development.js:23217:7)
@rjsf/core:         at performUnitOfWork (/Users/luca/imtf/react-jsonschema-form/packages/core/node_modules/react-dom/cjs/react-dom.development.js:22211:12) Error: Could not find a definition for #/definitions/nonexistent.
.......
@rjsf/core:   console.warn
@rjsf/core:     Using autocomplete property of Form is deprecated, use autoComplete instead.
@rjsf/core:       470 |     const SubmitButton = registry.widgets.SubmitButton;
@rjsf/core:       471 |     if (deprecatedAutocomplete) {
@rjsf/core:     > 472 |       console.warn(
@rjsf/core:           |               ^
@rjsf/core:       473 |         "Using autocomplete property of Form is deprecated, use autoComplete instead."
@rjsf/core:       474 |       );
@rjsf/core:       475 |     }
@rjsf/core:       at Form.render (src/components/Form.js:472:15)
@rjsf/core:       at finishClassComponent (node_modules/react-dom/cjs/react-dom.development.js:17039:31)
@rjsf/core:       at updateClassComponent (node_modules/react-dom/cjs/react-dom.development.js:16994:24)
@rjsf/core:       at beginWork$1 (node_modules/react-dom/cjs/react-dom.development.js:18505:16)
@rjsf/core:       at beginWork$$1 (node_modules/react-dom/cjs/react-dom.development.js:23193:14)
@rjsf/core:       at performUnitOfWork (node_modules/react-dom/cjs/react-dom.development.js:22211:12)
@rjsf/core:       at workLoopSync (node_modules/react-dom/cjs/react-dom.development.js:22185:22)
@rjsf/core:   console.warn
@rjsf/core:     unknown format "area-code" ignored in schema at path "#/properties/areaCode"
@rjsf/core:       at Object.generate_format [as code] (node_modules/ajv/lib/dotjs/format.js:58:19)
@rjsf/core:       at Object.generate_validate [as validate] (node_modules/ajv/lib/dotjs/validate.js:382:35)
@rjsf/core:       at Object.generate_properties [as code] (node_modules/ajv/lib/dotjs/properties.js:201:26)
@rjsf/core:       at generate_validate (node_modules/ajv/lib/dotjs/validate.js:382:35)
@rjsf/core:       at localCompile (node_modules/ajv/lib/compile/index.js:88:22)
@rjsf/core:       at Ajv.compile (node_modules/ajv/lib/compile/index.js:55:13)
@rjsf/core:       at Ajv._compile (node_modules/ajv/lib/ajv.js:348:27)
@rjsf/core:   console.warn
@rjsf/core:     unknown format "area-code" ignored in schema at path "#/properties/areaCode"
@rjsf/core:       at Object.generate_format [as code] (node_modules/ajv/lib/dotjs/format.js:58:19)
@rjsf/core:       at Object.generate_validate [as validate] (node_modules/ajv/lib/dotjs/validate.js:382:35)
@rjsf/core:       at Object.generate_properties [as code] (node_modules/ajv/lib/dotjs/properties.js:201:26)
@rjsf/core:       at generate_validate (node_modules/ajv/lib/dotjs/validate.js:382:35)
@rjsf/core:       at localCompile (node_modules/ajv/lib/compile/index.js:88:22)
@rjsf/core:       at Ajv.compile (node_modules/ajv/lib/compile/index.js:55:13)
@rjsf/core:       at Ajv._compile (node_modules/ajv/lib/ajv.js:348:27)
@rjsf/bootstrap-4: > @rjsf/bootstrap-4@4.2.0 test /Users/luca/imtf/react-jsonschema-form/packages/bootstrap-4
@rjsf/bootstrap-4: > tsdx test
.......
lerna success run Ran npm script 'test' in 7 packages in 72.0s:
lerna success - @rjsf/antd
lerna success - @rjsf/bootstrap-4
lerna success - @rjsf/chakra-ui
lerna success - @rjsf/core
lerna success - @rjsf/fluent-ui
lerna success - @rjsf/material-ui
lerna success - @rjsf/semantic-ui

@epicfaace : are these already known issues ?

1 similar comment
@lpillonel
Copy link
Contributor

Since this commit, I am facing some issues regarding tests (at least) :

  • Tests are failing on core when we trigger them with lerna run test, even if it says the contrary (see below)
  • Tests can't be executed directly in packages/core as tsdx is not a dependency in core's package.json
@rjsf/core:   console.error
@rjsf/core:     Error: Uncaught [Error: Could not find a definition for #/definitions/nonexistent.]
@rjsf/core:         at reportException (/Users/luca/imtf/react-jsonschema-form/node_modules/jsdom/lib/jsdom/living/helpers/runtime-script-errors.js:62:24)
@rjsf/core:         at innerInvokeEventListeners (/Users/luca/imtf/react-jsonschema-form/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:332:9)
@rjsf/core:         at invokeEventListeners (/Users/luca/imtf/react-jsonschema-form/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:267:3)
@rjsf/core:         at HTMLUnknownElementImpl._dispatch (/Users/luca/imtf/react-jsonschema-form/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:214:9)
@rjsf/core:         at HTMLUnknownElementImpl.dispatchEvent (/Users/luca/imtf/react-jsonschema-form/node_modules/jsdom/lib/jsdom/living/events/EventTarget-impl.js:87:17)
@rjsf/core:         at HTMLUnknownElement.dispatchEvent (/Users/luca/imtf/react-jsonschema-form/node_modules/jsdom/lib/jsdom/living/generated/EventTarget.js:144:23)
@rjsf/core:         at Object.invokeGuardedCallbackDev (/Users/luca/imtf/react-jsonschema-form/packages/core/node_modules/react-dom/cjs/react-dom.development.js:397:16)
@rjsf/core:         at invokeGuardedCallback (/Users/luca/imtf/react-jsonschema-form/packages/core/node_modules/react-dom/cjs/react-dom.development.js:454:31)
@rjsf/core:         at beginWork$$1 (/Users/luca/imtf/react-jsonschema-form/packages/core/node_modules/react-dom/cjs/react-dom.development.js:23217:7)
@rjsf/core:         at performUnitOfWork (/Users/luca/imtf/react-jsonschema-form/packages/core/node_modules/react-dom/cjs/react-dom.development.js:22211:12) Error: Could not find a definition for #/definitions/nonexistent.
.......
@rjsf/core:   console.warn
@rjsf/core:     Using autocomplete property of Form is deprecated, use autoComplete instead.
@rjsf/core:       470 |     const SubmitButton = registry.widgets.SubmitButton;
@rjsf/core:       471 |     if (deprecatedAutocomplete) {
@rjsf/core:     > 472 |       console.warn(
@rjsf/core:           |               ^
@rjsf/core:       473 |         "Using autocomplete property of Form is deprecated, use autoComplete instead."
@rjsf/core:       474 |       );
@rjsf/core:       475 |     }
@rjsf/core:       at Form.render (src/components/Form.js:472:15)
@rjsf/core:       at finishClassComponent (node_modules/react-dom/cjs/react-dom.development.js:17039:31)
@rjsf/core:       at updateClassComponent (node_modules/react-dom/cjs/react-dom.development.js:16994:24)
@rjsf/core:       at beginWork$1 (node_modules/react-dom/cjs/react-dom.development.js:18505:16)
@rjsf/core:       at beginWork$$1 (node_modules/react-dom/cjs/react-dom.development.js:23193:14)
@rjsf/core:       at performUnitOfWork (node_modules/react-dom/cjs/react-dom.development.js:22211:12)
@rjsf/core:       at workLoopSync (node_modules/react-dom/cjs/react-dom.development.js:22185:22)
@rjsf/core:   console.warn
@rjsf/core:     unknown format "area-code" ignored in schema at path "#/properties/areaCode"
@rjsf/core:       at Object.generate_format [as code] (node_modules/ajv/lib/dotjs/format.js:58:19)
@rjsf/core:       at Object.generate_validate [as validate] (node_modules/ajv/lib/dotjs/validate.js:382:35)
@rjsf/core:       at Object.generate_properties [as code] (node_modules/ajv/lib/dotjs/properties.js:201:26)
@rjsf/core:       at generate_validate (node_modules/ajv/lib/dotjs/validate.js:382:35)
@rjsf/core:       at localCompile (node_modules/ajv/lib/compile/index.js:88:22)
@rjsf/core:       at Ajv.compile (node_modules/ajv/lib/compile/index.js:55:13)
@rjsf/core:       at Ajv._compile (node_modules/ajv/lib/ajv.js:348:27)
@rjsf/core:   console.warn
@rjsf/core:     unknown format "area-code" ignored in schema at path "#/properties/areaCode"
@rjsf/core:       at Object.generate_format [as code] (node_modules/ajv/lib/dotjs/format.js:58:19)
@rjsf/core:       at Object.generate_validate [as validate] (node_modules/ajv/lib/dotjs/validate.js:382:35)
@rjsf/core:       at Object.generate_properties [as code] (node_modules/ajv/lib/dotjs/properties.js:201:26)
@rjsf/core:       at generate_validate (node_modules/ajv/lib/dotjs/validate.js:382:35)
@rjsf/core:       at localCompile (node_modules/ajv/lib/compile/index.js:88:22)
@rjsf/core:       at Ajv.compile (node_modules/ajv/lib/compile/index.js:55:13)
@rjsf/core:       at Ajv._compile (node_modules/ajv/lib/ajv.js:348:27)
@rjsf/bootstrap-4: > @rjsf/bootstrap-4@4.2.0 test /Users/luca/imtf/react-jsonschema-form/packages/bootstrap-4
@rjsf/bootstrap-4: > tsdx test
.......
lerna success run Ran npm script 'test' in 7 packages in 72.0s:
lerna success - @rjsf/antd
lerna success - @rjsf/bootstrap-4
lerna success - @rjsf/chakra-ui
lerna success - @rjsf/core
lerna success - @rjsf/fluent-ui
lerna success - @rjsf/material-ui
lerna success - @rjsf/semantic-ui

@epicfaace : are these already known issues ?

@epicfaace
Copy link
Member

Not sure, can you open an issue? It's working on CI.

lpillonel added a commit to lpillonel/react-jsonschema-form that referenced this pull request Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants