Skip to content

1.30.2

Latest

Choose a tag to compare

@onigoetz onigoetz released this 12 Jul 13:40
· 9 commits to master since this release

1.30.2

React Compiler support

Crafty now supports the React Compiler through SWC, working across all three SWC-backed bundlers (webpack, Rspack, and Gulp) (#3230).

It is off by default and opt-in per bundle:

{
  bundles: {
    app: {
      react: { reactCompiler: true }
    }
  }
}

Passing true uses the compiler defaults; passing an object forwards options such as target (for React 17/18) and compilationMode. It is independent of Fast Refresh and runs in both development and production. Rspack requires @rspack/core ≥ 2.1.0. See the crafty-preset-react README for details.

TypeScript path mapping

TypeScript's compilerOptions.paths / baseUrl aliases are now honored during actual module resolution, not just by the type-checker and the ESLint import resolver (#3231).

Path mapping now works across webpack, Rspack, Jest, and Vitest, all backed by the same enhanced-resolve tsconfig engine for identical semantics. The Gulp runner is intentionally not supported, because tsc keeps import specifiers as written when it emits files one by one; this is documented as a limitation.

Bug fixes

  • Fixed several Vitest integration problems in mixed projects using crafty-preset-babel, crafty-preset-typescript, and crafty-preset-vitest together (#3178):
    • Babel could incorrectly take over .ts/.tsx test files and fail them with parse errors. The Babel Vitest plugin is now limited to JavaScript files.
    • JSX tests could fail when importing a relative TypeScript helper, because Babel converted the import to CommonJS and bypassed Vitest's TypeScript-aware resolution. ESM modules are now kept in the Babel Vitest hook.
    • Crafty's bundled source-map support could misdetect DOM environments (happy-dom, jsdom) as browsers and trigger localhost requests, surfacing as ECONNREFUSED, GET http://localhost/.../*.ts 404, or jsdom NetworkError noise. Crafty now installs source-map-support with an explicit Node environment. Production webpack source maps are unaffected.

Internal

  • Yarn upgraded to 4.15.0.
  • CI actions bumped: actions/checkout to v7, actions/setup-node to v6, actions/setup-java to v5.5.0.

Tool updates

  • ESLint: 10.4.1 → 10.6.0
  • typescript-eslint: 8.61.0 → 8.63.0
  • Rspack: 2.0.6 → 2.1.2
  • Vitest: 4.1.8 → 4.1.10
  • SWC: 1.15.40 → 1.15.43
  • postcss: 8.5.15 → 8.5.16
  • browserslist: 4.28.2 → 4.28.5
  • enhanced-resolve: 5.23.0 → 5.24.2
  • @vercel/ncc: 0.38.4 → 0.44.1

Thanks for the bug reports and contributions

Thanks to @AndreySushkovich for the Vitest/Babel/TypeScript integration fixes.

Full changelog

v1.30.1...v1.30.2