feat: add data-nuxt-img and data-nuxt-pic attrs - #747
Conversation
This commit adds data attributes to usages of nuxt/image and nuxt/picture. This will allow us to compare performance results (in aggregate) for apps that use the components against apps that use normal <img> or <picture> tags. Currently, it isn't possible because there isn't a good way to distinguish the two in HTTP Archive. Doing such a perf comparison allows us to: - ensure that these components actually improve performance - catch and fix performance regressions quickly
✅ Deploy Preview for nuxt-image-v1 canceled.
|
|
Thanks for pull request @kara! Since last time we discussed, adding
Would be happy to discuss if you think still are merits to always include attrs to all components. |
|
@pi0 After the last meeting, I did some digging in HTTPArchive and saw that the average number of images per page is ~20 images. Given that 13 chars * 20 is only ~260 bytes, it seemed like a reasonable trade-off for being friendlier to integration with dev tooling for users. That said, we can do analysis on DOM properties as well, it's just a bit more work for us in HTTPArchive, so if you prefer client-side only, happy to update the PR. |
c7742b8 to
9f8a301
Compare
|
@pi0 Thought about it more and realized that we can always switch to "data-" attributes if/when we decide to integrate with dev tooling, so we might as well do the slimmer, client-side option now. Just updated the PR to make it client-side only. |
pi0
left a comment
There was a problem hiding this comment.
Thanks. LGTM. We can change strategy to more explicit dom if needed in next iterations.
Feature detection was added in nuxt#747 to allow performance analysis for nuxt/image uses in aggregate. Since that time, Javascript-based feature markers have been standardized in the W3C group around the User Timing API: https://www.w3.org/TR/user-timing/#dfn-mark_feature_usage This commit updates the feature tracking to use the new standard, which is designed to be performance-neutral. The previous mechanism (the data- attributes) will be removed in a future PR, once we can confirm it works as expected end-to-end.
Feature detection was added in nuxt#747 to allow performance analysis for nuxt/image uses in aggregate. Since that time, Javascript-based feature markers have been standardized in the W3C group around the User Timing API: https://www.w3.org/TR/user-timing/#dfn-mark_feature_usage This commit updates the feature tracking to use the new standard, which is designed to be performance-neutral. The previous mechanism (the data- attributes) will be removed in a future PR, once we can confirm it works as expected end-to-end.
Feature detection was added in nuxt#747 to allow performance analysis for nuxt/image uses in aggregate. Since that time, Javascript-based feature markers have been standardized in the W3C group around the User Timing API: https://www.w3.org/TR/user-timing/#dfn-mark_feature_usage This commit updates the feature tracking to use the new standard, which is designed to be performance-neutral. The previous mechanism (the data- attributes) will be removed in a future PR, once we can confirm it works as expected end-to-end.
Feature detection was added in nuxt#747 to allow performance analysis for nuxt/image uses in aggregate. Since that time, Javascript-based feature markers have been standardized in the W3C group around the User Timing API: https://www.w3.org/TR/user-timing/#dfn-mark_feature_usage This commit updates the feature tracking to use the new standard, which is designed to be performance-neutral. The previous mechanism (the data- attributes) will be removed in a future PR, once we can confirm it works as expected end-to-end.
Feature detection was added in nuxt#747 to allow performance analysis for nuxt/image uses in aggregate. Since that time, Javascript-based feature markers have been standardized in the W3C group around the User Timing API: https://www.w3.org/TR/user-timing/#dfn-mark_feature_usage This commit updates the feature tracking to use the new standard, which is designed to be performance-neutral. The previous mechanism (the data- attributes) will be removed in a future PR, once we can confirm it works as expected end-to-end.
This commit adds data attributes to usages of nuxt/image and nuxt/picture. This will allow us to compare performance results (in aggregate) for apps that use the components against apps that use normal
<img>or<picture>tags. Currently, it isn't possible because there isn't a good way to distinguish the two in HTTP Archive.Doing such a perf comparison allows us to: