Comments (15)
Needs review (I pinged folks), but shouldn't take too long to land + release once its been reviewed.
from ember-angle-brackets-codemod.
@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.
From #dev-ember-js on discord:
from ember-angle-brackets-codemod.
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.
Point away. I'm interested.
from ember-angle-brackets-codemod.
Sorry :( I did a first pass here: glimmerjs/glimmer-vm#938
from ember-angle-brackets-codemod.
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.
@rwjblue will a release be cut soon?
from ember-angle-brackets-codemod.
Nice one!
from ember-angle-brackets-codemod.
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.
@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.
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.
Just pinging here to ask how this is moving along :)
from ember-angle-brackets-codemod.
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.
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)
- Incorrect transformation of use of contextual component variable into a component invocation HOT 3
- Why is component that has positional parameters got skipped? HOT 1
- skipAttributesThatMatchRegex config needs to use strings in JSON HOT 1
- Update debugging workflow in README
- Nodes whose data attributes are valueless are excluded from codemod HOT 4
- running codemod on rendering tests breaks on < character HOT 6
- Possible to run offline (not using puppeteer / dev server)? HOT 6
- Async error HOT 7
- Error transforming component with a helper that does not use positional params as an attribute
- Is this supposed to work in addons? HOT 1
- Making Telemetry optional instead of default HOT 4
- Error: Protocol error (Page.navigate): Cannot navigate to invalid URL HOT 4
- Can I convert a single component at a time? HOT 6
- Trouble installing on Mac M1 (arm64 arch) machine
- link-to conversion drops params HOT 4
- Incorrect handling of block param properties in iterable helpers HOT 2
- Puppeteer errors with hard to decipher reason HOT 1
- Errors with 5.1.0: Cannot read property 'originalPositionFor' of undefined
- Add disambiguation of helpers (wrapping in round brackets) HOT 7
- Move helper disambiguation to a flag that is off by default
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-angle-brackets-codemod.