Page MenuHomePhabricator

Add a link in VE: load addlink data from REST API earlier
Closed, ResolvedPublic

Description

Right now this is loaded in AddLinkArticleTarget.prototype.beforeLoadSuccess, which means we only begin loading the addlink data after the VE modules and the Parsoid HTML have already been loaded. We should instead load this in parallel.

This will require some init code in ext.growthExperiments.SuggestedEdits.Guidance.js or similar that is able to fire the request for the addlink data before the AddLink module has loaded, perhaps in the same ve.loadModules hook listener that is used to load the AddLink module. AddLinkArticleTarget then needs to get a hold of this data promise and wait for it before allowing loadSuccess to happen.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

We could maybe also use BeforePageDisplay hook to export this data from the server-side. The data is not particularly heavy and should be fast to retrieve.

We could maybe also use BeforePageDisplay hook to export this data from the server-side. The data is not particularly heavy and should be fast to retrieve.

That's what I ended up doing, thanks for the suggestion.

Change 649464 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/GrowthExperiments@master] AddLink: Export link recommendation data in BeforePageDisplay hook

https://gerrit.wikimedia.org/r/649464

Change 649464 merged by jenkins-bot:
[mediawiki/extensions/GrowthExperiments@master] AddLink: Export link recommendation data in BeforePageDisplay hook

https://gerrit.wikimedia.org/r/649464

kostajh claimed this task.
kostajh moved this task from Code Review to QA on the Growth-Team (Sprint 0 (Growth Team)) board.

Nothing really to QA here; resolving.