Netcentric / vg-volvotrucks-us-rd

Franklin Site Redesign for https://www.volvotrucks.us/
Apache License 2.0
1 stars 1 forks source link

Spike: How to Embed Volvo Trucks Configurator to website #270

Open DanielaPedrochevd opened 11 months ago

DanielaPedrochevd commented 11 months ago

Description Investigate the best approach to achieve #199 and share the results with the team in this ticket.

During the refinement of #199 we discussed 2 possibilities: 1- Create a new Embed Spa block where the author adds the .js and .css files as an HTML route. 2- Create an iframe.

DanielaPedrochevd commented 11 months ago

related to #199

TomaszDziezykNetcentric commented 11 months ago

SPIKE RESULTS:

Preview of the app to embed: https://199-tuck-configurator--vg-volvotrucks-us-rd--netcentric.hlx.page/scripts/v2-embed/index.html


Solution 1: App directly embedded on the website. Preview: https://199-tuck-configurator--vg-volvotrucks-us-rd--netcentric.hlx.page/drafts/tdziezyk/v2/embed-spike/direct-embed

Pros:

Const:

How it should be displayed:

obraz

How it is displayed:

obraz

Solution 2: App inside iframe. Preview: https://199-tuck-configurator--vg-volvotrucks-us-rd--netcentric.hlx.page/drafts/tdziezyk/v2/embed-spike/embed-iframe

Pros:

Const:


Solution 3: App added as shadow DOM element Preview: NOT AVAILABLE

The app is not designed in the way to add it as the shadow DOM element. Explanation: The external app is using the document.querySelector object to render the app root which should be inside the shadow root, but shadow root children aren't available by document.querySelector.


Conclusion: Solution 1 would require some changes from the external app team. It is hard to predict what must be fixed without in-depth testing of the external app embedded in our app. Solution 2 is the best option from the solution complexity (developing and testing). Solution 3 is not possible to implement for now. The current external app structure would require changes.


External app problems found during spike:

cogniSyb commented 11 months ago

@TomaszDziezykNetcentric and I had a meeting with Rapid Images. The iframe solution is preferred, though we need to figure out how to deal with analytics. Probably we could simply add the tag manager script to their code.

The 403 error is because they’re working with whitelisting of IP addresses to protect the assets before NDA is lifted.