Move the Navigation Timing API polyfill to the base+polyfill build #248
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR removes the Navigation Timing polyfill from the "standard" build and adds it to the "base+polyfill" build. This reduces the total size of the "standard" build by about 5% (brotli'd).
When this library was first released, Safari didn't support the Navigation Timing API (Level 2), so this was a lightweight and easy way to get the TTFB metric in all modern browsers. But Safari has now supported this API since version 15, which has been out for almost a year.
I think this library should aim to support the latest stable version(s) of all modern browsers when reasonable, but given that this is a measurement library and not a feature library, I don't think full browser support should be a goal.
Also, this change primarily affects the TTFB metric, which is largely a measure of network/device capabilities rather than browser capabilities, so supporting only the latest versions of Safari seems reasonable for optimization purposes.