-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
docs: make legacy.componentApi more visible #11924
Conversation
People didn't know that this exists, so we should make it more visible through having it be part of the error message, and calling it out in the docs with more details
🦋 Changeset detectedLatest commit: 9847e1a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Trying this out locally and realised that it doesn't actually do anything because of the |
@@ -20,6 +21,9 @@ export function hmr(source) { | |||
block(() => { | |||
const component = get(source); | |||
|
|||
// @ts-expect-error | |||
check_target(new.target && component); |
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.
this does the check and then fail even when the compiler option is set, which shouldn't happen in that case
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 whoops, good catch. fixed. though it now fails with props is undefined
, looking into that now
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.
kinda stumped by this tbh, any ideas?
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.
seems that checking for the truthiness of new.target
(rather than doing an equality check) makes it work. i don't fully understand why the equality check was failing but i'll take it
…legacy-api-visible
People didn't know that this exists, so we should make it more visible through having it be part of the error message, and calling it out in the docs with more details