Handle libraries that use $ in function names #194
Closed
Talinx
started this conversation in
Proposals For Qwik
Replies: 2 comments 1 reply
-
|
thanks @Talinx ! Can you please copy this content into a newly created "bug" issue on the main repo? Please ping me on discord afterwards, I'll make sure we give it proper attention |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thanks, added a corresponding bug report issue: QwikDev/qwik#7091 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What is it about?
Add options to the optimizer to handle libraries that use $ in function names without intending this as an instruction for the Qwik optimizer.
What's the motivation for this proposal?
Problems you are trying to solve:
$in function namesGoals you are trying to achieve:
$in function namesAny other context or information you want to share:
I want to use the peggy library (https://peggyjs.org/). This library uses $ in function names, e. g.
peg$SyntaxError. This causes errors in Qwik, e. g.Error: Value cannot be serialized in _.SyntaxError, because it's a function named "peg$SyntaxError". You might need to convert it to a QRL using $(fn): const peg$SyntaxError =...The Qwik documentation states that it converts
$suffixes. Here it is not a suffix, yet it causes this error. (I guess$as suffix is only the suggested style.) Maybe this is a bug in the optimizer and it should only treat$as a special symbol when it is a suffix of the function name?Proposed Solution / Feature
What do you propose?
The Qwik optimizer should be able to handle cases where
$is used in libraries that do not intend this as a special symbol for the optimizer. A solution could be one of these options:$as a special symbol in library code$symbol should not be treated as a special symbol for certain libraries or functions, e. g. specified by a Regex.Links / References
A library that uses
$in function names: https://peggyjs.org/Beta Was this translation helpful? Give feedback.
All reactions