reactotron icon indicating copy to clipboard operation
reactotron copied to clipboard

Add `id` key to plugins and add to connection info

Open joshuayoes opened this issue 1 year ago • 2 comments

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

joshuayoes avatar Dec 20 '23 21:12 joshuayoes

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.

frankcalise avatar Dec 21 '23 13:12 frankcalise

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.

Screenshot 2023-12-21 at 3 24 58 PM

joshuayoes avatar Dec 21 '23 23:12 joshuayoes