Skip to content

Releases: vitejs/vite-plugin-react-swc

v3.8.0

08 Feb 23:05
Compare
Choose a tag to compare

Add useAtYourOwnRisk_mutateSwcOptions option

The future of Vite is with OXC, and from the beginning this was a design choice to not exposed too many specialties from SWC so that Vite React users can move to another transformer later.
Also debugging why some specific version of decorators with some other unstable/legacy feature doesn't work is not fun, so we won't provide support for it, hence the name useAtYourOwnRisk.

react({
  useAtYourOwnRisk_mutateSwcOptions(options) {
    options.jsc.parser.decorators = true;
    options.jsc.transform.decoratorVersion = "2022-03";
  },
});

v3.7.2

26 Nov 10:22
Compare
Choose a tag to compare

Add Vite 6 to peerDependencies range #207

Thanks @RobinTail

Revert throw when refresh runtime is loaded twice #237

Revert the throw when refresh runtime is loaded twice to enable usage in micro frontend apps. This was added to help fix setup usage, and this is not worth an annoying warning for others or a config parameter.

This revert was done in the Babel plugin last year and I didn't port it back.

v3.7.1

29 Sep 21:23
Compare
Choose a tag to compare

Ignore directive sourcemap error #231

v3.7.0

22 May 19:16
Compare
Choose a tag to compare

Support HMR for class components

This is a long overdue and should fix some issues people had with HMR when migrating from CRA.

v3.6.0

31 Jan 16:00
Compare
Choose a tag to compare

Add parserConfig option

This will unlock to use the plugin in some use cases where the original source code is not in TS. Using this option to keep using JSX inside .js files is highly discouraged and can be removed in any future version.

v3.5.0

16 Nov 14:27
Compare
Choose a tag to compare

Update peer dependency range to target Vite 5

There were no breaking change that impacted this plugin, so any combination of React plugins and Vite core version will work.

Align jsx runtime for optimized dependencies

This will only affect people using internal libraries that contains untranspiled JSX. This change aligns the optimizer with the source code and avoid issues when the published source don't have React in the scope.

Reminder: While being partially supported in Vite, publishing TS & JSX outside of internal libraries is highly discouraged.

v3.4.1

30 Oct 12:53
Compare
Choose a tag to compare

Add support for .mts (fixes #161)

Using CJS in source code will not work in Vite (and will never be supported), so this is better to only use .ts.

But to better align with Vite core defaults, .mts extension will now be processed like .ts. This maybe reverted in a future major.

v3.4.0

24 Sep 19:00
Compare
Choose a tag to compare
  • Add devTarget option (fixes #141)
  • Disable Fast Refresh based on config.server.hmr === false instead of process.env.TEST
  • Warn when plugin is in WebContainers (see #118)
  • Better invalidation message when an export is added & fix HMR for export of nullish values (#143)

v3.3.2

03 Jun 12:16
Compare
Choose a tag to compare

v3.3.1

08 May 12:30
Compare
Choose a tag to compare
  • Add type: module to package.json (#101). Because the library already publish .cjs & .mjs files, the only change is for typing when using the node16 module resolution (fixes #95)
  • Throw an error when the MDX plugin is after this one (#100). This is an expected breaking change added in 3.2.0 and this should people that were using both plugins before this version to migrate.