<div dir="ltr">Hi Anton!<div><br></div><div>I have added tests to github's pull request.</div><div><br></div><div>Many thanks to you for warning me!</div><div>I had to do the import thing because it is required for my project. <br></div><div>After that, QmlWeb's core looks like complete (for my needs).<br></div><div><br></div><div>BTW We have started an attempt to create some QtQuick.Controls components.</div><div>They are build as qml-files, so it will be usable even in your new compiler.</div><div>In case of some success with those components, I will notify you. </div><div><div><br></div><div>Best Regards,</div><div>Pavel</div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">С уважением,<br>Павел Васёв</div></div>
<br><div class="gmail_quote">2015-03-17 13:41 GMT+05:00 Anton Kreuzkamp <span dir="ltr"><<a href="mailto:anton@akreuzkamp.de" target="_blank">anton@akreuzkamp.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
Hi,<br>
<br>
thanks again a lot for your code!!<br>
I think we can ship it (as soon as we have tests) and go to improve
it there. :)<br>
<br>
Please note: As I already wrote, a friend of mine and myself are
currently working on a new iteration of<br>
QmlWeb, that will be compiled. For this purpose I'm rewriting the
runtime from scratch (reusing parts,<br>
that can be reused of course). Surely, the import stuff is very
valuable for that as well (again: thanks, I'm<br>
very happy about it), still, quite some of the work will be done by
the compiler (what's left is like "load<br>
module from <a href="http://example.com/coe/myModule.js" target="_blank">http://example.com/coe/myModule.js</a> and make it
available.").<br>
<br>
So please do not put too much blood, sweat and tears in stuff, that
unfortunately won't live for long...<br>
(don't get me wrong, I very much appreciate your work, I just want
to avoid you being disappointed, if I<br>
need to replace it, because the compiler now does the work)<br>
<br>
Cheers, Anton<div><div class="h5"><br>
<br>
<div>On 17.03.2015 08:48, Pavel Vasev wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr">Hi Anton!
<div><br>
</div>
<div>I have implemented initial version of imports. They work!
;-)</div>
<div>The code in my original pull request: <a href="https://github.com/akreuzkamp/qmlweb/pull/1" target="_blank">https://github.com/akreuzkamp/qmlweb/pull/1</a></div>
<div><br>
</div>
<div>p.s. Probably that pull request is "stale". Please note me
and I will try to do something...</div>
</div>
<div class="gmail_extra"><br clear="all">
<div>
<div>С уважением,<br>
Павел Васёв</div>
</div>
<br>
<div class="gmail_quote">2015-03-13 13:42 GMT+05:00 Pavel Vasev
<span dir="ltr"><<a href="mailto:pavel.vasev@gmail.com" target="_blank">pavel.vasev@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi Anton!<br clear="all">
<div>
<div><br>
</div>
<div>I tried to use/implement import statement.</div>
<div><br>
</div>
<div>Because it is already semi-implemented, I hoped it
will be</div>
<div>easy task. However I cannot complete it without
your help.</div>
<div><br>
</div>
<div>1. Could you please fix parser to allow "." (dot)
in component names. E.g:</div>
<div>``````````````````````````````````````</div>
<div>import components.scatter 1.0 as ScatterScene<br>
</div>
<div><br>
</div>
<div>Item {</div>
<div> ScatterScene.App </div>
<div> {</div>
<div> ^ Parser says here: Unexpected token punc
undefined, expected punc</div>
<div> }</div>
<div>}</div>
<div>``````````````````````````````````````<br>
</div>
<div>Probably this is not a "dot in component names"
problem, but it anyway refuses to parse...</div>
<div><br>
</div>
<div><br>
</div>
<div>2. Path lookup - need your advice.</div>
<div><br>
</div>
<div>I found that `parseQML` function returns $imports
array. </div>
<div><br>
</div>
<div>I checked and see that after parseQML you always
call</div>
<div>`new QMLComponent` method. E.g:</div>
<div>``````````````````````````````````````````````</div>
<div>
<div> var tree = parseQML(src);</div>
<div> 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>Best Regards,</div>
</div>
<div>Pavel</div>
<div><br>
</div>
<div>p.s. I understand that most of your efforts currently
are on qml-to-js convertor. </div>
<div>However it doesn't seem to be ready tomorrow, because
it is not easy task. </div>
<div>And current parser/qtcore are "working things". So
please give some attention to them too, because they are
just working... Thank you!</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
QmlWeb mailing list
<a href="mailto:QmlWeb@kde.org" target="_blank">QmlWeb@kde.org</a>
<a href="https://mail.kde.org/mailman/listinfo/qmlweb" target="_blank">https://mail.kde.org/mailman/listinfo/qmlweb</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br></div>