Limitations and Known Issues
The Developer Preview release of Square Dashboard Add-ons has the following limitations and known issues.
Limitations on building Add-ons
Rendering of an Add-on takes place within the Dashboard’s browser JavaScript context while execution of Add-on code takes place within its own browser JavaScript context.
Learn more in How Add-ons Render.
With that, there are differences in what you may experience in building an Add-on compared to a self hosted application.
- Add-ons do not have direct access to the Dashboard DOM.
- All data provided and taken through the SDK is serialized across the isolation boundary.
- Only SDK components may be used, native markup will not render at all.
- SDK components only support serializable props.
- Global CSS will have no effect on the rendered UI. All styling must be driven through props accepted by SDK components.
- The Dashboard has a specific React version it runs to render Add-on UI which currently uses React version 18. Changing the peer React version within the package.json generated for an Add-on should not be done until Square upgrades the Dashboard. Doing so will break the Add-on.
- Origin partitoned browser APIs are not supported. Browser sandboxing sets a null orgin on the JavaScript context. With that no origin partition APIs are supported.
- Location APIs will have no effect on the Dashboard location and usage of the APIs may result in error.
- You should avoid usage of React controlled components, like text inputs or color pickers. “Controlled” inputs are ones where the value of an input is typically updated as the result of a callback (e.g., value and onChange). Nothing prevents you from using this pattern; however, due to the separation of execution and rendering in the architecture, a few additional milliseconds of delay are introduced by serializing events and UI updates, which can cause visual jank, especially on lower-power devices.
Add-ons are not currently supported in Square Sandbox.