ClientSideWebPartManager is removed from the latest spfx releases
Category
- [x] Question
- [ ] Typo
- [ ] Bug
- [ ] Additional article idea
Expected or Desired Behavior
In previous versions of the spfx library (until 1.4.1) we were able to use the ClientSideWebPartManager in our own spfx webparts. This made it possible to dynamically load an webpart from another webpart or extension. (credits go to Mikael Svenson) With this feature we were able to create some kind of a "Widget zone" in which webparts (mostly custom) can be added by end users with some nice plugins for dragging, sorting, lazy loading etc. I can also imagine some scenario's where an developer wants to load a webpart in an extension.
Unfortunatly in from version 1.4.1 it seems like the ClientSideWebPartManager is removed from the exported index.d.ts in sp-webpart-base. It's still in the lib folder, but not added to the index.d.ts with the message "/* Excluded from this release type: ClientSideWebPartManager */". I'm also unable to retrieve the webpart host from WebPartContext.host (which is made private to _host) to construct the ClientSideWebPartManager. Would it be possible to bring this feature back?
It was always marked as an internal class. In 1.5.0 and beyond, we stripped out the internal APIs, and moved the beta APIs behind the --plusbeta flag so that it was clearer on what was public and what was not.
Your best bet would be to add an entry in User Voice with your request / reasoning / etc.
Thanks for the fast reply. My apologies, I indeed missed the internall flag. I will make an user voice entry next week after discussing this with some colleagues. I don't think this functionality will be added very soon though, because I do not think a lot of users will need it. Would it be safe to stay on the 1.4.1 version untill then or do you suggest something else?
Took some time, but I just created the uservoice. https://sharepoint.uservoice.com/forums/329220-sharepoint-dev-platform/suggestions/36386938-create-spfx-webparts-inside-or-from-another-spfx-w
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues