Skip to content

Migrate spec/dummy to use SWC transpilerΒ #2198

@justin808

Description

@justin808

Summary

The spec/dummy test application currently uses Babel as the JavaScript transpiler (Shakapacker 8.2.0 default). With Shakapacker 9.3.0+, SWC is the default transpiler and is ~20x faster than Babel.

Current State

  • spec/dummy/package.json: Uses Babel dependencies (@babel/core, babel-loader, etc.)
  • spec/dummy/config/shakapacker.yml: No javascript_transpiler setting (defaults to Babel)
  • Shakapacker version: 8.2.0

Proposed Changes

  1. Update spec/dummy/config/shakapacker.yml to add:

    default: &default
      javascript_transpiler: swc
  2. Add SWC dependencies to spec/dummy/package.json:

    "devDependencies": {
      "@swc/core": "^1.7.0",
      "swc-loader": "^0.2.6"
    }
  3. Optionally upgrade Shakapacker to 9.3.0+ to get the default SWC behavior

  4. Verify all tests pass with the new configuration

Benefits

  • Faster webpack builds during test runs
  • Better alignment with recommended Shakapacker 9.3.0+ defaults
  • Tests will exercise the SWC code path

Testing Checklist

  • rake run_rspec:dummy passes
  • yarn build:test completes successfully
  • Hot reloading works in development mode
  • All integration tests pass

Related

This issue was created as a follow-up to the SWC detection feature PR to keep changes focused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions