-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add RankMath for Posts block #1874
Conversation
Bundle Size Diff
|
Plugin build for e14821a is ready 🛎️!
|
E2E SummaryTyping
Values above 60ms"0 - 73.24, 1 - 76.08, 2 - 89.49, 3 - 100.07, 4 - 64.58, 5 - 88.25, 6 - 89.33, 7 - 70.50, 8 - 92.93, 9 - 83.35, 10 - 93.20, 11 - 77.86, 12 - 77.19, 13 - 91.31, 14 - 94.59, 15 - 110.15, 16 - 147.41, 17 - 81.65, 18 - 70.80" |
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.
At first I tried to add inside the Edit component on the idea that each Block when is created its adding its own hook.
Any reason why we are using HTML selectors to implement it and adding all the checks if RankMath exists instead of just passing the content (like here) through the filter?
Even if RankMath isn't active, I think, the filter shouldn't do any harm.
Once the content changes, you can use:
- rankMathEditor.refresh( 'content' ) – To reload the Content tests.
The advantage of the current technique is that it can be separated into individual scripts and used with other blocks that may need math rank support. Also, using the HTML that gets the entire final structure frees us from maintaining it when doing structural changes. Also, the function that gets the content and adds it to the filter must be initialized once. As mentioned before, putting this inside the components was not working the way I liked -- too much management for such little value. |
@Soare-Robert-Daniel Okay, that is a way to go but I'm not much confident about this line
Can't we at least have a better detection that to look for the script in DOM? They might change the name, or have a different name in Pro version and so on. If any of that happens, we won't be aware that the integration doesn't work. |
@HardeepAsrani, we can remove that and just use the interval checker for the global value. |
@Soare-Robert-Daniel That's fine too. |
@Soare-Robert-Daniel tested and everything's working well 👍 |
🎉 This PR is included in version 2.4.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Closes #1871
Summary
Add RankMath integration for Posts Block
Some notes on development:
rank-math-app.js
is loaded in the page via script loading. My attempt was unsuccessful so I used a simple try system.Screenshots
2023-09-20_17-04-35.mp4
Test instructions
ℹ️ You will need RankMath plugin
Add internal links in your content
since Post block will add references to other posts.Checklist before the final review