JavaScript: Fix category filtration bug and update Node version requirements #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi everyone, I think the JavaScript project has a bug related to filtering the categories. This PR contains a fix for it, plus a documentation update related to the project's Node version requirements.
1. Entering an invalid regular expression crashes the app
Here's a screencast showing the original behavior:
I noticed the Python and Ruby projects each treat the query as a literal string instead of as a regular expression; so, in this PR, I updated the JavaScript project to do the same. That avoids the issue of whether the query is a valid regular expression or not.
Here's the new behavior:
Footnote: In case the maintainers do want the app to interpret the query as a regular expression, I'd recommend wrapping the
new RegExp(query, 'i')expression in atry/catchso the app doesn't crash when the query is an invalid regular expression.2.
$ yarn startfails when using Node v17+The
$ yarn startcommand runs OK when using Node v16, but not when using Node v17 or Node v18. When using Node v17 or Node v18, running$ yarn startresults in the terminal displaying the following error:I Googled the error code (i.e.
ERR_OSSL_EVP_UNSUPPORTED) and found this comment on StackOverflow, which links to the Node v17 release notes, which mention that error code.Now that I've read the release notes, I think the gist of the issue is that the JavaScript project is using an OpenSSL feature that is supported (by default) by the OpenSSL version included in Node v16, but is not supported (by default) by the OpenSSL version included in Node v17.
To address this discrepancy; in this PR, I updated the
README.mdto indicate that the latest compatible version of Node is v16. An alternative solution (which I did not implement) is to update the JavaScript project (either its own code or its dependency tree) so that it no longer relies on that OpenSSL feature.Environment
1.22.19v16.19.0(runs OK),v17.9.1(shows error), andv18.14.0(shows error)