-
Notifications
You must be signed in to change notification settings - Fork 214
Conversation
From v0.17.0 onwards, Sapper uses cheap-watch instead of chokidar
I did peek briefly at this the other day, and my main concern was that perhaps rollup would use a peer dep of chokidar for something if it found one. Even with cheap-watch being used for Sapper's own internal watches when creating route manifests, rollup's watch is still used for the main build. When I tried removing chokidar, things seemed fine, but it was possible I made rollup's watching more flaky in some way by doing this. I'm not clear on what rollup's watch mode does when it doesn't find chokidar, or whether it using chokidar is an opt-in or opt-out thing. |
Thanks for looking into it. Seems to be opt-in. They've run into problems and considered making chokidar the default watcher (e.g. this issue has a repro, but as an app-specific false positive, seems acceptable?) I'm not knowledgeable of the issues chokidar prevents (what's the impact of its native fsevents module, and which optimizations still apply to the versions of Node that Sapper targets). |
I had misread the Close for now? It'd probably be safer to ask people who use this template on Discord and see if they run into problems when they remove chokidar. (Bit of a bother for a minor thing, but for somebody feeling adventurous and who's run out of other things to do...) |
From my tests the other day, it looks like Chokidar is opt-in, even if it's available locally. This agrees with @lukeed's experience with Rollup and Chokidar, and seems to match the docs. I'm going to go ahead an merge this - I really don't think that Chokidar gets used unless you specifically enable it, which is not happening in sapper or sapper-template. |
Thanks. Could be environment specific. I didn't run into any issues without it, and to be honest, the fsevents module probably introduces more installation/upgrade headaches than going without chokidar. Here's the call stack on a clean project with the previous revision (before this PR was merged):
|
@cristianl This is causing random reloads on OSX 10.14.4 using @atom editor. Re-adding chokidar as dev dependency seems to fix it. May be this is one of the edge cases @Conduitry was talking about. |
This is probably extraneous, but in case my problem crops up again, I wanted to make sure this item was cross linked with sveltejs/sapper#703 |
From v0.17.0 onwards, Sapper uses cheap-watch instead of chokidar.
Live reloading works when you create a project with
npx degit sveltejs/sapper-template#rollup
and remove chokidar from the resulting package.json before installing. Nothing else in the project depends on chokidar.Closes #129