angular-html-parser icon indicating copy to clipboard operation
angular-html-parser copied to clipboard

Use webparser

Open StarpTech opened this issue 6 years ago • 5 comments

Hi, I think this package follows the same strategy as https://github.com/Prettyhtml/prettyhtml/tree/master/packages/webparser. Webparser is also a fork of the angular parser. Should we merge them?

StarpTech avatar Nov 07 '18 20:11 StarpTech

Hi, the reason why I created this repo instead of using webparser is that:

  • If there's a bug, I don't have the ability to fix it given that I don't know where have you modified.
  • If there's a bugfix/update from the upstream, I don't think it'll be easy to pull it to webparser.
  • I'd like to keep the modifications as less as possible so that it should be easy to maintain.

Diff: https://github.com/angular/angular/compare/master...ikatyang:master

ikatyang avatar Nov 08 '18 09:11 ikatyang

If there's a bug, I don't have the ability to fix it given that I don't know where have you modified.

I don't understand this statement. Both projects are opensource and rely on the same parser.

If there's a bugfix/update from the upstream, I don't think it'll be easy to pull it to webparser.

I don't expect huge changes because the parser is stable.

I'd like to keep the modifications as less as possible so that it should be easy to maintain.

This fit with my goals. The parser is backwards compatible and provide useful features for formatter via options. If you compare both solutions you will see that webparser has half of the code size of this one.

StarpTech avatar Nov 08 '18 10:11 StarpTech

If there's a bug, I don't have the ability to fix it given that I don't know where have you modified.

I don't understand this statement. Both projects are opensource and rely on the same parser.

I meant it's hard to track the changes from upstream. I'd expect that the Angular source is always correct and the error is only possible to be introduced by us so that we only need to check the modified part.

If there's a bugfix/update from the upstream, I don't think it'll be easy to pull it to webparser.

I don't expect huge changes because the parser is stable.

I don't expect that too. But I also don't expect someone will be willing to pull it from upstream manually, at least I don't want to manually do something that can be automatic.

I'd like to keep the modifications as less as possible so that it should be easy to maintain.

This fit with my goals. The parser is backwards compatible and provide useful features for formatter via options. If you compare both solutions you will see that webparser has half of the code size of this one.

The code size does not really matter to me since they're coming from the same source, tree-shaking will make it pretty much the same size.

ikatyang avatar Nov 08 '18 12:11 ikatyang

ok, you don't want. In my opinion, it's overkill to maintain that big repository but prettier also use more than one parser for HTML right? So, in that case, it could be reasonable to be always aligned.

StarpTech avatar Nov 09 '18 09:11 StarpTech

It seems this repository is lack of maintenance for a long time, and same as prettyhtml. 😅

JounQin avatar Aug 24 '22 11:08 JounQin