Index: pkg/web_components/lib/interop.dart |
diff --git a/pkg/web_components/lib/interop.dart b/pkg/web_components/lib/interop.dart |
index 058ce76d637cf914d151c9c7a507ea8d413d0aa3..415c7feae439fbe9864c8baf8414deb75ac4bf46 100644 |
--- a/pkg/web_components/lib/interop.dart |
+++ b/pkg/web_components/lib/interop.dart |
@@ -31,3 +31,13 @@ void registerDartType(String tagName, Type dartType, {String extendsTag}) { |
dartType, extendsTag: extendsTag); |
_doc.callMethod('_registerDartTypeUpgrader', [tagName, upgrader.upgrade]); |
} |
+ |
+/// This function is mainly used to save resources. By default, we save a log of |
+/// elements that are created but have no Dart type associated with them. This |
+/// is so we can upgrade them as soon as [registerDartType] is invoked. This |
+/// function can be called to indicate that we no longer are interested in |
+/// logging element creations and that it is sufficient to only upgrade new |
+/// elements as they are being created. Typically this is called after the last |
+/// call to [registerDartType] or as soon as you know that no element will be |
+/// created until the call to [registerDartType] is made. |
+void onlyUpgradeNewElements() => _doc.callMethod('_onlyUpgradeNewElements'); |