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

feat: add time options to set loading network speed, latency and message #384

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

EvgenyWas
Copy link
Contributor

This PR introduces a new time field for check configuration to customize @size-limit/time plugin loading time with such options as network speed, latency, and message.

Resolves #325

Further enhancement:

  • extend time options with customization of running time calculation.

README.md Outdated
@@ -14,7 +14,7 @@ if the cost exceeds the limit.
that use their own bundler or small npm libraries with many files.
* Can calculate **the time** it would take a browser
to download and **execute** your JS. Time is a much more accurate
and understandable metric compared to the size in bytes.
and understandable metric compared to the size in bytes. Additionally, you can customize it via config for every check with network speed, latency and so on.
Copy link
Owner

Choose a reason for hiding this comment

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

Looks good but we need more examples in docs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the suggestion. I've added the documentation to the time plugin and left the reference in the root readme.

@ai
Copy link
Owner

ai commented Jan 30, 2025

I am going to FOSDEM on this weekend and will be able to review it only next week

README.md Outdated
@@ -14,7 +14,7 @@ if the cost exceeds the limit.
that use their own bundler or small npm libraries with many files.
* Can calculate **the time** it would take a browser
to download and **execute** your JS. Time is a much more accurate
and understandable metric compared to the size in bytes.
and understandable metric compared to the size in bytes. Additionally, you can [customize time plugin] via config for every check with network speed, latency and so on.
Copy link
Owner

@ai ai Jan 30, 2025

Choose a reason for hiding this comment

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

Suggested change
and understandable metric compared to the size in bytes. Additionally, you can [customize time plugin] via config for every check with network speed, latency and so on.
and understandable metric compared to the size in bytes.
Additionally, you can [customize time plugin] via config
for every check with network speed, latency and so on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Limited to 80 columns, thanks!

@@ -3,7 +3,44 @@
The plugin for [Size Limit] to track JS download and execution time by [estimo]
and Puppeter.

See Size Limit docs for more details.
## Custom options
Copy link
Owner

Choose a reason for hiding this comment

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

Let’s replace it to Customize Network Speed (capitalized)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thank you!

See Size Limit docs for more details.
## Custom options

By default, Size Limit measures the loading time of your files using a slow 3G network (50 kB/s) without latency. You can customize these settings for each check by modifying your Size Limit configuration:
Copy link
Owner

Choose a reason for hiding this comment

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

We need to keep 80 columns limit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I updated my workspace settings to limit it to 80 columns and updated the doc.

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

Successfully merging this pull request may close these issues.

Add customisation for improving performance culture
2 participants