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

Use more efficient string replacement and prevent validation errors from Interactivity API experiment #7694

Merged
merged 5 commits into from
Dec 18, 2023

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Dec 18, 2023

Since the string AMP_MOBILE_REDIRECTION only occurs once in the JS file, there's no need for the more expensive regex match. A simple string replacement will suffice.

This also fixes unit tests and prevents validation errors from being reported from scripts added by the Interactivity API experiment in Gutenberg.

This also fixes static analysis errors reported by PHPStan.

@westonruter westonruter added this to the v2.5.1 milestone Dec 18, 2023
@westonruter westonruter modified the milestones: v2.5.1, v2.5.2 Dec 18, 2023
Copy link
Contributor

github-actions bot commented Dec 18, 2023

Plugin builds for 4248179 are ready 🛎️!

Checksums
# Development build checksums
bd406cdc0b8e9f06a202183a4f35eb8d0c292815ec7c1eaa709e94ee835c5ea1 *amp.zip

# Production build checksums
0e80f8e12602f9d00c1daafe7ee10d2e1b8f0bbea4b43bbb0676477322ae88c6 *amp.zip

Warning

These builds are for testing purposes only and should not be used in production.

@thelovekesh thelovekesh force-pushed the fix/efficient-string-replacement branch from f3e90f2 to 1a2182f Compare December 18, 2023 18:40
@westonruter westonruter changed the title Use more efficient string replacement Use more efficient string replacement and prevent validation errors from Interactivity API experiment Dec 18, 2023
@westonruter westonruter merged commit 8f79eec into develop Dec 18, 2023
34 checks passed
@westonruter westonruter deleted the fix/efficient-string-replacement branch December 18, 2023 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants