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

Incompatible with typescript@5.5.2 #560

Closed
jlarmstrongiv opened this issue Jun 21, 2024 · 7 comments
Closed

Incompatible with typescript@5.5.2 #560

jlarmstrongiv opened this issue Jun 21, 2024 · 7 comments
Milestone

Comments

@jlarmstrongiv
Copy link

Reproduction https://github.com/jlarmstrongiv/colorjsio-ts

image
@LeaVerou
Copy link
Member

Hi @jlarmstrongiv, is this about the dev branch or the currently released v0.5.0?

@jlarmstrongiv
Copy link
Author

jlarmstrongiv commented Jun 21, 2024

Hi @LeaVerou this issue is about colorjs.io@0.5.0 with typescript@5.5.2

@LeaVerou
Copy link
Member

Ah okay. We've made some major changes wrt typing in v0.6.0 and we’re still not done. We’ll do an alpha soon, please check it out to see if you still have this issue?

@LeaVerou LeaVerou added this to the v0.6.0 milestone Jun 21, 2024
@kachkaev
Copy link

kachkaev commented Jun 21, 2024

I was able to patch colorjs.io@0.5.0 like this:

patches/colorjs.io@0.5.0.patch

diff --git a/types/src/index.d.ts b/types/src/index.d.ts
index 73bc03a39431333a8c9a4a2e9c24b4bb0d8e693a..63382d9984fa81cf9919423750384c5e4d10361a 100644
--- a/types/src/index.d.ts
+++ b/types/src/index.d.ts
@@ -1,5 +1,5 @@
 import { uv, xy } from "./chromaticity.js";
-import Color, { ColorTypes, ToColorPrototype } from "./color.js";
+import BaseColor, { ColorTypes, ToColorPrototype } from "./color.js";
 import contrast from "./contrast.js";
 import {
 	contrastWCAG21,
@@ -24,7 +24,8 @@ import { lighten, darken } from "./variations.js";

 // Augment existing Color object
 declare module "./color" {
-	export default class Color {
+	// https://github.com/color-js/color.js/issues/560
+	export default class Color extends BaseColor {
 		// chromaticity
 		uv: ToColorPrototype<typeof uv>;
 		xy: ToColorPrototype<typeof xy>;

This seems to unblock typescript 5.45.5 migration. @LeaVerou WDYT of releasing 0.5.1 with this patch?

@jlarmstrongiv
Copy link
Author

Sure 👍 Let me know when you make an alpha release of v0.6.0 or a patch release of 0.5.1 and I’ll give it a go

joelspadin added a commit to joelspadin/xivplan that referenced this issue Jun 22, 2024
Typescript update is blocked by
color-js/color.js#560
@MysteryBlokHed
Copy link
Member

@jlarmstrongiv Could you check whether this error still happens on v0.5.2?

@jlarmstrongiv
Copy link
Author

@MysteryBlokHed thank you! I can confirm the error is resolved on v0.5.2 👍

znamenskii-ilia added a commit to appsmithorg/appsmith that referenced this issue Jul 30, 2024
## Description
Upgrade Typescript from 4.9.5 to 5.4

Upgrading to 5.5 is not possible until we upgrade colors.js lib. It will
be done in separate PR
More details here
color-js/color.js#560 (comment)

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10163124159>
> Commit: 8d2e93f
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10163124159&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Tue, 30 Jul 2024 14:11:42 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Updated TypeScript dependency to the latest version (5.4), enhancing
overall functionality with potential new features and improvements.

- **Improvements**
- Enhanced type safety by refining the `isString` function, allowing
better type inference and preventing runtime errors.
- Improved comments and annotations in the `indirectEval` function for
better clarity on its usage and intent.
- Corrected typographical errors in error handling logic across multiple
controllers, improving reliability in error messaging.
- Updated export style for `IconNames` to clarify its purpose as a type,
enhancing developer experience.

- **Configuration Changes**
- Updated Jest configurations to better support ECMAScript Modules
(ESM), improving compatibility and allowing for more flexible module
handling.
- Adjusted TypeScript configuration to enhance module handling and
compatibility.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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

No branches or pull requests

4 participants