8000 [spiral/prototype] Initialize PrototypeRegistry only when registry requires from container by msmakouz · Pull Request #1005 · spiral/framework · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
butschster merged 5 commits intomasterfrom
feature/lazy-prototype-registry
Oct 19, 2023
Merged

[spiral/prototype] Initialize PrototypeRegistry only when registry requires from container#1005
butschster merged 5 commits intomasterfrom
feature/lazy-prototype-registry

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.

@msmakouz msmakouz requested a review from butschster October 18, 2023 14:58
@butschster butschster merged commit 6d9b58f into master Oct 19, 2023
@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

0