GithubHelp home page GithubHelp logo

Comments (15)

rwjblue avatar rwjblue commented on June 16, 2024 2

Needs review (I pinged folks), but shouldn't take too long to land + release once its been reviewed.

from ember-angle-brackets-codemod.

GavinJoyce avatar GavinJoyce commented on June 16, 2024 1

@rwjblue I'd be interested in these pointers too. Having worked with HBS codemods a little, it's clear that there is an opportunity to make some fundamental changes which will enable much more comprehensive tooling possible. @patocallaghan and I are keen on helping get tools like prettier for hbs into a great place and addressing these fundamental issue seems like a good first step.

from ember-angle-brackets-codemod.

GavinJoyce avatar GavinJoyce commented on June 16, 2024 1

From #dev-ember-js on discord:

Screen Shot 2019-04-30 at 21 40 21

from ember-angle-brackets-codemod.

rwjblue avatar rwjblue commented on June 16, 2024

FWIW, this is a large issue over in prettier's side too (changing   to ) due to the underlying issue. I'd personally be happy to add a mode to the glimmer parser to avoid translation of entities (also happy to point folks in the right direction on how to wire that up) that we could use for thigns like this lib, prettier, ember-template-recast, etc where you want a source -> source transformation instead of normal precompilation.

from ember-angle-brackets-codemod.

tylerturdenpants avatar tylerturdenpants commented on June 16, 2024

Point away. I'm interested.

from ember-angle-brackets-codemod.

rwjblue avatar rwjblue commented on June 16, 2024

Sorry :( I did a first pass here: glimmerjs/glimmer-vm#938

from ember-angle-brackets-codemod.

rwjblue avatar rwjblue commented on June 16, 2024

This PR fixes the entity issue (nicely), and makes it simpler to deal with whitespace after handlebars block opening/closing.

from ember-angle-brackets-codemod.

tylerturdenpants avatar tylerturdenpants commented on June 16, 2024

@rwjblue will a release be cut soon?

from ember-angle-brackets-codemod.

GavinJoyce avatar GavinJoyce commented on June 16, 2024

Nice one!

from ember-angle-brackets-codemod.

rwjblue avatar rwjblue commented on June 16, 2024

We should setup a time to brainstorm on the general problem though. The fix I submitted will only help some of the issues, and we will continue to have to fix things in convoluted ways due to the Handlebars parser being so lossy. Things like {{~ preservation are a good example of the fundamental failure scenarios.

I think we will ultimately need to do a custom parser (we already differ from Handlebars in enough ways that I don't think this is terrible) that has better semantics around preserving enough info in the AST to be able to print properly. This would help basically everyone in the space (prettier / glimmer / ember / template-lint / codemods / etc could all use it)...

from ember-angle-brackets-codemod.

tylerturdenpants avatar tylerturdenpants commented on June 16, 2024

@GavinJoyce whoever has the free time to take this up should take it up. I can create releases, so let me know when I can help.

from ember-angle-brackets-codemod.

GavinJoyce avatar GavinJoyce commented on June 16, 2024

We should setup a time to brainstorm on the general problem though

👍 That would be great. I'll ping you on discord to set something up

from ember-angle-brackets-codemod.

Alonski avatar Alonski commented on June 16, 2024

Just pinging here to ask how this is moving along :)

from ember-angle-brackets-codemod.

rwjblue avatar rwjblue commented on June 16, 2024

I published the update to @glimmer/syntax to allow opting in to "codemod" mode as of 0.41.0, if we update to that (and tweak the options we pass) we should be able to completely avoid issues with these HTML entity characters.

from ember-angle-brackets-codemod.

patocallaghan avatar patocallaghan commented on June 16, 2024

I've a PR to update @glimmer/syntax here https://github.com/rajasegar/ember-angle-brackets-codemod/pull/50

from ember-angle-brackets-codemod.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.