-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: rename util to lazy injection token #901
refactor: rename util to lazy injection token #901
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @davidlj95 and the rest of your teammates on Graphite |
📦 Bundle size (Angular v18)Git ref:
|
📦 Bundle size (Angular v17)Git ref:
|
📦 Bundle size (Angular v15)Git ref:
|
📦 Bundle size (Angular v16)Git ref:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #901 +/- ##
=======================================
Coverage 99.46% 99.46%
=======================================
Files 79 79
Lines 372 372
Branches 73 73
=======================================
Hits 370 370
Partials 2 2 ☔ View full report in Codecov by Sentry. |
🎉 This PR is included in version 1.0.0-beta.17 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Issue or need
After giving a try to apply the recently created (in #892) function to create lazy injection tokens, found out a repeating pattern.
(Lazy) tokens were being declared as:
The
() =>
part could actually be part of the util. Given will always be like that in order to allow tree shaking injection tokens.Actually the util could be as is + then create another one
_lazy
that uses_make
under the hood.Buuut the logic of lazyness is in the
_make
one (not creating 2 tokens if one exists). Soo makes sense that for now it's just one API.It's internal, so can be decomposed later if needed.
Proposed changes
Rename util to
_lazyInjectionToken
as it will now return lazy injection tokens.Add a type to specify what actually a
_LazyInjectionToken
is. Plus some docs.Fix tests
Quick reminders