Skip to content

Rendering non-blocking elements does not work#9

Open
mkhl wants to merge 3 commits into
complate:masterfrom
mkhl:test/async
Open

Rendering non-blocking elements does not work#9
mkhl wants to merge 3 commits into
complate:masterfrom
mkhl:test/async

Conversation

@mkhl

@mkhl mkhl commented Dec 27, 2017

Copy link
Copy Markdown
Contributor

Note: This is a bug report with a test case attached.

We don't currently seem to have a test case that ensures that basic rendering
of async elements (in async mode) works correctly,
and the attached test fails on master, and not just since cc106c1
but at least back at v0.12.0.
(Earlier versions had too different API for me to test easily.)

I may be misunderstanding the macro, but I expect it to render

     <div><p>…</p><p><i>lorem ipsum</i></p><p>…</p></div>

when instead it renders (note the different nesting):

     <div><p>…</p><p><p>…</p><i>lorem ipsum</i></p></div>

Note the incorrect nesting: I believe this is due to sibling elements
being rendered before a child with asynchronous children
has had a chance to finish rendering.

Add a test that renders a non-blocking element including an actual
asynchronous child element.
We should ensure that elements of this kind are ordered and nested
properly.
@mkhl

mkhl commented Dec 27, 2017

Copy link
Copy Markdown
Contributor Author

I added a fix that passes all tests but I’m not certain I’m happy with it yet.

@mkhl

mkhl commented Dec 27, 2017

Copy link
Copy Markdown
Contributor Author

Correction: It doesn’t pass the tests, but the lingering eslint errors hide the failures.

@FND

FND commented Dec 27, 2017

Copy link
Copy Markdown
Contributor

Thank you. I've attempted to build on your efforts in complate:async (note that this expands the corresponding non-renderer test in order to reproduce the issue at a lower level) - mostly hacking aimlessly in post-holiday stupor, which did yield some success though: The async tests are green now, but we're back to recursion errors (cf. cc106c1), which is what I was afraid of with this approach. 😞

mkhl added 2 commits December 27, 2017 14:47
Element generators can have acynchronous children in non-blocking mode,
in which case the their _siblings_ should only be processed _after_
the current child has executed its callback.
This is only relevant in non-blocking mode because in blocking mode
we are certain that the children have run their callbacks once they
have returned.
@FND

FND commented Jan 21, 2018

Copy link
Copy Markdown
Contributor

FYI: I've now cherry-picked your performance tweak into master (53a9365) and updated complate:async accordingly. Still pondering what all this means though... 🤕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants