Skip to content

perf: remove metadata definition class #163

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

Merged
merged 2 commits into from
Jan 14, 2024

Conversation

davidlj95
Copy link
Owner

@davidlj95 davidlj95 commented Jan 13, 2024

In spirit of reducing bundle size, removing metadata definition classes hierarchy. And all those global / scoped stuff. Simplifies code + given they're making objects instead of declaring classes, code can be shortened hence gaining in performance too.

It also renames a bit of core names:

  • Metadata: now is MetadataProvider. Indicates more that provides functionality for a metadata
  • MetadataDefinition: now is just metadata. Shorter :)

Also, clean up unneeded files like:

  • BaseXMetadataDefinition: using functions instead now to generate those
  • provideMetadata: no longer needed, using provide metadata factory around
  • Open Graph scope file

Copy link
Owner Author

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

clean up unneeded base class files
Copy link

github-actions bot commented Jan 13, 2024

📦 Bundle size (Angular v17)

Git ref: 232dede

Module file Size Base size Difference
ngx-meta-core.mjs 3279 bytes (3.3KiB) 3474 bytes (3.4KiB) -5.61%: -195 bytes (-195B)
ngx-meta-json-ld.mjs 296 bytes (296B) 300 bytes (300B) -1.33%: -4 bytes (-4B)
ngx-meta-open-graph-profile.mjs 322 bytes (322B) 382 bytes (382B) -15.70%: -60 bytes (-60B)
ngx-meta-open-graph.mjs 805 bytes (805B) 857 bytes (857B) -6.06%: -52 bytes (-52B)
ngx-meta-routing.mjs 1307 bytes (1.3KiB) 1307 bytes (1.3KiB) No change
ngx-meta-standard.mjs 1486 bytes (1.5KiB) 1538 bytes (1.6KiB) -3.38%: -52 bytes (-52B)
ngx-meta-twitter-card.mjs 596 bytes (596B) 648 bytes (648B) -8.02%: -52 bytes (-52B)

Copy link

github-actions bot commented Jan 13, 2024

📦 Bundle size (Angular v15)

Git ref: 232dede

Module file Size Base size Difference
ngx-meta-core.mjs 3553 bytes (3.5KiB) 3741 bytes (3.7KiB) -5.02%: -188 bytes (-188B)
ngx-meta-json-ld.mjs 470 bytes (470B) 473 bytes (473B) -.63%: -3 bytes (-3B)
ngx-meta-open-graph-profile.mjs 462 bytes (462B) 511 bytes (511B) -9.58%: -49 bytes (-49B)
ngx-meta-open-graph.mjs 970 bytes (970B) 1021 bytes (1021B) -4.99%: -51 bytes (-51B)
ngx-meta-routing.mjs 1522 bytes (1.5KiB) 1522 bytes (1.5KiB) No change
ngx-meta-standard.mjs 1644 bytes (1.7KiB) 1695 bytes (1.7KiB) -3.00%: -51 bytes (-51B)
ngx-meta-twitter-card.mjs 759 bytes (759B) 810 bytes (810B) -6.29%: -51 bytes (-51B)

Copy link

github-actions bot commented Jan 13, 2024

📦 Bundle size (Angular v16)

Git ref: 232dede

Module file Size Base size Difference
ngx-meta-core.mjs 3549 bytes (3.5KiB) 3737 bytes (3.7KiB) -5.03%: -188 bytes (-188B)
ngx-meta-json-ld.mjs 470 bytes (470B) 473 bytes (473B) -.63%: -3 bytes (-3B)
ngx-meta-open-graph-profile.mjs 462 bytes (462B) 511 bytes (511B) -9.58%: -49 bytes (-49B)
ngx-meta-open-graph.mjs 970 bytes (970B) 1021 bytes (1021B) -4.99%: -51 bytes (-51B)
ngx-meta-routing.mjs 1522 bytes (1.5KiB) 1522 bytes (1.5KiB) No change
ngx-meta-standard.mjs 1644 bytes (1.7KiB) 1695 bytes (1.7KiB) -3.00%: -51 bytes (-51B)
ngx-meta-twitter-card.mjs 759 bytes (759B) 810 bytes (810B) -6.29%: -51 bytes (-51B)

fix missing renames
remove unneeded tests
use helper method for dry in resolver test
remove unneeded file
@davidlj95 davidlj95 force-pushed the stacked/perf-remove-metadata-definition-class branch from 1ab1ba3 to 232dede Compare January 14, 2024 15:24
@davidlj95 davidlj95 merged commit cf310f6 into main Jan 14, 2024
@davidlj95 davidlj95 deleted the stacked/perf-remove-metadata-definition-class branch January 14, 2024 15:43
Copy link

🎉 This PR is included in version 1.0.0-alpha.21 🎉

The release is available on:

Your semantic-release bot 📦🚀

@davidlj95 davidlj95 linked an issue Jan 15, 2024 that may be closed by this pull request
@davidlj95 davidlj95 linked an issue Jan 19, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce bundle size Allow scoped metadata to be undefined
1 participant