speced / respec

A tool for creating technical documents and web standards
https://respec.org/
Other
717 stars 387 forks source link

Integrate highlighter/idl parser into worker #1513

Open saschanaz opened 6 years ago

saschanaz commented 6 years ago

We are currently loading highlighter by importScript, but this causes additional network request and is not good for version managing. How about building it as a single file as the core library does?

cc: @marcoscaceres

marcoscaceres commented 6 years ago

In moving highlighter to a worker (and hopefully WebIDL processing), I had the following goals:

  1. reduce the payload size of the ReSpec bundle: ReSpec takes a huge performance hit right now because of bundle size.
  2. allow the highlight script to be cached independently of ReSpec, because it rarely changes.
  3. Doing the highlighting off main thread, because it's a nice to have - but not critical.
  4. Only load highlighter when needed (I didn't get this far).

I'm open to suggestions for different ways of reaching the goals above - or changing the goals if you think we can do better.

I'll note that version management hasn't been huge issue - but I agree that it's easy for us to get broken, because are not testing the dependencies properly, and that's absolutely a bad thing.