You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "ast" gem, a core dependency of better-html, is no longer actively maintained, with its most recent non-trivial commit happening nearly 3 years ago. Having crucial functionality of the gem be dependent on "ast" is unsustainable at best and dangerous at worst. Therefore, better-html should ideally move towards making its own AST class. It frankly does not utilize much of the features from the "ast" gem anyways, so writing a tailormade AST class for better-html should not be too challenging.
The content you are editing has changed. Please copy your edits and refresh the page.
Indeed, having a handcrafted AST will be more robust, organized and will allow for additional functionality to be built on top of better-html. We'd gladly accept a contribution!
@vinistock
A bit of bad news with a silver lining.
Turns out the rewriting the AST class is not so simple because it is tightly coupled with the parser in two aspects. First is via the tokenizer of better-html. The second link through Whitequark's Parser that is used in small parts of the gem. I believe it is only used to provide test helpers for the gem users, but it is used nonetheless, and we must accomodate it at the moment.
My proposal is that this issue should be addressed as part of a larger refactor/rewrite that replaces Whitequark's parser with Prism. I understand that the Prism team is interested in finding gems that use non-canonical parsers, so I hope this information is of use to them.
Agreed, we should definitely switch to using Prism. It might be a larger refactor, but if you're interested in taking a stab at it, I believe that's the right path forward.
The "ast" gem, a core dependency of better-html, is no longer actively maintained, with its most recent non-trivial commit happening nearly 3 years ago. Having crucial functionality of the gem be dependent on "ast" is unsustainable at best and dangerous at worst. Therefore, better-html should ideally move towards making its own AST class. It frankly does not utilize much of the features from the "ast" gem anyways, so writing a tailormade AST class for better-html should not be too challenging.
Tasks
The text was updated successfully, but these errors were encountered: