Box UIElements SDK in a Salesforce LWC Ligthtning Web Component ?
Hi,
Could the Salesforce team at Box make a sample component available, or a reference implementation, for an LWC component to display a ContentPreview of a Bow document in a Salesforce LWC component ?
There are several issues with Javascript packaging, as well as the Salesforce Locker and Lightning Web Security models which make it not straightforward.
Other samples for FileUpload, Comments etc. would also be great.
#Salesforce #LWC #UIElements #ContentPreview #Preview
-
Hello,
Any recommendations actually go on our Pulse site!
Thanks,
Alex, Box Developer Advocate
-
Hi Rupert!
You definitely hit the nail on the head when you described Locker and Web Security making the implementation not very straight forward. Using a Salesforce Canvas App is the only production-ready solution that I have personally worked with. The downsides of Canvas is that its only available in Lightning Aura and it requires that you host your UI Elements app off-platform. Here are some examples using that approach:
- Lightning Aura Components and CanvasAppLifecycleHandler: https://github.com/kylefernandadams/box-canvas-app
- Node/React Application that implements Box UI Elements and has SignedRequest logic: https://github.com/kylefernandadams/box-ui-elements-heroku
Going down the LWC route and deploying UI Elements as static resources runs into the following known issues in which Lightning Locker will block:
- Content Preview under the covers actually uses 3rd-party libs for different types of preview. In particular, pdf.js uses things like eval that Locker will block.
- Content Upload users javascript workers to help with multiput/chunked uploads for larger files. Locker will throw an exception when this happens.
- Content Explorer and Content Picker contain one or both of the above UI Elements
The new Light DOM Beta could be a potential, but I have not had a chance to test this thoroughly:
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/create_light_dom
Thanks,
Kyle
Box Partner Architect
-
Thanks for the info, Kyle.
I saw your repos on Github : I will try them.
I think you should definitely get in touch with Salesforce to help you get something working; maybe Greg Whitworth can help (Director of Product Manager on LWC's applications and backend services) : https://twitter.com/gregwhitworth
PDFTron have managed to get their viewer to work on LWC; I think it would be a very good value for the market to get Box UI Elements working there also. I hope you can help with this..
Thanks for your help, Rupert
-
Hi Kyle Adams, I just wanted to point out I created a couple of issues on those Github repos regarding getting the Box UI Elements working in Salesforce.
I hope you can take a look at them.
Post is closed for comments.
Comments
8 comments