Skip to content

javascript module support #1128

Description

@rubydesign

As a long time haml user i really like how haml makes the html very precise

Now javascript modules are supported by browsers, and rails 7 has the importmap support.
So we can drop packers, web or otherwise.
But JS module code and non module code don't mix well, and currently there is no support for writing module js in haml.

I read the issues and it seems a similar request was made 5 years ago, but i think things have changed to revisit the topic.
Then it was said modules is a fringe thing, that's not true anymore
And it was said that one can just use a script tag And while this is true, we would not need a the whole javascript filter if it were the whole story.

So, reading the code, i don't really see a way to get options into a filter on a case by case basis. In a way i think this would be nicest, if one could do :javascript{module: true}
But if that is too disruptive, i would suggest a :module filter, that is very similar to javascript filter, just adds the module

I can make a pr if the feature would be accepted. Probably will write the filter just for myself anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions