-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(feedback): Add missing h
import in ScreenshotEditor
(#12713)
#12784
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
Conversation
size-limit report 📦
|
// biome-ignore lint/nursery/noUnusedImports: reason | ||
import { h } from 'preact'; // eslint-disable-line @typescript-eslint/no-unused-vars |
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.
can we add a reason/additional comment as to why we need this ignore? It looks like h
is destructured but unused further below which doesn't look like an unused import on first glance 🤔 is this a biome bug?
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.
Oh wait, I'm off here, this shouldn't require an import 😅
So I guess there's some side effect we need from importing h
?
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.
I'm not too familiar with preact, but I'm guessing it's a similar factory to JSX createElement
? Just taking a wild guess.
This has been explicitly removed in favor of injecting h in #12535 but at that point it seems to be too late to do.
Maybe we should completely revert the injection too, but I'm waiting on @ryan953 for confirmation before going ahead here.
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.
Ahh alright sounds good to me! Sorry, I don't have much context around feedback or Preact and was a bit confused but makes sense!
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.
yes h
is needed because it's a similar factory to JSX createElement
, it's needed anytime JSX syntax is used
I think we may have accidentally removed |
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.
Cool. Lets get this merged!
Looks like we need #12793. I'll merge the develop branch in |
I noticed this after #12784, but the `<CropCorner>` wasn't inside the `ScreenshotEditorFactory()` function. So of course it wasn't getting access to the `h` ref that is passed in. That variable is what the `<div>` gets transpiled into -> it becomes `h.createElement('div')`. So what i'm doing is moving `CropCorner` into a `CropCornerFactory` so we can pass `h` in and hopefully not have the extra `import .. from 'preact';` in the 2nd bundle. Related to #12535
This broke the
Add a screenshot
button on the user feedback, see #12713This has been explicitly removed in favor of injecting
h
in #12535 but at that point it seems to be too late to do.