Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy load @parcel/watcher and fallback to chokidar #2414

Merged
merged 5 commits into from
Nov 1, 2024

Conversation

ntkme
Copy link
Contributor

@ntkme ntkme commented Oct 26, 2024

Depends on google/dart_cli_pkg#169

With this change, it no longer fails on loading sass on CLI or API if @parcel/watcher's optional dependency is not available. The error about missing optional dependency is printed once per execution only if user actually used --watch flag on CLI, and then it fallbacks to chokidar for that whole execution.

To test the new behavior, run npm install --omit optional to remove @parcel/watcher's optional depenency. Then run node build/npm/sass.js or node build/npm/sass.js --watch [...] to see it in action.

I'm bumping dart-sdk requirement to 3.3.0 in order to use new dart:js_interop, as the legacy package:js_interop/js_interop.dart is giving me lots of troubles. E.g. cannot add non-static helper methods to an @JS class etc.

@ntkme ntkme marked this pull request as draft October 26, 2024 21:59
@ntkme ntkme force-pushed the optional-parcel-watcher branch 2 times, most recently from ec49bf8 to 684d3d6 Compare October 27, 2024 00:09
@ntkme ntkme marked this pull request as ready for review October 27, 2024 00:13
lib/src/io/js.dart Outdated Show resolved Hide resolved
pubspec.yaml Outdated Show resolved Hide resolved
@nex3
Copy link
Contributor

nex3 commented Oct 31, 2024

Actually, shouldn't this also set @parcel/watcher as an optionalDependency in package/package.json?

@ntkme
Copy link
Contributor Author

ntkme commented Oct 31, 2024

Actually, shouldn't this also set @parcel/watcher as an optionalDependency in package/package.json?

Good call. Updated.

@nex3 nex3 merged commit 39d3726 into sass:main Nov 1, 2024
39 checks passed
@ntkme ntkme deleted the optional-parcel-watcher branch November 1, 2024 23:05
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.

Can't run on arm-musl platform since 1.76.5
2 participants