这是indexloc提供的服务,不要输入任何密码
Skip to content

Remove StaticAssetsMetadata #13094

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mkurz
Copy link
Member

@mkurz mkurz commented Jan 28, 2025

Currently, we have two approaches for reverse routing public assets, both are described here:

This pull requests removes the first one by removing StaticAssetsMetadata. Reason for removal is to remove all static/"global" state.

However I am not sure if we really should merge this pull request.
Reason is, the first approach is a bit easier for people how do not care about a static state in their applications, like when you are working on a single Play instance and not plan to run multiple Play apps within one jvm.

I think if we just keep both approaches documented it should be ok.

Not sure yet.

val path = base + "/" + value.name
StaticAssetsMetadata.finder.findAssetPath(base, path)
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This removal could cause problems I guess...

Copy link
Member

Choose a reason for hiding this comment

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

You are absolutely right. This is binder for Assets for generated routes are like

GET            /public/*file                      controllers.Assets.versioned(path = "/public", file: controllers.Assets.Asset)

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated the description of the pull request. I could make the PR green by switching everything to assetsfinder.

Copy link
Member

Choose a reason for hiding this comment

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

If we will merge this, we also should remove the method controllers.Assets.versioned(String, Asset) and for that we will should mark it as @Deprecated in 2.9.x and 3.0.x

@mkurz mkurz force-pushed the rm_staticassetsmetadata branch from 3ba91a6 to 24d539c Compare January 29, 2025 13:05
@mkurz mkurz changed the title Try to remove StaticAssetsMetadata Remove StaticAssetsMetadata Jan 30, 2025
@mkurz mkurz force-pushed the rm_staticassetsmetadata branch from 24d539c to 7de4f1b Compare January 30, 2025 08:44
@mkurz mkurz force-pushed the rm_staticassetsmetadata branch from 7de4f1b to 138a51f Compare February 12, 2025 11:17
@mkurz mkurz force-pushed the rm_staticassetsmetadata branch from 138a51f to da7ebb8 Compare February 12, 2025 12:58
@mkurz mkurz linked an issue Mar 17, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Play app global state
2 participants