<p dir="auto">Is there a reason for not using <a href="https://github.com/zloirock/core-js">core-js</a>? From the <a href="http://kangax.github.io/compat-table/es6/#typescript" rel="nofollow">es6 compat table</a> core-js covers a lot more than <a href="http://kangax.github.io/compat-table/es6/#es6shim" rel="nofollow">es6-shim</a>.</p>
<p dir="auto">Currently we generate one setter registration per <code class="notranslate">bind</code> value. For example, this annotation:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'bind': {'text': 'tool-tip'}"><pre class="notranslate"><code class="notranslate">'bind': {'text': 'tool-tip'}
</code></pre></div>
<p dir="auto">attached to two classes, <code class="notranslate">A</code> and <code class="notranslate">B</code> would generate</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="registerSetters({'text': (A obj, String value) =&gt; obj.text = value})
registerSetters({'text': (B obj, String value) =&gt; obj.text = value})"><pre class="notranslate"><code class="notranslate">registerSetters({'text': (A obj, String value) =&gt; obj.text = value})
registerSetters({'text': (B obj, String value) =&gt; obj.text = value})
</code></pre></div>
<p dir="auto">Instead we need to generate a single setter registration using a common parent class of <code class="notranslate">A</code> and <code class="notranslate">B</code>. This would be tough to do without resolving in our transformer, which we would like to avoid. As a first approximation, we can omit the parameter type (<code class="notranslate">A</code> and <code class="notranslate">B</code> above) which will be interpreted as <code class="notranslate">dynamic</code>.</p>
<p dir="auto">To do this, we need global knowledge of the setters which would be registered.</p>
<ol dir="auto">
<li>Modify the <code class="notranslate">bind_generator</code> transformer, its primary inputs are the <code class="notranslate">.ngDeps.dart</code> files generated by the app entry points.</li>
<li>Parse these files, gathering information on the setters to be generated.</li>
<li>Also parse all <code class="notranslate">.ngDeps.dart</code> files imported by the primary inputs.</li>
<li>Where there are multiple setters for a single property, remove type information from the registered setter.</li>
<li>Output a <code class="notranslate">.ngSetters.dart</code> file with a <code class="notranslate">setupReflection</code> method that registers all setters.</li>
<li>Generate code to import and call <code class="notranslate">setupReflection</code> during app setup.</li>
</ol>