Visitar URL original
Remove Sass legacy JS API build warnings · Issue #805 · algorithm-visualizer/algorithm-visualizer · GitHub
Skip to content

Remove Sass legacy JS API build warnings #805

Description

@yuyu1815

Problem

Running npm run build emits repeated Dart Sass deprecation warnings:

DEPRECATION WARNING [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.

The warning appears once for each SCSS compilation. The current build stack uses react-scripts@3.0.1 with sass-loader@10.5.2; that loader calls Dart Sass through the legacy render() API.

Why it matters

Dart Sass 2.0.0 will remove the legacy JS API, so this is future breakage rather than just noisy output.

Acceptance criteria

  • npm run build completes without any legacy-js-api Sass warnings.
  • The SCSS/CSS output remains equivalent for the existing app.
  • The fix keeps the CRA 3 build wrapper working on the current Node baseline.

Activity

  1. yuyu1815 commented on May 4, 2026

    @yuyu1815
    Author

    Implemented locally on branch codex/issue-805-sass-modern-loader.

    What changed:

    • scripts/react-scripts.js now preloads a small Sass loader hook for non-eject CRA scripts.
    • Added scripts/sass-modern-loader.js, which compiles SCSS through Dart Sass compileStringAsync() instead of the legacy render() API.
    • Added a webpack-like importer for the repo's current ~common/... SCSS imports and jsconfig.json baseUrl: src resolution.

    Verification:

    • npm run build passes with no legacy-js-api warnings.
    • npm test -- --watchAll=false passes.
    • BROWSER=none PORT=3017 npm start compiles successfully with no legacy-js-api warnings.

    Remaining unrelated warnings observed: Node util._extend deprecation and outdated Browserslist data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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