Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Placeholder JSX control is missing #677
Expected or Desired Behavior
I want to use the Placeholder control from "microsoft/sp-webpart-base".
The Placeholder class can not be resolved anymore. Since I updated the Microsoft NPM packages to the latest version (1.1.1) the control seems to be moved to another package or has been removed.
The change log from \node_modules@microsoft\sp-webpart-base\CHANGELOG.md mentions no changes at all:
Steps to Reproduce
Create a new HelloWorld web part with the SharePoint Yeoman template and try to reference and use the Placeholder control.
A working Placeholder is used in the React-Todo-Basic exmple:
I can confirm this issue as well. I dug more into it. In the GA release notes: https://github.com/SharePoint/sp-dev-docs/wiki/Release-Notes-GA, we can see we should work with "@microsoft/sp-webpart-base": "~1.0.0". sp-webpart-base has a placeholder component exported from "./components/placeHolder/".
In the release notes for the Extension Preview: https://github.com/SharePoint/sp-dev-docs/wiki/Release-Notes---Extensions-Dev-Preview-Drop-1, we can now see that we are to use "@microsoft/sp-webpart-base": "~1.1.1". Ok, so we open up the new sp-webpart-base in v1.1.1 and we can see that PlaceHolder is now missing.
Yet if you look in sp-webpart-base then ./components/placeHolder, it seems that placeholder.d.ts is missing while all of the other pieces for PlaceHolder are there.
@patmill What are the chances we can get placeholder.d.ts added back into sp-webpart-base quickly?
If this was intentionally removed from the latest code drop, could I request that the release notes be updated to include what else was removed / changed in webpart-base and other base packages?
I'll look into this today and see what happened. In general the framework should not be removing functions, but at the same time the base framework should not be exposing any react controls directly. <update> The original placeholder code was marked as internal and not documented. We explicitly reserve the right to delete, modify, etc. those APIs. We've got additional work underway to make those attributes more obvious to people consuming them. However as you pointed out, we also released sample code that referenced the internal objects. That's bad. We're still investigating what we can do here. </update>
@patmill Thanks for the update, fair enough on the undocumented part, yeah, understandable yet unfortunate. Is there another replacement for similar functionality though? That particular placeholder made it much more simple to create our own custom configuration screen.
@VesaJuvonen should I go back and look at another option for the PnP samples as well?
This was referenced
Jul 13, 2017
Placeholder controls is now available from following open source library, which can be used for getting reusable controls for SPFx solutions - https://github.com/SharePoint/sp-dev-fx-controls-react. Closing this one for now since replacement functionality is available.