Iframes
In the web approach, fragments are included via <iframe>
tags. Logically, some information is needed – we need to know the URL of the fragment. To avoid using URLs that are fully owned by other teams, we should go via the global linking directory, too.
The following is an example of a fragile reference (from micro frontend 1):
<iframe src="/mf2/fragment"></iframe>
And a better way is to have this changed to the following:
<iframe src="/mf1/mf2-fragment"></iframe>
Here, the server would usually just respond with an HTTP status 304 redirecting to /mf2/fragment
using a local linking directory as introduced beforehand.
There are still some challenges with inline frames. One that has been touched on already is security, while others are accessibility and layout. Let's outline these three.
Security
Besides making the source links more flexible and robust, we also need to think about the right security...