-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feat/switch strict mode to true #127
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we change to n3 Quads ?
@@ -9,21 +9,21 @@ export class InputComponent extends BaseComponent { | |||
* The input field. | |||
*/ | |||
@query('#content') | |||
content: HTMLInputElement; | |||
content!: HTMLInputElement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this do exactly? ( just curious )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is to make sure the variables are never null or undefined
https://lit.dev/docs/components/shadow-dom/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it actually prevents TS from doing the type check. In the case of LitElement, it might be semi-safe, since you "can be sure" that the template contains the element (if you're confident that you never make mistakes, which I am not of myself, for example)... but it will lead to runtime errors when trying to access the element before rendering, or when using it wrongly with state (see other comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to take a look at this again and decide what (and why) we want to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, @arnevandoorslaer, I forgot about this... can you take another look at it tomorrow? I'd actually prefer to never use that syntax, and simply check for undefined values when they're used (explicitly or using ?.
or ??
operators), but maybe you can convince me if you really think they have a huge advantage.
Co-authored-by: Arthur Joppart <38424924+BelgianNoise@users.noreply.github.com>
rdf-quads didn't have typings |
@@ -9,21 +9,21 @@ export class InputComponent extends BaseComponent { | |||
* The input field. | |||
*/ | |||
@query('#content') | |||
content: HTMLInputElement; | |||
content!: HTMLInputElement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it actually prevents TS from doing the type check. In the case of LitElement, it might be semi-safe, since you "can be sure" that the template contains the element (if you're confident that you never make mistakes, which I am not of myself, for example)... but it will lead to runtime errors when trying to access the element before rendering, or when using it wrongly with state (see other comment).
Co-authored-by: Wouter Termont <woutermont@gmail.com>
Co-authored-by: Wouter Termont <woutermont@gmail.com>
Signed-off-by: Wouter Termont <woutermont@gmail.com>
Signed-off-by: Wouter Termont <woutermont@gmail.com>
packages/semcom-node/lib/component/services/component-transformer.service.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Wouter Termont <woutermont@gmail.com>
No description provided.