Skip to content

fix(react-jsonschema-form): withTheme forwards the ref to the form#46102

Closed
zepatrik wants to merge 2 commits intoDefinitelyTyped:masterfrom
zepatrik:fix-react-jsonschema-form-withtheme-ref
Closed

fix(react-jsonschema-form): withTheme forwards the ref to the form#46102
zepatrik wants to merge 2 commits intoDefinitelyTyped:masterfrom
zepatrik:fix-react-jsonschema-form-withtheme-ref

Conversation

@zepatrik
Copy link
Contributor

As someone noted here the current typing does not reflect the forwarding of the ref to the form component.

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If adding a new definition:

  • The package does not already provide its own types, or cannot have its .d.ts files generated via --declaration
  • If this is for an NPM package, match the name. If not, do not conflict with the name of an NPM package.
  • Create it with dts-gen --dt, not by basing it on an existing project.
  • Represents shape of module/library correctly
  • tslint.json should be present and it shouldn't have any additional or disabling of rules. Just content as { "extends": "dtslint/dt.json" }. If for reason the some rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.
  • tsconfig.json should have noImplicitAny, noImplicitThis, strictNullChecks, and strictFunctionTypes set to true.

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: add forwardRef to withTheme rjsf-team/react-jsonschema-form#1498
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the header.
  • Include tests for your changes
  • If you are making substantial changes, consider adding a tslint.json containing { "extends": "dtslint/dt.json" }. If for reason the any rule need to be disabled, disable it for that line using // tslint:disable-next-line [ruleName] and not for whole package so that the need for disabling can be reviewed.

If removing a declaration:

  • If a package was never on Definitely Typed, you don't need to do anything. (If you wrote a package and provided types, you don't need to register it with us.)
  • Delete the package's directory.
  • Add it to notNeededPackages.json.

zepatrik added 2 commits July 15, 2020 13:01
As someone noted (here)[rjsf-team/react-jsonschema-form#1405 (comment)] the current typing does not reflect the forwarding of the ref to the form component.
@typescript-bot
Copy link
Contributor

typescript-bot commented Jul 15, 2020

@zepatrik Thank you for submitting this PR!

This is a live comment which I will keep updated.

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners, DT maintainers or others

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 46102,
  "author": "zepatrik",
  "owners": [
    "iamdanfox",
    "iplus26",
    "phbou72",
    "LucianBuzzo",
    "sthenault",
    "sbusch",
    "medfreeman",
    "saadtazi",
    "agustin107",
    "chanceaclark",
    "ogdentrod",
    "andrenguyener",
    "qingqishi"
  ],
  "dangerLevel": "ScopedAndTested",
  "headCommitAbbrOid": "0d6ce1f",
  "headCommitOid": "0d6ce1fd9e80c4aef4a01eb2989d29d8bb10b795",
  "mergeIsRequested": false,
  "stalenessInDays": 0,
  "lastPushDate": "2020-07-15T11:14:20.000Z",
  "lastCommentDate": "2020-07-15T11:14:20.000Z",
  "maintainerBlessed": false,
  "reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46102/files",
  "hasMergeConflict": false,
  "authorIsOwner": false,
  "isFirstContribution": false,
  "popularityLevel": "Well-liked by everyone",
  "anyPackageIsNew": false,
  "packages": [
    "react-jsonschema-form"
  ],
  "files": [
    {
      "path": "types/react-jsonschema-form/index.d.ts",
      "kind": "definition",
      "package": "react-jsonschema-form"
    },
    {
      "path": "types/react-jsonschema-form/react-jsonschema-form-tests.tsx",
      "kind": "test",
      "package": "react-jsonschema-form"
    }
  ],
  "hasDismissedReview": false,
  "ciResult": "pass",
  "lastReviewDate": "2020-07-16T15:57:55.000Z",
  "reviewersWithStaleReviews": [],
  "approvalFlags": 2,
  "isChangesRequested": false
}

@typescript-bot
Copy link
Contributor

🔔 @iamdanfox @iplus26 @phbou72 @LucianBuzzo @sthenault @sbusch @medfreeman @saadtazi @agustin107 @chanceaclark @ogdentrod @andrenguyener @QingqiShi — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot
Copy link
Contributor

👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings.

Let’s review the numbers, shall we?

Comparison details 📊
master #46102 diff
Batch compilation
Memory usage (MiB) 123.5 123.5 0.0%
Type count 23993 23956 0%
Assignability cache size 7012 6986 0%
Language service
Samples taken 368 374 +2%
Identifiers in tests 368 374 +2%
getCompletionsAtPosition
    Mean duration (ms) 613.1 612.8 -0.1%
    Mean CV 7.3% 7.4%
    Worst duration (ms) 847.6 809.4 -4.5%
    Worst identifier element onBlur
getQuickInfoAtPosition
    Mean duration (ms) 602.9 603.6 +0.1%
    Mean CV 7.5% 7.8% +3.5%
    Worst duration (ms) 769.5 867.5 +12.7%
    Worst identifier element element

It looks like nothing changed too much. I won’t post performance data again unless it gets worse.

@typescript-bot typescript-bot added the Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. label Jul 15, 2020
@typescript-bot typescript-bot added Owner Approved A listed owner of this package signed off on the pull request. Self Merge This PR can now be self-merged by the PR author or an owner labels Jul 16, 2020
@zepatrik
Copy link
Contributor Author

Actually the package starting with v2+ has it's own type definitions and is published as @rjsf/core. The change forwarding the ref is actually not in the last v1 release that this type definition refers to so I'm closing this PR. Instead this is fixed in rjsf-team/react-jsonschema-form#1915

@zepatrik zepatrik closed this Jul 16, 2020
@zepatrik zepatrik deleted the fix-react-jsonschema-form-withtheme-ref branch July 16, 2020 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Owner Approved A listed owner of this package signed off on the pull request. Perf: Same typescript-bot determined that this PR will not significantly impact compilation performance. Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants