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

Replace nwsapi with selery #3535

Closed
wants to merge 7 commits into from
Closed

Replace nwsapi with selery #3535

wants to merge 7 commits into from

Conversation

asamuzaK
Copy link
Contributor

Fixes #3015, #3416, #3427, #3432.
Not all but partially #3362.

Motivation:
I think nwsapi is a very ambitious library, but IMHO there are some concerns for a popular library like jsdom to depend on it.

  • Dynamically generate functions from input strings.
    • I don't see input strings being sanitized.
  • Relying exclusively on regular expressions to parse selectors.
    CSS Selectors can be nested and repeated, so it is very difficult to deal without creating an AST.
    • There are also expressions that may lead to ReDos.

selery creates AST and retrieves DOM.
My only concern is that selery hasn't been updated in a long time, but I've heard from the developer that he plan to continue developing it.
See Question: Still active? · Issue #10 · danburzo/selery

About the tests:
I'm new to contributing to jsdom and don't know where or how to write proper tests.
I created a new test file for now, please correct me.

@asamuzaK asamuzaK marked this pull request as draft April 22, 2023 03:10
@asamuzaK
Copy link
Contributor Author

Closing for now

@asamuzaK asamuzaK closed this Apr 22, 2023
@asamuzaK asamuzaK deleted the selector branch April 26, 2023 00:30
@asamuzaK asamuzaK mentioned this pull request May 12, 2023
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

Successfully merging this pull request may close these issues.

querySelector has problems with nodes starting with underscores
1 participant