8000 [AssetMapper] Split ImportmapManager into 2 by weaverryan · Pull Request #52120 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[AssetMapper] Split ImportmapManager into 2 #52120

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 1 commit into from
Oct 20, 2023

Conversation

weaverryan
Copy link
Member
@weaverryan weaverryan commented Oct 18, 2023
Q A
Branch? 6.4
Bug fix? yes? (performance bug)
New feature? yes
Deprecations? no
Tickets None
License MIT

Hi!

Just a simple "copy-and-paste" of methods from ImportMapManager to a new ImportMapGenerator. The motivation is performance: ImportMapGenerator is instantiated on production on every request, so this PR results in 2 unnecessary services (RemotePackageDownloader and JsDelivrEsmResolver) no longer being instantiated.

Thanks!

@@ -198,7 +205,6 @@
->set('asset_mapper.importmap.command.require', ImportMapRequireCommand::class)
->args([
service('asset_mapper.importmap.manager'),
param('kernel.project_dir'),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argument wasn't used - unrelated to this PR

/**
* Provides data needed to write the importmap & preloads.
*/
class ImportMapGenerator
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class is a copy-and-paste of methods from ImportMapManager with very few changes

@fabpot fabpot changed the title [AssetMapper] plit ImportmapManager into 2 [AssetMapper] Split ImportmapManager into 2 Oct 18, 2023
@weaverryan weaverryan force-pushed the asset-mapper-split-importmap-manager branch from aace3f1 to 44cee27 Compare October 18, 2023 12:59
@weaverryan weaverryan force-pushed the asset-mapper-split-importmap-manager branch from 44cee27 to 47a5600 Compare October 19, 2023 18:11
@nicolas-grekas nicolas-grekas added the ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" label Oct 19, 2023
@chalasr
Copy link
Member
chalasr commented Oct 20, 2023

The changelog should probably mention this change

@fabpot fabpot force-pushed the asset-mapper-split-importmap-manager branch from 47a5600 to da648b1 Compare October 20, 2023 05:46
@fabpot
Copy link
Member
fabpot commented Oct 20, 2023

Thank you @weaverryan.

@fabpot fabpot merged commit 3f2d9d7 into symfony:6.4 Oct 20, 2023
@weaverryan weaverryan deleted the asset-mapper-split-importmap-manager branch October 20, 2023 11:00
This was referenced Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AssetMapper Bug Feature ❄️ Feature Freeze Important Pull Requests to finish before the next Symfony "feature freeze" Status: Reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
0