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 HMR support #20

Merged
merged 1 commit into from
Oct 6, 2023
Merged

Fix HMR support #20

merged 1 commit into from
Oct 6, 2023

Conversation

joshwooding
Copy link
Owner

@joshwooding joshwooding commented Apr 12, 2023

Closes #21

@changeset-bot
Copy link

changeset-bot bot commented Apr 12, 2023

🦋 Changeset detected

Latest commit: e2bd6bc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@joshwooding/vite-plugin-react-docgen-typescript Patch

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

@bnussman-akamai
Copy link

Any update or is there any way we can help with this effort to fix HMR?

@joshwooding joshwooding force-pushed the try-tackle-hmr-issues branch 4 times, most recently from 302b490 to 6211a06 Compare October 5, 2023 21:25
@@ -81,5 +101,8 @@ export default function reactDocgenTypescript(config: Options = {}): Plugin {
return src;
}
},
async handleHotUpdate() {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The magic sauce

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YAYA 🎉

@joshwooding joshwooding force-pushed the try-tackle-hmr-issues branch 2 times, most recently from 3d9ab6d to 2c03f87 Compare October 5, 2023 21:56
@joshwooding
Copy link
Owner Author

/release-pr

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

🫰✨ Thanks @joshwooding! Your snapshot has been published to npm.

Test the snapshot by updating your package.json with the newly published version:

yarn add @joshwooding/vite-plugin-react-docgen-typescript@0.0.0-snapshot-20231005222330

};

return result;
return ts.createProgram(files, compilerOptions, undefined, oldProgram);
Copy link
Contributor

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?

Copy link
Owner Author

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

@joshwooding joshwooding changed the title Try tackle HMR issues Fix HMR support Oct 6, 2023
@joshwooding joshwooding merged commit 2bcfd8f into main Oct 6, 2023
1 check passed
@joshwooding joshwooding deleted the try-tackle-hmr-issues branch October 6, 2023 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Storybook argtypes not being regenerated with HMR
3 participants