"Last year, Grammarly was loading a 1.3 MB Grammarly.js file on every page. Now on most websites only a 112 KB Grammarly-check.js script is loaded. Only if, for example, the user focuses on a text area does the extension load the full Grammarly.js file."
I have to wonder if this could be somehow avoided...
You can bundle js files in extensions…
That being said parsing 1.3 of cached JS every site hit is pretty silly. No clue why their “check” js is even 100k. That’s a lot of minified js!
it's comparable to website frontend and backend. While there's a single, big instance of the server in the back, there are many clients rendering their small part in the front.
Each time you refresh, only the client is reloaded. To reduce loading times, you should have small clients and let the server so the heavy lifting.
An extension consists of a thin content script loaded into each page that exchanges messages with a long-running background script. Normally you'd make the content script as thin as possible and make the background script do the real work.