Closed LingyuCoder closed 4 months ago
Latest commit: 8257497797f5606e3ab235ddca712e94c3bd02c4
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Add
@swc/plugin-prefresh
, which is the SWC implementation of the prefresh babel plugin.Prefresh babel plugin is a forked equivalent of the react-refresh babel plugin difference being that we need a way to memoize createContext between HMR.
And SWC has built-in React Refresh transformation, therefore, this plugin only implements the
createContext
processing part and need to be used withjsc.transform.react.refresh
.For example: