<div dir="ltr">Hi Anton!<br clear="all"><div><div class="gmail_signature"><br></div><div class="gmail_signature">I tried to use/implement import statement.</div><div class="gmail_signature"><br></div><div class="gmail_signature">Because it is already semi-implemented, I hoped it will be</div><div class="gmail_signature">easy task. However I cannot complete it without your help.</div><div class="gmail_signature"><br></div><div class="gmail_signature">1. Could you please fix parser to allow "." (dot) in component names. E.g:</div><div class="gmail_signature">``````````````````````````````````````</div><div class="gmail_signature">import components.scatter 1.0 as ScatterScene<br></div><div class="gmail_signature"><br></div><div class="gmail_signature">Item {</div><div class="gmail_signature"> ScatterScene.App </div><div class="gmail_signature"> {</div><div class="gmail_signature"> ^ Parser says here: Unexpected token punc undefined, expected punc</div><div class="gmail_signature"> }</div><div class="gmail_signature">}</div><div class="gmail_signature">``````````````````````````````````````<br></div><div class="gmail_signature">Probably this is not a "dot in component names" problem, but it anyway refuses to parse...</div><div class="gmail_signature"><br></div><div class="gmail_signature"><br></div><div class="gmail_signature">2. Path lookup - need your advice.</div><div class="gmail_signature"><br></div><div class="gmail_signature">I found that `parseQML` function returns $imports array. </div><div class="gmail_signature"><br></div><div class="gmail_signature">I checked and see that after parseQML you always call</div><div class="gmail_signature">`new QMLComponent` method. E.g:</div><div class="gmail_signature">``````````````````````````````````````````````</div><div class="gmail_signature"><div class="gmail_signature"> var tree = parseQML(src);</div><div class="gmail_signature"> var component = new QMLComponent({ object: tree, context: executionContext });<br></div><div>```````````````````````````````````````````````</div><div>So I think it is possible to keep `tree.$imports` value somewhere in component,</div><div>here or inside QMLComponent constructor.</div><div><br></div><div>The goal for keeping $imports of current component is to have access to it in <br></div><div>`construct` function when constructing the children of current document. </div><div><br></div><div>We can perform some cached lookups of qmldir files contents and decide whenever we should use component from some qmldir file.</div><div><br></div><div>For now, I digged a little to your code and I cannot understand, where is it better to keep $imports? I tried metaobject, and context, but seems they are not what I need.</div><div>Could you please make some advice?</div><div><br></div></div><div class="gmail_signature">Best Regards,</div></div><div class="gmail_signature">Pavel</div><div class="gmail_signature"><br></div><div class="gmail_signature">p.s. I understand that most of your efforts currently are on qml-to-js convertor. </div><div class="gmail_signature">However it doesn't seem to be ready tomorrow, because it is not easy task. </div><div class="gmail_signature">And current parser/qtcore are "working things". So please give some attention to them too, because they are just working... Thank you!</div>
</div>