Currently this module use only a hard coded 1.29.0 version of YoastSEO JS. Please update to recent version of YoastSEO JS to provide new features and if possible remove hard dependency of yoastseo in packager.json.

Latest version of YoastSEO JS is currently v1.37.0

Comments

IT-Cru created an issue. See original summary.

chr.fritsch’s picture

An update of the library would be really nice. 👍

kingdutch’s picture

Supporting more than one version at a time in this module is quite difficult as the YoastSEO.js library itself no longer contains compiled files and instead pushes this responsibility to the implementing library (such as the Real-Time SEO module).

Because the YoastSEO.js module is licensed under GPL-3.0 it can not be hosted on Drupal.org, so instead we host a compiled mirror on https://github.com/GoalGorilla/RTSEO.js that we can pull in through composer.

In order to update the version of YoastSEO.js that this module uses we will have to compile the new version for the https://github.com/GoalGorilla/RTSEO.js repository.

I've spent a bit of time today trying to compile a newer version but we run into a few issues:

  1. Version 1.36.0 starts changing the current require usage to ES6 import statements which requires a more complex build setup (the current babelify + browserify command no longer works).
  2. Version 1.38.0 introduces a webworker for the processing of some activities which further complicates the interactions.

Newer versions of the YoastSEO.js library deprecate the App class that we duplicate to make it compatible with Drupal. To counteract that they also expose more core classes of the YoastSEO library. More work will be needed to figure out how the introduction of the webworker affects everything as well as what is needed to use the newly exposed classes to do the processing of texts.

Unfortunately this is not a straightforward update that can be performed quickly and the hardcoded version can not be removed because each minor update of the YoastSEO.js library could seriously break things.

kingdutch’s picture

Status: Active » Needs review

The issue actually turned out to be with the contents of the npm repository which contained compiled code that Babel could not handle. Using the repository through yarn directly gave us proper ES6 code that Webpack and Babel were able to properly compile.

I think we can still improve on the current code with less duplication of the YoastSEO app by writing our own analysis pipeline and presenter. We can also improve filesizes by splitting out the YoastSEO library and removing our dependency on lodash.

The branch with the improvements can be tested from here: https://github.com/goalgorilla/RTSEO.js/tree/feature/improved-build-pipe... I've simply recompiled the App with the latest YoastSEO version and not done any testing yet. You can test this out by replacing the downloaded rtseo.js file through composer with the one in the dist folder on that branch.

More information about what was holding up this build with Webpack and Babel can be found here: https://github.com/Yoast/YoastSEO.js/issues/1687#issuecomment-431945915

Myddna’s picture

How is the update going? Any chance the update will be ported to 7.x?

Thanks :)

shaneonabike’s picture

It seems that the short term fix you proposed was ported into a merge. I tried to check out your latest YoastSEO.js but seems as though you nuked the tree.

Just wondering if you needed help testing anything (in D7)?

kingdutch’s picture

Hi :)

Unfortunately I don't see any of this being ported to Drupal 7. The rewrite to fix issues present in the 1.x version for Drupal 8 has already taken a year longer than I hoped (I wanted to publish 2.0 in June last year). This has been partially due to scope creep with some things that need to be done before a stable release because they would be backwards compatible breaks. This has also partially been due to a lack of time from my side.

I've merged the build pipeline improvements for the RTSEO.js library I referred to earlier into the main working branch: https://github.com/goalgorilla/RTSEO.js/tree/feature/react-presenter

Unfortunately, while I've been rebuilding, the Yoast team has also drastically changed the way their library works (and deprecated https://github.com/Yoast/YoastSEO.js/ moving to a monorepo setup) which will add on-top of the work of updating to their latest version.

shaneonabike’s picture

Egads that sucks! How could I go about helping you out with that? I don't mind building the backport for D7 when it's ready. I will also need to use the D8 version as well so I can help in testing.

As for the build process do you need help in figuring all that out?

fdefeyter@gmail.com’s picture

UP :) And thanks for this module ;)

kingdutch’s picture

Status: Needs review » Needs work

The library has changed significantly so unfortunately this needs more work. Current work is ongoing on the following branch: https://github.com/goalgorilla/RTSEO.js/tree/feature/react-presenter

kingdutch’s picture

Issue tags: +Release blocker
kingdutch’s picture

thejimbirch’s picture

A standalone version of the YoastSEO.js library has been released.

https://www.npmjs.com/package/yoastseo
https://github.com/Yoast/wordpress-seo/issues/17899

anybody’s picture

As written in #3008802: The page freezes while the Real-Time SEO module runs script this should also include removing jQuery dependencies (using vanilla JS instead) and ensuring there's nothing blocking in JS like it was in the past.

alfattal’s picture

@kingdutch I noticed that you're also the maintainer of the RTSEO.js library, which is a dependency for this module, where the "yoastseo" is listed as a dependency in the package.json file and still hard coded to version "1.29.0". This version is so old and has been flagged by Snyk code scanner for 101 issues 6 of them are critical. The recommendation is to upgrade to yoastseo@1.40.0. You can fix it there.