Repository navigation
-
UIRoot.close: the returnedFuturecompletes once the root is shut down. It returned at once (true),
without awaiting the purge of its tree nor its closed render, and its components kept running:clearonly
removes their elements, so their timers kept going and their async contents kept loading and auto refreshing
(also keeping them alive in the tree, never purged nor disposed). Now, in order:- the
closeOperations(by defaultclear); - its components are disposed (
dispose), and theirUIAsyncContents stopped, also their auto refresh (new
UIComponent.stopUIAsyncContents); - its tree is purged (
purgeRoot), awaited; - its closed render (
renderClosed), awaited, thenonClose.
A component whose
disposethrows is logged and doesn't stop the others, norclose(also when purged by
purgeRoot, now awaited). - the
-
New
UIRoot.whenIdle({timeout, quietTime}): waits until no component is rendering, noUIAsyncContentis still
loading for the first time (newUIComponent.hasPendingUIAsyncContent; a loaded one with auto refresh doesn't
count, it never finishes) and no render happened in the lastquietTime(newUIComponent.lastRenderTime).
Returnsfalseon timeout. -
UIComponent.waitRender: the misspelledwaiteRenderrenamed;waiteRenderis kept, deprecated, calling it. -
UIAsyncContent.stop: also a refresh already scheduled is ignored (it still loaded once more).resetstill
loads it again. -
UIMultiSelection: a removed component (its input out of the document) no longer notifies its pending selection
on any hide of the options panel. Removed under the pointer, the browser fires amouseleavebefore the
visibility check (3.1.7), and that hide notified it (onSelect/onChangeof a removed component). -
Test tools:
initializeTestUIRootshuts its root down after the tests (newcloseOnTearDown, defaulttrue):
once idle (whenIdle), it's closed. Called in asetUpAll, after all the tests of thatsetUpAll's group (the
whole file for a top-level one); called in a test, after that test; before the group's owntearDownAlls.
Without it, a test file ended with its root's renders, async contents and timers still pending: with test files
run in parallel, the coverage missed the lines they ran late, and timing tests were flaky. -
Tests:
- New
bones_ui_root_close_test.dart: whenclosereturns, the components are disposed, an auto refresh is
stopped, an openUIMultiSelectionpanel is gone and the root is rendered closed (onCloseafter it); a
pending async content is stopped (not rendered later); a failingdisposedoesn't stop the shutdown;
whenIdlewhile an async content (of a component, or of the root itself) loads and once loaded, and with a
loaded auto refresh. - New
bones_ui_test_tools_teardown_test.dart: a root initialized in a group'ssetUpAllis open during its
group and closed (its components disposed) after it;closeOnTearDown: falsekeeps it open; a root
initialized in a test is closed after that test, also one never idle (after the idle timeout). bones_ui_components_b_test.dart: a removedUIMultiSelectionunder the pointer (amouseleavebefore the
visibility check) notifies nothing; it failed on 3.1.7, as the removed-component test did on CI.
- New