jasonLaster / blink-devtools-docs

A collection of docs for primary blink devtools classes
25 stars 2 forks source link

DevTools modules & internal extensions overview #1

Open paulirish opened 9 years ago

paulirish commented 9 years ago

Captured these notes recently.. Dumping them here until we find a better place.

devtools modules overview

you can build the devtools shell with just those 2

rest of modules are assorted. they all dependon on eachother. handful that are fused toeghet and served together as devtools loads. (ui & components.) dont want to load instantly everything, so some parts are lazy. not a good way to load files on demand. prefer modules as the lazy group.

core: ui, sdk, workspace, and maybe components.

internal extensions

runtime or console/module.json

very lean DI - declare capabilities and provide them.

defined mostly in Runtime.js.

Our code is a bunch of modules. It's a descriptor and a JS file. JS is deployed lazily when its required. Descriptor is captured here as declarative as extension.

language can sit a sibling to bindings layer.

language service that extension server depends on could expose an API for registering providers. if it finds an extension API that provides one, it'd use that. otherwise it'd query internal extensions for that.

query all extensions that provide language service. store them for future use in a map for mimetype. so it can instantiate later.

e.g. for the language service you want a declaration that says: "i'm the language service. i'm this mime type. i support this class."

jasonLaster commented 8 years ago

This is a good write up. Konrad and I were looking at the internal extensions the other day and counted 177. Seemed like an interesting thing to document / discuss. Also perhaps on that subject I understand that JS is lazily loaded in Dev, but on prod I'd assume it's all bundled.

@paulirish I've recently been thinking it'd be nice to revisit this project now that I have more experience and tackle some more concepts. If I filed some PRs and tagged you would you mind doing a quick read through?