[go: up one dir, main page]

Page MenuHomePhabricator

Create embeddable version of replag tool for other tools
Open, Needs TriagePublic

Description

It would be nice if there was some way to easily embed a snippet from https://replag.toolforge.org/ in other tools without having to reimplement it all so it's trivial to warn users when results are out of date.

Like <iframe src="https://replag.toolforge.org/embed"> that outputs something like "The database replicas are XX seconds/minutes behind, information shown here may be out of date." in some nice red box if there's lag, and nothing when everything is good. Or maybe require a specific DB, e.g. https://replag.toolforge.org/embed?db=enwiki.

I feel like more tools had these banners back on the Toolserver when replag was a lot more common, but only older tools have them these days (yay?).

Event Timeline

I finally got around to doing this after the high s1 replag earlier this week. Unfortunately the problem with iframes is that they don't dynamically size based on the contents (as far as I know - would love to be wrong!). So when there's no lag (the majority of the time), you have to have empty space where the banner would go.

So I implemented a nicer JavaScript version that replaces an empty div with a banner. You can see how to use it at https://replag-embed.toolforge.org/demo. I'm sure the JS could be better written, but it should work. I'm going to roll this out to a few of my tools that rely on DB replicas for testing.

@bd808 once it's stable enough, is this something you'd be interesting in integrating into the replag tool itself? Or keep it as a fork? I also made some quality of life improvements like making the homepage listing on https://replag-embed.toolforge.org/ auto-update.

@bd808 once it's stable enough, is this something you'd be interesting in integrating into the replag tool itself? Or keep it as a fork? I also made some quality of life improvements like making the homepage listing on https://replag-embed.toolforge.org/ auto-update.

Patches are welcome. I'm not sure I would be excited to get a RiR patch. I like my squishy, duck typed scripting languages. :)