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 GlobalCompositeOperation error in data grid package #298

Closed
SnarkBoojum opened this issue Mar 28, 2022 · 6 comments · Fixed by #319
Closed

Fix GlobalCompositeOperation error in data grid package #298

SnarkBoojum opened this issue Mar 28, 2022 · 6 comments · Fixed by #319
Labels
bug Something isn't working
Milestone

Comments

@SnarkBoojum
Copy link

Compiling datadrid with a recent typescript leads to:

src/graphicscontext.ts(243,7): error TS2322: Type 'string' is not assignable to type 'GlobalCompositeOperation'.

So I guess there's again a stricter typing in typescript breaking parts of lumino.

By recent version of typescript, I mean 4.6.3.

@SnarkBoojum SnarkBoojum added the bug Something isn't working label Mar 28, 2022
@SnarkBoojum
Copy link
Author

I dug a little, and I think the reason is that they tightened things in typescript so the type wouldn't be the same depending on the given string -- and for an unknown string, that means an error : see here

@SnarkBoojum
Copy link
Author

This looks like a trivial fix:

-  get globalCompositeOperation(): string {
+  get globalCompositeOperation(): GlobalCompositeOperation {
     return this._context.globalCompositeOperation;
   }
 
-  set globalCompositeOperation(value: string) {
+  set globalCompositeOperation(value: GlobalCompositeOperation) {

@vidartf
Copy link
Member

vidartf commented Apr 13, 2022

Did you want to open a PR with your proposed changes (so credit can be attributed in commit log etc), or are you hoping someone else can code this up?

@vidartf
Copy link
Member

vidartf commented Apr 13, 2022

PS: It is also worth noting what the proposed change would do to the minimally required TS version.

@SnarkBoojum
Copy link
Author

I don't know how that changes the minimally required TS version.

Last time an upstream wanted a PR for a trivial fix (so credit can be attributed in commit log etc), the commit still looks like it comes from upstream, see, so I'm not sure I'll bother this time.

@blink1073
Copy link
Contributor

I see your commit in the history: graph-algorithms/edge-addition-planarity-suite@c03109f

@afshin afshin added this to the Lumino 2 milestone Jul 26, 2022
@afshin afshin changed the title src/graphicscontext.ts(243,7): error TS2322: Type 'string' is not assignable to type 'GlobalCompositeOperation'. Fix GlobalCompositeOperation error in data grid package Aug 8, 2022
@afshin afshin moved this to Done in Lumino 2 Aug 8, 2022
@afshin afshin added this to Lumino 2 Aug 8, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
No open projects
Status: done
Development

Successfully merging a pull request may close this issue.

4 participants