Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improved the explanation of "version_strategy" option#7519

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@javiereguiluz
Copy link
Member

The idea to improve this came fromsymfony/symfony#21683

packages:
foo_package:
# ... except if a package explicitly uses the empty strategy
version_strategy:'assets.empty_version_strategy'
Copy link
Member

Choose a reason for hiding this comment

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

if you want to use the empty version strategy, a better solution is to configure theversion as empty rather than overwriting the strategy IMO. It avoids relying on the service id used in FrameworkBundle (se my comment in the symfony issue)

# app/config/config.yml
framework:
assets:
# this strategy is applied to every asset (including packages) ...
Copy link
Member

Choose a reason for hiding this comment

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

this strategy is applied to all assets of the default package, and to all custom packages,unless they configure their own version or their own version strategy

The service id of the asset version strategy applied to the assets. In addition
to your own:doc:`custom asset version strategies</frontend/custom_version_strategy>`,
Symfony defines two services for its:ref:`built-in strategies<component-assets-versioning>`:
``assets.empty_version_strategy`` and ``assets.static_version_strategy``.
Copy link
Member

Choose a reason for hiding this comment

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

assets.static_version_strategy isnot usable directly. It is an abstract service. So you cannot use it directly inversion_strategy. If you want to use a static version, use theversion setting (with a non-empty value) instead (which will create a child service configured with this version)

@javiereguiluz
Copy link
MemberAuthor

@stof thanks for your review! I've changed everything and I think it's better now.

version:~
bar_package:
# this package doesn't use the global versioning strategy
version_strategy:'app.asset.another_version_strategy'
Copy link
Member

Choose a reason for hiding this comment

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

I would add a third part not redefining the version or strategy (but changing the base URL for instance), with a comment explaining that it inherits the default strategy, to make it easier to understand. What do you think about it ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I agree. I've done that in7b09de0. Thanks!

Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

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

👍

@xabbuh
Copy link
Member

Thank you Javier.

xabbuh added a commit that referenced this pull requestApr 15, 2017
…viereguiluz)This PR was submitted for the 3.1 branch but it was merged into the 3.2 branch instead (closes#7519).Discussion----------Improved the explanation of "version_strategy" optionThe idea to improve this came fromsymfony/symfony#21683Commits-------9405e65 Improved the explanation of "version_strategy" option
xabbuh added a commit that referenced this pull requestApr 15, 2017
@xabbuhxabbuh closed thisApr 15, 2017
weaverryan added a commit that referenced this pull requestApr 15, 2017
* 3.2: (71 commits)  Rewriting the service container docs  Minor reword  Adding a tip for validation in forms without class  [#7217] add versionadded directives  [#7203] merge note and versionadded directive  Use the new configurator YAML syntax  Added a note about the .htaccess files included by Symfony apps  Made unmapped field example in forms chapter more descriptive  [#7507] fix namespace  [#7507] fix component name  [#7490] minor typo fix  Added a note about redirections to absolute URLs in tests  [#7204] link to API doc  Added docs for JsonResponse::fromJsonString  Added the changes suggested by reviewers  [#7620] use generate() in PHP templates before 2.8  Fixed the RST syntax  Improve example context  Minor formatting changes  [#7519] some minor tweaks  ...
@javiereguiluzjaviereguiluz deleted the asset_versioning branchMay 24, 2018 16:05
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

2 more reviewers

@stofstofstof requested changes

@HeahDudeHeahDudeHeahDude approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

3.1

Development

Successfully merging this pull request may close these issues.

5 participants

@javiereguiluz@xabbuh@stof@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp