Using fragments with iframes
In the web approach, fragments are included via <iframe>
tags. The only requirement for such a tag is a URL that leads to the fragment. Since the URL of a fragment has to be treated like any URL – for example, hyperlinks, we also need to follow the same principles as outlined in the previous section. Likewise, 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 2):
<iframe src="/mf1/fragment"></iframe>
A better way would be to change that to the following:
<iframe src="/mf2/mf1-fragment"></iframe>
Here, the server would usually just respond with HTTP status 304
redirecting to /mf1/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...