Skip to content

Free: Replace interpolate-components dependency#22486

Merged
vraja-pro merged 3 commits intotrunkfrom
725-free-refactor-interpolate-components-dependency
Aug 28, 2025
Merged

Free: Replace interpolate-components dependency#22486
vraja-pro merged 3 commits intotrunkfrom
725-free-refactor-interpolate-components-dependency

Conversation

@igorschoester
Copy link
Copy Markdown
Contributor

@igorschoester igorschoester commented Aug 7, 2025

Context

  • Replace unmaintained package

Summary

This PR can be summarized in the following changelog entry:

  • Replaces the unmaintained interpolate-components package with the createInterpolateElement from @wordpress/element.
  • [@yoast/components 0.1.0 other] Replaces the unmaintained interpolate-components package with the createInterpolateElement from @wordpress/element.
  • [@yoast/search-metadata-previews 0.1.0 other] Replaces the unmaintained interpolate-components package with the createInterpolateElement from @wordpress/element.

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

@yoast/components

We don't seem to use the LanguageNotice or the WordOccurrenceInsights anywhere in our plugins.
So the following is devs only:
I tested by adding the components to some random JS page and checking for errors.
Either use this components.patch and check the schema tab in the metabox, or follow the details yourself:

Details

Copied and adjusted from our components app:

import { languageProcessing } from "yoastseo";

const ProminentWord = languageProcessing.values.ProminentWord;

const words = [
	new ProminentWord( "davids", "david", 2 ),
	new ProminentWord( "goliaths", "goliath", 6 ),
	new ProminentWord( "word", "word", 3 ),
	new ProminentWord( "yoast", "yoast", 8 ),
	new ProminentWord( "test", "test", 10 ),
	new ProminentWord( "apps", "app", 6 ),
	new ProminentWord( "teletubbies", "teletubby", 11 ),
	new ProminentWord( "strange", "stange", 4 ),
	new ProminentWord( "improvisation", "improvisation", 4 ),
	new ProminentWord( "ranking", "rank", 5 ),
	new ProminentWord( "google", "google", 5 ),
	new ProminentWord( "terms", "term", 8 ),
	new ProminentWord( "wordpress", "wordpress", 9 ),
	new ProminentWord( "inspiration", "inspiration", 2 ),
	new ProminentWord( "internal", "internal", 2 ),
	new ProminentWord( "linking", "link", 2 ),
	new ProminentWord( "suggestions", "suggestion", 3 ),
	new ProminentWord( "keyword", "keyword", 3 ),
	new ProminentWord( "analysis", "analysis", 4 ),
	new ProminentWord( "linguïns", "linguïn", 5 ),
];

Then you can use those words as prop and render like so:

<WordOccurrenceInsights words={ words } researchArticleLink="https://yoast.com/" />

The LanguageNotice is covered in the tests by rendering:

<LanguageNotice
	changeLanguageLink="http://www.example.com"
	canChangeLanguage={ true }
	language="English"
	showLanguageNotice={ true }
/>

@yoast/search-metadata-previews

  • Edit a post
  • Go to the Search appearance
  • Switch to desktop result/mode
  • Ensure you have a focus keyphrase and a description that includes your focus keyphrase
  • Verify your focus keyphrase is highlighted (with <strong>) in the preview, like so:
image

Schema tab

  • Edit a post
  • Go to the Schema tab (or collapsible in the sidebar)
  • Verify the link in the bottom text is clickable:
image

Wincher

Widget
  • Go to the WordPress dashboard
  • Ensure you have the Wincher widget
  • Verify the link in the text above the table is clickable:
image * Either log in or log out of Wincher to get the other text there * You can log out by disabling the integration in Yoast > Integrations * Verify that link image
WincherExplanation
  • Edit a post
  • Open the "Track SEO performance" modal
  • Verify the links in the text are clickable:
image
WincherLimitReached
  • When in the same modal as above
  • Run the following code in your browser console:
wp.data.dispatch("yoast-seo/editor").setWincherSetKeyphraseLimitReached(2)
  • Verify the link in the text is clickable:
image
WincherReconnectAlert

Used in both the dashboard widget and the editor modal

  • I tested on the dashboard, using the React developer tools chrome extension to change the values in the WincherPerformanceReport component (you can filter on it).
    E.g. changing the status within the data to 401:
image
  • Verify the link in the text is clickable:
image
WincherUpgradeCallout

Used in both the dashboard widget and the editor modal
I had this right away when connected.

  • Verify the link in the text is clickable:
image * Note, editing a post, you get a different version (see screenshot), but the link part is the same code image

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

QA can test this PR by following these steps:

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes https://github.com/Yoast/reserved-tasks/issues/725

@igorschoester igorschoester added the changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog label Aug 7, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 7, 2025

@igorschoester Please be aware that following packages have been abandoned and are not actively maintained anymore:

Package name Path
@yoast/babel-preset packages/babel-preset
@yoast/components packages/components
@yoast/e2e-tests packages/e2e-tests
@yoast/helpers packages/helpers
@yoast/jest-preset packages/jest-preset
@yoast/style-guide packages/style-guide
eslint-config-yoast packages/esling-config-yoast

Please consider using the other packages instead.

@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 037ebd0e56938735fa8988551e57eee20070e06e

Details

  • 5 of 17 (29.41%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.001%) to 52.918%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/components/src/WordOccurrenceInsights.js 0 1 0.0%
packages/js/src/components/SchemaTab.js 0 1 0.0%
packages/components/src/safeCreateInterpolateElement.js 3 5 60.0%
packages/js/src/components/modals/WincherReconnectAlert.js 0 2 0.0%
packages/search-metadata-previews/src/snippet-preview/SnippetPreview.js 0 2 0.0%
packages/search-metadata-previews/src/helpers/safeCreateInterpolateElement.js 1 5 20.0%
Totals Coverage Status
Change from base Build a205096259a815352792c0e1e9a23c86b6aa218d: -0.001%
Covered Lines: 31237
Relevant Lines: 59718

💛 - Coveralls

@github-actions
Copy link
Copy Markdown

A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch.

@igorschoester igorschoester force-pushed the 725-free-refactor-interpolate-components-dependency branch from 552e32b to aa618f5 Compare August 14, 2025 08:42
@github-actions
Copy link
Copy Markdown

@igorschoester Please be aware that following packages have been abandoned and are not actively maintained anymore:

Package name Path
@yoast/babel-preset packages/babel-preset
@yoast/components packages/components
@yoast/e2e-tests packages/e2e-tests
@yoast/helpers packages/helpers
@yoast/jest-preset packages/jest-preset
@yoast/style-guide packages/style-guide
eslint-config-yoast packages/esling-config-yoast

Please consider using the other packages instead.

@igorschoester
Copy link
Copy Markdown
Contributor Author

Note

Force pushed with a rebase on trunk to resolve the merge conflicts

Copy link
Copy Markdown
Contributor

@vraja-pro vraja-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR & AC ✅

@vraja-pro vraja-pro added this to the 26.0 milestone Aug 28, 2025
@vraja-pro vraja-pro merged commit b501d7c into trunk Aug 28, 2025
22 of 34 checks passed
@vraja-pro vraja-pro deleted the 725-free-refactor-interpolate-components-dependency branch August 28, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: non-user-facing Needs to be included in the 'Non-userfacing' category in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants