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

fix: Fix mergeProps, createElemPropsHook, and composeHooks types #2980

Merged
merged 15 commits into from
Oct 11, 2024

Conversation

NicholasBoll
Copy link
Member

@NicholasBoll NicholasBoll commented Oct 11, 2024

Summary

  • Upgrade TypeScript to 5.0
  • Upgrade ESLint to 5.61
  • Fix mergeProps type signature
  • Fix createElemProps type signature
  • Fix composeHooks type signature

More info: #2979

Release Category

Components

BREAKING CHANGES

elemProps hooks using composeHooks have more accurate type signatures which may lead to new type errors. For information, view our discussion.


Checklist

For the Reviewer

  • PR title is short and descriptive
  • PR summary describes the change (Fixes/Resolves linked correctly)
  • Breaking Changes provides useful information to upgrade to this code or removed if not applicable

@NicholasBoll NicholasBoll added the ready for review Code is ready for review label Oct 11, 2024
@github-actions github-actions bot requested a review from josh-bagwell October 11, 2024 18:02
@@ -51,6 +52,7 @@ A note to the reader:
- [Select](#select)
- [Text Area](#text-area)
- [Text Input](#text-input)
- [Utility Updates](#utility-updates)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- [Utility Updates](#utility-updates)
- [Infrastructure](#infrastructure)
- [Utility Updates](#utility-updates)

@@ -188,6 +190,14 @@ from Main instead.

---

## TypeScript
Copy link
Contributor

@mannycarrera4 mannycarrera4 Oct 11, 2024

Choose a reason for hiding this comment

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

Suggested change
## TypeScript
## Infrastructure
### TypeScript
**PR:** [#2908](https://github.com/Workday/canvas-kit/pull/2908)

@@ -569,6 +579,39 @@ const theme: PartialEmotionCanvasTheme = {
</CanvasProvider>;
```

## Utility Updates
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
## Utility Updates
## Utility Updates
**PR:** [#2908](https://github.com/Workday/canvas-kit/pull/2908)

Copy link

cypress bot commented Oct 11, 2024

Workday/canvas-kit    Run #7885

Run Properties:  status check passed Passed #7885  •  git commit 768fd3f644 ℹ️: Merge 1b3de1f916398369e7e436bfc04268977f9126f4 into c47cf7cb9a1a597a6ab33fb8f173...
Project Workday/canvas-kit
Run status status check passed Passed #7885
Run duration 05m 02s
Commit git commit 768fd3f644 ℹ️: Merge 1b3de1f916398369e7e436bfc04268977f9126f4 into c47cf7cb9a1a597a6ab33fb8f173...
Committer Nicholas Boll
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 33
Tests that did not run due to a developer annotating a test with .skip  Pending 24
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 1082
UI Coverage  21.8%
  Untested elements 1619  
  Tested elements 449  
Accessibility  99.18%
  Failed rules  5 critical   5 serious   0 moderate   2 minor
  Failed elements 182  

@@ -600,7 +600,7 @@ export const createComponent =
*/
export const createElemPropsHook =
<TModelHook extends (config: any) => Model<any, any>>(modelHook: TModelHook) =>
<PO extends {}, PI extends {}>(
<const PO extends {}, const PI extends {}>(
Copy link
Contributor

Choose a reason for hiding this comment

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

it's not happy about these const in here for some reason

Copy link
Member Author

Choose a reason for hiding this comment

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

The dependency checker doesn't understand the new syntax... It uses an AST parser to function.

Copy link
Contributor

Choose a reason for hiding this comment

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

great

Comment on lines 195 to 199
We've upgrade to TypeScript 5.0 and make use of
[const Type Parameters](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#const-type-parameters).
You will need to upgrade to TypeScript 5.0+ to avoid TypeScript syntax errors. TypeScript does not
follow semver, so 5.0 doesn't mean a large breaking change from 4.9. TypeScript doesn't have a
`x.10` release, they bump the `x.9` to `{x+1}.0`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
We've upgrade to TypeScript 5.0 and make use of
[const Type Parameters](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#const-type-parameters).
You will need to upgrade to TypeScript 5.0+ to avoid TypeScript syntax errors. TypeScript does not
follow semver, so 5.0 doesn't mean a large breaking change from 4.9. TypeScript doesn't have a
`x.10` release, they bump the `x.9` to `{x+1}.0`.
We've upgraded to TypeScript 5.0 to make use of
[const Type Parameters](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#const-type-parameters).
You will need to upgrade to TypeScript 5.0+ to avoid any TypeScript syntax errors. TypeScript does not
follow semver, so 5.0 doesn't mean a large breaking change from 4.9. TypeScript doesn't have a
`x.10` release, they bump the `x.9` to `{x+1}.0`.

@NicholasBoll NicholasBoll added automerge and removed ready for review Code is ready for review labels Oct 11, 2024
@alanbsmith alanbsmith merged commit 9f6eea6 into prerelease/major Oct 11, 2024
19 of 20 checks passed
@alanbsmith alanbsmith deleted the fix/merge-props branch October 11, 2024 21:48
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.

4 participants