Skip to content
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

feat: loadScriptsOnMainThread string[] -> (string | RegExp)[] #520

Merged
merged 5 commits into from
Dec 26, 2023

Conversation

dymoo
Copy link
Contributor

@dymoo dymoo commented Dec 26, 2023

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests

Description

Allow string OR RegExp to be passed into loadScriptsOnMainThread to avoid doing string-to-string comparison that doesn't work if the script has URL params.

Use cases and why

Google tag manager tag helper passes different URL params to the googletagmanager.com/debug/bootstrap script meaning string equality check won't work.

The following would now work
loadScriptsOnMainThread={[ /googletagmanager.com\/debug\/bootstrap/ ]}
Would work.

mentioned by #477

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

Copy link

vercel bot commented Dec 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
partytown ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 26, 2023 8:05pm

@dymoo dymoo changed the title loadScriptsOnMainThread string[] -> (string | RegExp)[] feat: loadScriptsOnMainThread string[] -> (string | RegExp)[] Dec 26, 2023
@gioboa
Copy link
Collaborator

gioboa commented Dec 26, 2023

Thanks @dymoo 👏 Can you add a specific test for this pls?

Co-authored-by: Giorgio Boa <35845425+gioboa@users.noreply.github.com>
@gioboa gioboa merged commit 1ce9abc into BuilderIO:main Dec 26, 2023
7 checks passed
@gioboa gioboa linked an issue Jan 7, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make loadScriptsOnMainThread accept regexp or substrings
2 participants