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

size-limit --watch #162

Open
ai opened this issue Feb 13, 2020 · 15 comments
Open

size-limit --watch #162

ai opened this issue Feb 13, 2020 · 15 comments

Comments

@ai
Copy link
Owner

ai commented Feb 13, 2020

Option to re-run script on any file changes in the project

@Windrushfarer
Copy link
Contributor

Windrushfarer commented Feb 19, 2020

I started hacking this issue, but I have a question: when user has multiple files for checking is it needed to check the size of the only file/files that have been changed? I have a solution now, but size-limit will always check all files in watch mode. I found hard to make size-limit checking individual files when they have been changed

@ai
Copy link
Owner Author

ai commented Feb 19, 2020

is it needed to check the size of the only file/files that have been changed?

It is OK to check all

@terdenan
Copy link

@ai, is it worth using third party packages like chokidar that enhance fs.watch from standart library or it's preferable to provide zero dependency solution?

@ai
Copy link
Owner Author

ai commented Feb 19, 2020

What is the difference?

@terdenan
Copy link

We either get +1 dependency and don't reinvent workarounds that eliminate fs.watch's problems or do it by our own and don't add extra dependencies to the project.

@ai
Copy link
Owner Author

ai commented Feb 20, 2020

What fs.watch problems do we have?

@terdenan
Copy link

According to docs fs.watch doesn't support recursive watch on Linux (didn't check myself). Some events might be fired multiple times (simply being solved using debounce).

@ai
Copy link
Owner Author

ai commented Feb 20, 2020

What is recursive watch?

@terdenan
Copy link

fs.watch has option recursive, which indicates whether all subdirectories should be watched, or only the current directory

@ai
Copy link
Owner Author

ai commented Feb 20, 2020

Yeap, we need recursive watch and Linux support.

What third party libraries do we have and what is the difference between them?

@terdenan
Copy link

I've briefly examined only 2. I can take a closer look a little bit later.
chokidar and watchpack (which webpack uses under the hood).
chokidar seems to have more flexibility in terms of configuring performance of the tool: recursion depth and awaitWriteFinish when large files are being written to filesystem
watchpack in turn has less dependencies :)

@ai
Copy link
Owner Author

ai commented Feb 20, 2020

I think we need more investigating.

@iegik
Copy link

iegik commented Mar 8, 2020

@KisyaLisya
Copy link
Contributor

I've implemented this. Please check https://github.com/jayhoney/size-limit/tree/feature/watch-mode

@ai
Copy link
Owner Author

ai commented Mar 13, 2020

@jaydenseric great! Looks good.

Can you send pull request? it has better UI for code review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants