pixiebrix-extension icon indicating copy to clipboard operation
pixiebrix-extension copied to clipboard

Background worker: Use headers.json instead of parsing the registry at runtime

Open fregante opened this issue 2 years ago • 9 comments

Would it be possible for the background page to import the pre-generated headers.json file instead of importing all the bricks and their dependencies at runtime?

This ~~complicates the build a bit (because it would require a pre-built file) but it~~ could greatly speed up the background and avoid all sorts of issues caused the transitive dependencies, like https://github.com/pixiebrix/pixiebrix-extension/pull/6774

How

  • generate headers.json and add it to git
  • add a very simple CI check to ensure that the generated file matches the contents of the repo
  • add import registry from '@/headers.json' where needed

Related

  • https://github.com/pixiebrix/pixiebrix-extension/issues/4896
    • loading headers.json should be easier than reworking the entire registry
  • https://github.com/pixiebrix/pixiebrix-extension/issues/2156
    • see the list of files here

fregante avatar Dec 22 '23 15:12 fregante