Skip to content

Need to Reset Webpack Encore Tag Renderer and Entrypoint Lookup for Multi-page Rendering with Twig #243

@pupaxxo

Description

@pupaxxo

Symfony version(s) affected

6.4.x

Description

To render multiple HTML pages using Twig, we likely need to reset Webpack Encore's tag renderer and entrypoint lookup services. Without resetting these services, some files may miss their entrypoints because the tag renderer assumes they have already been rendered. While there is a reset method for the tag renderer, it doesn't reset the entrypoint lookup. The entrypoint lookup does have a reset method, but we do not have access to the service locator, so we cannot determine the available packages.

How to reproduce

This issue is not tied to a specific bug but to a missing feature. We need the ability to reset both the Webpack Encore tag renderer and the entrypoint lookup when rendering multiple HTML pages using Twig. Currently, we can reset the tag renderer, but the entrypoint lookup cannot be reset without access to the service locator, which prevents us from managing multiple page renders properly.

Possible Solution

Use ReflectionApi to access the service locator inside the entrypoint collection interface?

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions