prettier / angular-html-parser

An HTML parser extracted from Angular with some modifications
https://github.com/prettier/angular-html-parser/blob/dev/packages/angular-html-parser
MIT License
43 stars 13 forks source link

Support `@let` declaration syntax #40

Closed sosukesuzuki closed 2 months ago

sosukesuzuki commented 2 months ago

Copy of these upstream commits:

fisker commented 2 months ago

Better merge upstream first?

sosukesuzuki commented 2 months ago

@fisker You are right, but angular upstream repository changed the code formatter. So it is hard to merge upstream. So I copied the related commits manually...

sosukesuzuki commented 2 months ago

Also Angular team is interested in to enable that Prettier use angular's upstream parser directly. It seems that work on this has already begun. If that happens, we can say goodbye to this kind of work.

fisker commented 2 months ago

So it is hard to merge upstream.

Let me give it a try first.

Also Angular team is interested in to enable that Prettier use angular's upstream parser directly.

Do you have a link to read?

sosukesuzuki commented 2 months ago

Do you have a link to read?

@fisker I'll send you details in Discord in a minutes.

fisker commented 2 months ago

@sosukesuzuki

I've created dev-202407-merge-upstream branch, the diff looks the same.

Diff dev-202407-merge-upstream -> main https://github.com/angular/angular/compare/main...prettier:angular-html-parser:dev-202407-merge-upstream

Diff dev -> main https://github.com/angular/angular/compare/main...prettier:angular-html-parser:dev

fisker commented 2 months ago

I was not able to run test, but now I can. the tests are failing, I'll try to fix.

fisker commented 2 months ago

It seems the dev branch already fails?

sosukesuzuki commented 2 months ago

Unfortunately for us, the tests in this repository are not working, so we should look at the tests on the Prettier side.

fisker commented 2 months ago

I'll merge into dev and release a version first.

sosukesuzuki commented 2 months ago

:+1:

fisker commented 2 months ago

I've released new version, waiting for renovate to pick up.

Can you fix the confilicts?

sosukesuzuki commented 2 months ago

You merge upstream so let syntax support is already included in our dev now. So we can close this PR.

sosukesuzuki commented 2 months ago

Ooops, we should implement the change for angular-html-parser package, so I'll create new PR.

fisker commented 2 months ago

The type check is failing, https://github.com/prettier/prettier/actions/runs/9893223253/job/27327809365?pr=16466

As I checked locally, once we add type,startSourceSpan, and endSourceSpan to LetDeclaration it will be fixed, so please make sure we have them when you add changes.

sosukesuzuki commented 2 months ago

Hmm I'll look into it, thanks

sosukesuzuki commented 2 months ago

https://github.com/prettier/angular-html-parser/pull/41