-
Notifications
You must be signed in to change notification settings - Fork 213
Allow actual RegExp objects in the regex field of a textInput #1247
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
Conversation
src/runtime/manifest.ts
Outdated
@@ -102,6 +102,14 @@ export interface ManifestStack { | |||
* @internal | |||
*/ | |||
export function stackToWire(stack: ManifestStack): Record<string, unknown> { | |||
if (stack.params) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In retrospect, I think there's a good argument to be made that this ugly special case should probably live in the generic toSpec() implementation in params/types.ts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice "hack" with super great usability upgrade. Do you want to do that here or on a separate PR.
src/runtime/manifest.ts
Outdated
@@ -102,6 +102,14 @@ export interface ManifestStack { | |||
* @internal | |||
*/ | |||
export function stackToWire(stack: ManifestStack): Record<string, unknown> { | |||
if (stack.params) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice "hack" with super great usability upgrade. Do you want to do that here or on a separate PR.
|
I'm not....proud of this hack, but I was writing up some docs for params and frankly I couldn't get the slash escapes right in my head when typing them out, which means it's really not reasonable to expect users to get them right either. Much better to just let them use the same JS regexps that they're used to using, and can copy-paste test.
Is this going to require APi review? The actual wire format hasn't changed.