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

fix: hmr schema watcher had an always truthy conditional check #67

Merged
merged 6 commits into from
Sep 3, 2023

Conversation

sduduzog
Copy link
Contributor

@sduduzog sduduzog commented Aug 11, 2023

Multimatch always returns an array, even an empty one when there's no match, which is a truthy value. This meant that templates were always updated even if it's not schema files that were changed.

Another significant change is resolving schema as path patterns. The path argument from the watch hook is absolute, so an unresolved schema that starts with ./ would have always been false. This would not have been found because of the first bug with the matcher condition.

I'm not sure, but it might help with #57

@tobiasdiez
Copy link
Owner

Thanks for your contributions. On a first glance they look good, but I will only have time for a more in depth review in a few weeks once I'm back from holidays. Sorry for the delay

@sduduzog
Copy link
Contributor Author

Oh no, no worries. Enjoy the rest of your holidays @tobiasdiez I don't think there's much urgency for this at this time

Copy link
Owner

@tobiasdiez tobiasdiez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now played around with your branch, but have issues with the schema resolving. For me path is not an absolute path...

src/module.ts Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2023

Codecov Report

Merging #67 (5eabbb4) into main (b4591ce) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##              main       #67   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           10        10           
  Branches         2         2           
=========================================
  Hits            10        10           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@tobiasdiez
Copy link
Owner

Thanks again for your contribution, very much appreciated!

@tobiasdiez tobiasdiez merged commit 4104b50 into tobiasdiez:main Sep 3, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants