Yoast / YoastSEO.js

Analyze content on a page and give SEO feedback as well as render a snippet preview.
GNU General Public License v3.0
403 stars 172 forks source link

Rewrite `analyze` in the AnalysisWebWorker to combine results #2196

Closed atimmer closed 5 years ago

atimmer commented 5 years ago

For a while, we'll be in the situation that we have both assessments for the tree and assessments for the non-tree. The AnalysisWebWorker needs to call both of these assessors and combine the results into one result.

It also will need to build the tree somewhere at the top of the method. This can be done by calling the previously created buildTree function: https://github.com/Yoast/YoastSEO.js/issues/2028.

So the analyze method inside the AnalysisWebWorker needs to be changed so it calls two assessors: A normal Assessor and a TreeAssessor. Given that the method is already complex, we really want to abstract certain parts of it so it doesn't become unwieldy.