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

docs: correct watching dot files #12161

Merged
merged 5 commits into from
Dec 21, 2021
Merged

docs: correct watching dot files #12161

merged 5 commits into from
Dec 21, 2021

Conversation

sfiquet
Copy link
Contributor

@sfiquet sfiquet commented Dec 18, 2021

Summary

The current config documentation states that the watcher ignores dot files and folders by default. This behaviour was changed by PR #10075 back in 2020.

As a user of Nextjs, I noticed that running the dev server concurrently with jest --watch caused Jest to constantly rerun all the tests when no source file had changed. This was due to the dev server writing to folder /.next, with the Jest watcher enthusiastically kicking in. The incorrect documentation made much harder to find the origin of the problem.

Test plan

This is purely documentation, limited to the paragraph about dotfiles watching in section watchPathIgnorePatterns.

@codecov-commenter
Copy link

codecov-commenter commented Dec 18, 2021

Codecov Report

Merging #12161 (4234e79) into main (e835fae) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #12161   +/-   ##
=======================================
  Coverage   67.72%   67.72%           
=======================================
  Files         328      328           
  Lines       16993    16993           
  Branches     4818     4818           
=======================================
  Hits        11508    11508           
  Misses       5452     5452           
  Partials       33       33           

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 e835fae...4234e79. Read the comment docs.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

thanks! Could you update the versioned docs this applies to as well? (meaning in docs/, 26.x and all of 27, I guess?)

image

@sfiquet
Copy link
Contributor Author

sfiquet commented Dec 21, 2021

I'm on it!

Since the change in behaviour happened in version 26.2.0, the doc for 26.x should probably describe the behaviour before and after the change, right?

Also, do I need to add an item in the changelog or is this too trivial?

@SimenB
Copy link
Member

SimenB commented Dec 21, 2021

The way the 26.x ocs work is that they capture the latest release of that major, so just after is fine 🙂

Also, do I need to add an item in the changelog or is this too trivial?

Not needed as it won't be part of any code that's released 👍

@sfiquet
Copy link
Contributor Author

sfiquet commented Dec 21, 2021

I think I should clarify that version control folders are ignored or it might cause unnecessary concern. What do you think of this alternative wording?

Even if nothing is specified here, the watcher will ignore changes to the version control folders (.git, .hg). Other hidden files and directories, i.e. those that begin with a dot (.), are watched by default. Remember to escape the dot when you add them to watchPathIgnorePatterns as it is a special RegExp character.

@SimenB
Copy link
Member

SimenB commented Dec 21, 2021

Yeah, that sounds good. Thanks!

@SimenB
Copy link
Member

SimenB commented Dec 21, 2021

Prettier is unhappy, mind running it?

@sfiquet
Copy link
Contributor Author

sfiquet commented Dec 21, 2021

Sorry about that. I didn't realise it was necessary for documentation.

@SimenB
Copy link
Member

SimenB commented Dec 21, 2021

No worries! 😀

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

looks great, thanks!

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants