Skip to content

Don't recompile regex on every call to api.utils.sanitizeShop() - #3323

Open
panzi wants to merge 1 commit into
Shopify:mainfrom
panzi:patch-1
Open

Don't recompile regex on every call to api.utils.sanitizeShop()#3323
panzi wants to merge 1 commit into
Shopify:mainfrom
panzi:patch-1

Conversation

@panzi

@panzi panzi commented Jul 9, 2026

Copy link
Copy Markdown

sanitizeShop() recompiled multiple complex regular expressions on each call. Instead move the compilation into the factory function.

WHY are these changes introduced?

Don't recompile multiple complex regular expressions on every request.

WHAT is this pull request doing?

Move the compilation into the factory function.

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have used pnpm changeset to create a draft changelog entry (do NOT update the CHANGELOG.md files manually)
  • I have added/updated tests for this change
  • I have documented new APIs/updated the documentation for modified APIs (for public APIs)

sanitizeShop() recompiled multiple complex regular expressions on each call. Instead move the compilation into the factory function.
@github-actions github-actions Bot added cla-needed devtools-gardener Post the issue or PR to Slack for the gardener labels Jul 9, 2026
@panzi

panzi commented Jul 9, 2026

Copy link
Copy Markdown
Author

I have signed the CLA!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devtools-gardener Post the issue or PR to Slack for the gardener

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant