-
Notifications
You must be signed in to change notification settings - Fork 8
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 HMR support #20
Fix HMR support #20
Conversation
🦋 Changeset detectedLatest commit: e2bd6bc 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 |
Any update or is there any way we can help with this effort to fix HMR? |
302b490
to
6211a06
Compare
@@ -81,5 +101,8 @@ export default function reactDocgenTypescript(config: Options = {}): Plugin { | |||
return src; | |||
} | |||
}, | |||
async handleHotUpdate() { |
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.
The magic sauce
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.
YAYA 🎉
3d9ab6d
to
2c03f87
Compare
2c03f87
to
e2bd6bc
Compare
/release-pr |
🫰✨ Thanks @joshwooding! Your snapshot has been published to npm. Test the snapshot by updating your yarn add @joshwooding/vite-plugin-react-docgen-typescript@0.0.0-snapshot-20231005222330 |
}; | ||
|
||
return result; | ||
return ts.createProgram(files, compilerOptions, undefined, oldProgram); |
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.
Hey @joshwooding
What happens if we pass the oldProgram
to the ts.createProgram
function? Is Typescript able to speed up the new program's creation?
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.
Yeah, that's in theory how it works
Closes #21