Skip to content
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

Provide standalone parser package #288

Closed
zakius opened this issue Feb 24, 2019 · 2 comments
Closed

Provide standalone parser package #288

zakius opened this issue Feb 24, 2019 · 2 comments

Comments

@zakius
Copy link

zakius commented Feb 24, 2019

I believe downloading document is out of scope for a parser package and in most cases there are already some downloading solutions existing in project that may vary widely, pulling addition dependencies that won't be used directly by the project seems redundant.

In my opinion providing standalone parser would greatly reduce complexity of the package, reduce reliance on external packages and allow easy inclusion in lightweight projects.

@adampash
Copy link
Contributor

adampash commented Feb 26, 2019

This is an interesting thought. In the short term, however, you can pass html directly into Mercury to avoid downloading the html when you already have it on hand:

Mercury.parse(url, { html })

Does that at least partially satisfy your need?

@adampash adampash reopened this Feb 26, 2019
@zakius
Copy link
Author

zakius commented Feb 26, 2019

while it helps slightly it doesn't solve the core issue: huge dependency chain (I meant to add another issue about that but forgot, there is no need for jQuery anymore for example as modern environments are much more consistent) that is especially hard to maintain for frontend solutions

though later I realized that part of the parser has to load additional data to concatenate multiple pages, but I believe this can also be done reliably without such a dependency chain (I looked into it a bit and the best bet would be probably fetch as it works natively in all modern-ish browsers and has almost drop in package for Node)

But I understand that this is a huge scale project that can not be finished in a short time with limited resources but can be a long term goal to consider for future major version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants