-
-
Notifications
You must be signed in to change notification settings - Fork 2
Reduce dependencies size #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
(this thread is a continuation from syntax-tree/hast-util-to-html#38 (comment)) Hi again. That’s impossible. We need to parse HTML. So we need an HTML parser. Please ask a question. Don’t ask a solution. This solution doesn’t work. See https://github.com/remarkjs/.github/blob/main/support.md. Spend time on your question. Explain what tools you have. Why do you have remark and parse5? Explain explain explain. |
I don't have a question. I opened a feature request, in this case, change the way it is parsed. I don't have Since this is a I think it would be nice to have a custom parser inside the unified stack instead of using external parsers, and probably it would be more performant. |
It takes a full time job, I think at least 1 year but perhaps longer, to create a new WHATWG compliant parser. Feel free to pay me, say, $120k or so and I’ll make it, it’ll be fun to learn. But I doubt it will be much better than parse5. I think I could make it a bit smaller sure but that’s a high price. Next to creating a new parser, it would also have to be maintained. Most of the work in unified is towards maintaining parsers. I already maintain 700+ packages, I don’t think I can maintain another parser that requires so much time to maintain it.
Why? Why do you have |
Hey @korgan00! Parsers generally face an iron triangle of constraints: speed, correctness, and size. It sounds like you are looking for an out of the box solution that requires less download. If you do specifically need parsing in an environment where there is no built in parser, then you have some options:
TL;DR That said, I hear and appreciate that you have constraints around code size. Focus the discussion on what your actual project constraints.
With the actual constraint which is driving this request. The support guide https://github.com/syntax-tree/.github/blob/main/support.md offers further suggestions on how to frame the question so others can help you. |
Initial checklist
Problem
I am working on a project using

unified
,remark
, andrehype
and trying to improve deploying times I realized that the size of this dependency is huge because ofparse5
.A let you part of the installation sizes.
Solution
Don't use parse5; try to replace it with another solution or use the unified system to parse.
Alternatives
A custom parser.
The text was updated successfully, but these errors were encountered: