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

[spiral/prototype] Initialize PrototypeRegistry only when registry requires from container #1005

Merged
merged 5 commits into from
Oct 19, 2023

Conversation

msmakouz
Copy link
Member

@msmakouz msmakouz commented Oct 18, 2023

Q A
Bugfix?
Breaks BC?
New feature? ✔️

This Pull Request improves the way Spiral\Prototype\PrototypeRegistry initializes. Previously, it was initialized upon application bootstrap, even when not in use, leading to inefficient resource consumption. The change introduced Spiral\Prototype\Config\PrototypeConfig, which serves as a central configuration file for managing bindings. Third-party packages can now easily contribute their own bindings to this configuration via bootloader.

The PrototypeRegistry is now created only when first requested from the container and utilizes the bindings defined in PrototypeConfig.

@msmakouz msmakouz added this to the 3.9 milestone Oct 18, 2023
@msmakouz msmakouz self-assigned this Oct 18, 2023
@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (67363ef) 89.40% compared to head (6c607b6) 89.14%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1005      +/-   ##
============================================
- Coverage     89.40%   89.14%   -0.27%     
- Complexity     6122     6124       +2     
============================================
  Files           811      812       +1     
  Lines         17314    17312       -2     
============================================
- Hits          15480    15433      -47     
- Misses         1834     1879      +45     
Files Coverage Δ
src/Prototype/src/Annotation/Line.php 0.00% <ø> (-60.00%) ⬇️
src/Prototype/src/Annotation/Parser.php 0.00% <ø> (-90.48%) ⬇️
...c/Prototype/src/Bootloader/PrototypeBootloader.php 92.85% <100.00%> (+1.42%) ⬆️
src/Prototype/src/Command/AbstractCommand.php 100.00% <100.00%> (ø)
src/Prototype/src/Command/InjectCommand.php 87.23% <100.00%> (ø)
src/Prototype/src/Command/ListCommand.php 80.00% <100.00%> (ø)
src/Prototype/src/Config/PrototypeConfig.php 100.00% <100.00%> (ø)
src/Prototype/src/PrototypeLocatorListener.php 90.00% <100.00%> (ø)
src/Prototype/src/Traits/PrototypeTrait.php 100.00% <ø> (ø)
src/Reactor/src/FileDeclaration.php 100.00% <100.00%> (ø)
... and 1 more

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@butschster butschster merged commit 6d9b58f into master Oct 19, 2023
9 checks passed
@butschster butschster deleted the feature/lazy-prototype-registry branch October 19, 2023 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Initialize PrototypeRegistry only when registry requires from container
3 participants