-
Notifications
You must be signed in to change notification settings - Fork 14
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
Browser support #9
Comments
PR welcome |
Are you interested in dropping pre-build tooling and switching to ESM? This would make it easier to get the wasm-reliant code to work. |
@Richienb I tried to understand the difference between re2 and re2-wasm, but the second one seems to be based on the first and does not seem to have any major differences. Both modules seem to be useful on the Node.js server side and will not work within a browser. Why prefer second over the first? |
You can not run native modules in the browser. You can run WASM though. |
When would we need url-regex-safe in the browser? Curious what the use cases are. Could just have an API endpoint that takes a string and parses it and returns it and then calls |
For libraries that validate urls before sending a request to them, making the validation an API endpoint would make this redundant. In this case, you might as well send the request in the first place and handle the error. |
I'm using it in the browser to create a version of the text that will have any URL's converted into HTML with newlines converted to line breaks. Using a module, which was url-regex, instead of my own regular expression made sense. Having an API endpoint do that for each of the items in the listing does not seem like a good idea. |
To properly support browsers, replace
re2
withre2-wasm
The text was updated successfully, but these errors were encountered: