Skip to content

feat(prefresh): add prefresh plugin#19

Draft
sapphi-red wants to merge 4 commits intomainfrom
feat/prefresh-plugin
Draft

feat(prefresh): add prefresh plugin#19
sapphi-red wants to merge 4 commits intomainfrom
feat/prefresh-plugin

Conversation

@sapphi-red
Copy link
Member

This PR adds @rolldown/plugin-prefresh which utilizes Rolldown's native magic string feature.

In the synthetic benchmark included in this PR, this plugin is

  • 1.14x faster than using @swc/plugin-prefresh + @rollup/plugin-swc
  • 2.10x faster than using @prefresh/babel-plugin + @rolldown/plugin-babel

I haven't tested in a real world case, and I assume it's quite different as the benchmark above uses build.

The implementation is based on swc-project/plugins/packages/prefresh (Apache License 2.0) and test cases are also adapted from it.

I guess it's better to put this plugin in https://github.com/preactjs/prefresh. But this plugin relies on the internal oxc-unshadowed-visitor package which is not published. So I need to think about publishing that one to do so.

@sapphi-red sapphi-red force-pushed the feat/prefresh-plugin branch from 6ba3a5c to 0633617 Compare March 15, 2026 11:49
@JoviDeCroock
Copy link

@sapphi-red Do you want this to live in the Prefresh repository?

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.

2 participants