-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
[Feature Request]: Using RegExp for resolvedPaths
#2123
Comments
Using regular expressions with js native does sound great, but farm is napi based and the core code is all Rust. Complex object passing across programming languages can have unimaginable overhead (in fact, farm's benchmarks show that in small front-end projects, the overhead of such data transfer is huge, and is even the main time-consuming part of the compilation process), so I guess it's better that we use strings instead of js native strings. |
How about |
We will discuss about it, it may be opitimized in v2 |
I think the compatibility between js regex and regex crate is not the most critical, since regex crate allows all most common usage the regular expressions. However, it seems meaningless to covert all js Whatever, I will try to make benchmarks and maybe also a survey. If the overheads are acceptable, we may consider change the api |
What problem does this feature solve?
Currently
string[]
is allowed in the JS pluginload.filters.resolvedPaths
,transform.filters.resolvedPaths
.https://github.com/farm-fe/farm/blob/main/packages/core/src/plugin/type.ts#L179
Since regular expressions are set here,
I think it would be more convenient to be able to specify JavaScript native
RegExp
.Plugin writer can also use
\
instead of\\
for escapes by backslashes.What does the proposed API look like?
The text was updated successfully, but these errors were encountered: