⚗️ Modular SDK - Split by feature using plugins
Motivation
- Extend the plugin system to be used for internal SDK feature
- Add lazy loading plugin capability
Changes
Extends the plugin https://github.com/DataDog/browser-sdk/blob/1e8ce41f26ff39f14b362fa2d1ff8aecb7ea0ceb/packages/rum-core/src/domain/plugins.ts#L9-L19
Ex: action plugin
Wait for the plugins to be loaded before starting (Ìn preStartRum): https://github.com/DataDog/browser-sdk/blob/1e8ce41f26ff39f14b362fa2d1ff8aecb7ea0ceb/packages/rum-core/src/boot/preStartRum.ts#L127-L130
Call plugins hooks during the SDK lifecycle
-
At init to access the conf: https://github.com/DataDog/browser-sdk/blob/1e8ce41f26ff39f14b362fa2d1ff8aecb7ea0ceb/packages/rum-core/src/boot/preStartRum.ts#L133-L134
-
In the assembly to enrich the event: https://github.com/DataDog/browser-sdk/blob/1e8ce41f26ff39f14b362fa2d1ff8aecb7ea0ceb/packages/rum-core/src/domain/assembly.ts#L180-L181
-
etc...
Testing
- [ ] Local
- [ ] Staging
- [ ] Unit
- [ ] End to end
I have gone over the contributing documentation.