reactotron
reactotron copied to clipboard
Add `id` key to plugins and add to connection info
Currently in reactotron-core-client, we keep track of what plugins are loaded:
https://github.com/infinitered/reactotron/blob/master/lib/reactotron-core-client/src/reactotron-core-client.ts#L184
However, we do not have the names of the plugins that are loaded: just the features and callbacks.
When we call .connect(), we send information about the connection over to reactotron-app
https://github.com/infinitered/reactotron/blob/master/lib/reactotron-core-client/src/reactotron-core-client.ts#L291-L297
We should add id as a field to plugins with their name so that reactotron-app can be customized based on what plugins are configured in the client. This would unblock this issue https://github.com/infinitered/reactotron/issues/1345#issuecomment-1856269783
Curious, could we also rework things so we can infer this block of plugins from the ones that actually do connect? https://github.com/infinitered/reactotron/blob/master/lib/reactotron-core-client/src/reactotron-core-client.ts#L126-L134
Kind of feels funny that we have to provide all of the possible ones up front (with this source coming from reactotron-core-client and not the plugin library itself) and then also provide the plugins we decide to use on the client side via the use calls.
We do infer the plugins. By default, core client has all the core plugins then adds on new client features from use() calls: https://github.com/infinitered/reactotron/blob/master/lib/reactotron-core-client/src/reactotron-core-client.ts#L116
You can see this in Ignite because we have reactotron-react-native do the same thing. We have the base type as a nice feature and then new plugins get added.