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

Relative path in custom watchers #3673

Merged
merged 7 commits into from
Aug 10, 2018
Merged

Relative path in custom watchers #3673

merged 7 commits into from
Aug 10, 2018

Conversation

galvez
Copy link

@galvez galvez commented Aug 10, 2018

This was missing in #3633.

@codecov-io
Copy link

codecov-io commented Aug 10, 2018

Codecov Report

Merging #3673 into dev will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #3673      +/-   ##
==========================================
- Coverage   98.94%   98.94%   -0.01%     
==========================================
  Files          18       18              
  Lines        1139     1134       -5     
  Branches      306      304       -2     
==========================================
- Hits         1127     1122       -5     
  Misses         12       12
Impacted Files Coverage Δ
lib/builder/builder.js 98.37% <100%> (-0.05%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d21b60...bfd325b. Read the comment docs.

@@ -631,10 +633,10 @@ export default class Builder {
})

const nuxtRestartWatch = _.concat(
this.options.watch,
this.options.watch.map(path => r(path)),
Copy link
Member

Choose a reason for hiding this comment

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

Could this work as this.options.watch.map(r) as well?

@galvez
Copy link
Author

galvez commented Aug 10, 2018 via email


if (this.nuxtRestartWatcher) {
this.nuxtRestartWatcher.close()
for (const watcher in this.watchers) {
Copy link
Member

Choose a reason for hiding this comment

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

I think this could be simplified. For example: Object.values(this.watchers).forEach(watcher => watcher && watcher.close())

Copy link
Author

@galvez galvez Aug 10, 2018

Choose a reason for hiding this comment

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

@manniL It's tempting, I know, but think about it. That'd be adding two unnecessary function calls to the stack. Object.values() and forEach(), in an obscurely constricted syntax. Using the native for() makes it much more cleaner IMHO :)

Copy link
Member

Choose a reason for hiding this comment

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

for of is proper here

Copy link
Member

Choose a reason for hiding this comment

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

I mean with a map

@clarkdo clarkdo merged commit 1842a3b into nuxt:dev Aug 10, 2018
@lock
Copy link

lock bot commented Oct 31, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 31, 2018
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants