NativeScript / nativescript-dev-sass

SASS CSS pre-processor for NativeScript projects
Apache License 2.0
44 stars 17 forks source link

add watch capability #22

Closed PeterStaev closed 7 years ago

PeterStaev commented 7 years ago

First of all thanks for this plugin! Have been using it in a new project, and noticed some slow-up/problems with the new tns run that does automatic watch. This patch addresses the following:

The code rewrite was greatly inspired by the nativescript-dev-typescript plugin 😄

toddanglin commented 7 years ago

Thanks for the impressive contrib, Peter!

I didn't notice this PR before doing some refactoring for the upcoming 3.0 release, BUT I think your fixes will solve other issues people are having with 2.5.x. Let me try to resolve the conflicts and merge this weekend. Should make the plugin robust and ready for all versions of {N} CLI.

toddanglin commented 7 years ago

Worked on merging your contributions over the weekend. GREAT refactoring. Thanks again for taking the time to make it.

Through my testing, with these changes, SASS LiveSync works as expected in {N} 2.5.x and 3.0.0-rc.

In {N} 2.4.x, however, LiveSync changes to SASS files trigger a relaunch of the app (versus doing a faster, in-place update of the styles).

SO...this new approach improves the LiveSync experience for 2.5.x and higher, but (seems to) degrade slightly for 2.4 and lower. I'm wondering if that's okay and we should just guide people to use the current version of the plugin if they're on {N} 2.4 or earlier. What do you think?

PeterStaev commented 7 years ago

Glad it works with 3.0-rc as well!

As for older version - I think it should be fine as long as we have some note in the readme that if you are using version pre-2.5 you should specifically install version ~0.4. And if you are using version 2.5+ to use the new version.

toddanglin commented 7 years ago

Changes integrated via #25