-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Reduce dependencies size #5
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
![Screenshot 2023-05-18 at 11 06 56 AM](https://private-user-images.githubusercontent.com/4138279/239516131-c1dd4d13-1ba4-4f0f-a95a-d16b2b9f1500.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyMzc2MjksIm5iZiI6MTcyNDIzNzMyOSwicGF0aCI6Ii80MTM4Mjc5LzIzOTUxNjEzMS1jMWRkNGQxMy0xYmE0LTRmMGYtYTk1YS1kMTZiMmI5ZjE1MDAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjFUMTA0ODQ5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Nzg2YzA0YTMxYTM0MDU0NmY1YWIxZjgzZDU3OTZhNTVhYTg1NGQ0NGE3Yzk0M2EwMTA1MWE1MzIzNDg4MDFhNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.xK6lOSsX11aThXn3hWMXOkgrMoaAByxqifTYA_OXUt0)
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: