Here is how you can display SVGs, it's not ideal because the source is hard-coded but this technique should get you started.
Add this in your markup:
<aura:handler name="init" value="{!this}" action="{!c.onInit}"/>
<aura:unescapedHtml aura:id="mySvg"/>
Then, add the following JS in your controller:
onInit : function(component, event, helper) {
const svgSource = '<svg width="100" height="100">'
+'<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="#4CAF50"/>'
+'<text fill="#ffffff" font-size="12" font-family="Verdana" x="25" y="50">It works!</text>'
+'</svg>';
component.find('mySvg').set('v.value', svgSource);
}
Another way of achieving this is to write a custom renderer for your component. this way you can work with the DOM but it's far more trickier.
From what I can tell, it appears that the boxcar effect in Lightning has multiple transactions, but a single governor limit shared across all transactions. It's not in the documentation, which suggests that this might be a bug. For now, consider performing some of the actions as background processes, which inhibits the boxcar effect.
To demonstrate this behavior, I wrote the following code:
Apex
public class q192876 {
@AuraEnabled public static void doAction() {
for(Integer i = 0; i < 11; i++) {
Contact[] a = [select id from contact limit 1];
}
}
}
Application
<aura:application controller="q192876">
<aura:handler name="init" value="{!this}" action="{!c.init}" />
</aura:application>
Controller
({
init: function(component, event, helper) {
[1,2,3,4,5,6,7,8,9,10].forEach(function() {
var action = component.get("c.doAction");
// action.setBackground(true);
$A.enqueueAction(action);
});
}
})
When the code is run as is, it produces a too-many-SOQL error. However, if you uncomment the line in the controller, it instead behaves correctly, producing ten logs instead of 1.
Note that using setBackground(true) means that you're implying that the transaction will take longer, so splitting the transactions will cause a minor delay compared to the boxcar effect.
Best Answer
No. Currently, you do not have LWC alternative to lightning:container.
Whenever you need to check similar tags for Aura vs LWC, you can check this documentation.
However, once check lwc:dom directive. Your requirement may fulfil with
lwc:dom