Skip to content

Easier handling of multiple pack_tag invocations #39

@tomdracz

Description

@tomdracz

Continuing from discussions like rails/webpacker#3068

We are now raising an error when pack_tag helpers are used multiple times during the rendering. This solves hard to debug issues with double script loading, but it's fairly heavy handed approach, especially if we don't provide easy way to solve those issues. At the moment, users are required to roll out some custom logic to get all their packs in a single place.

We should look and see if we can improve the experience here in any way. Ideally calling *_pack_tag multiple times would "just" work, but there's complexities here around load order, ideal placement of runtime check etc

As a first step, maybe simply adding a view helper to register additional packs that then get added in pack_tag call is enough to improve the experience?

Suggestions definitely welcome!

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