Repository navigation
v3.1.0
-
sdk: ^3.13.0
-
Now based on
dom_builder3.1.0,dom_tools3.1.0,web_utils1.1.0 andjs_interop_utils1.1.1 (Dart 3.13
versions, with many bug fixes; see their changelogs). Notably,UIColorPickerInputcolors are now opaque (they
were parsed with alpha 0) andrgba(...)colors keep their alpha (viaColor.parse). -
Adopted Dart 3.8–3.12 features (flagged by
lints6): private named parameters (this._x, same named
arguments), null-aware elements, explicit types;Object?.isA<T>()instead ofasJSAny.isA<T>(). -
Performance (render time and memory; see
doc/benchmarks.md):- Rendering no longer walks the whole rendered tree through JS interop several times per render: the elements
with parsed attributes (navigate,action,onEventClick,uiLayout...),bg-bluranddiv-centered-*
classes and sub-components are selected with nativequerySelector(All). - Placing the rendered children no longer calls
childNodes.indexOfper element (O(n²) per render). UIComponentsTreereplacesDOMTreeReferenceMapas the tree of components of aUIRootComponent: with
dart2wasmJS objects have a constant DarthashCode, making each registration and lookup O(n); nodes are now
hashed by JS identity (up to 10x faster renders of many components withdart2wasm).- Purged components (no longer in the tree) are held weakly (still resolvable while referenced elsewhere, up to
the same 1 minute), and the purge after rendering is time-sliced (it yielded ~4ms per component): discarded
renders are released promptly (-16% heap in a real app after navigating and re-rendering). The slice length is
UIComponent.purgeSliceTime(8ms by default). - New
benchmark/render_benchmark.dart(synthetic render scenarios,dart2jsanddart2wasm),
benchmark/compare.dart, andchrome-bench/chrome-proftest platforms.
- Rendering no longer walks the whole rendered tree through JS interop several times per render: the elements
-
UIComponent:- Fix (
dart2wasm):getContentUIComponent(and soelement.uiComponent) missed components when the content
element was re-read from the DOM: the association was anExpandokeyed by the Dart wrapper; it's now a JS
WeakMap(JS identity). parentis recorded when the content is already a child of the parent (it stayednull, e.g. after
addExternalElementToElement/replaceChildElement).getFieldsreturns the value ofUIFieldcomponents (it resolved their container:'').setAttribute('style' | 'class', '')no longer fails a null check.- A
render()returning aMapwithout renderable entries is rendered as JSON (as documented).
- Fix (
-
UIComponentGenerator.clearAttribute: uses the attribute handler'scleaner(it always setnull). -
UIConsole: formatting aListmessage no longer recurses until a stack overflow;tail(n)no longer throws a
RangeErrorwith fewer thannlogs (tail()threw with fewer than 100). -
CSSProvider.cssFromElement: returns the computed CSS of elements in the DOM (Chromium's computedcssTextis
empty). -
TextProviderwithout a source throws aStateError(it overflowed the stack).UIDeviceOrientationno longer
throws on eachdeviceorientationevent wherewindow.orientationis undefined (desktop). -
UIDocument: text documents are HTML-escaped (<tag>in a.txtbecame an element). -
Navigation:
parameterAsNumList/parameterAsBoolListno longer throw aTypeError;
UINavigableContentfiresonChangeRoute. -
Components:
$uiDialogcreates aui-dialog(it created aui-button-loader). Constructing aUIDialogno longer fires
onShow(or hides theUIRootwithhideUIRoot) before it's shown.UIButtonLoader: the button is hidden while loading and restored on stop;loadedTextStyleno longer shows the
loaded message before loading ends.UICalendar:- Week mode (
CalendarMode.week, the default mode) is implemented: it rendered nothing. The days of the week of
currentDate(fromfirstDayOfWeek) × time slots, withnextWeek/previousWeeknavigation,onDayClick
(day headers),onHourClick,onEventClick, and ↑/↓ to the month/day modes (perallowedModes). New
currentWeekDays. - Events longer than a time slot (or spanning days in the month view) are shown in every slot/day they overlap
(only events entirely inside a slot were shown).selectEventsreturns overlapping events; new
CalendarEvent.overlapsTimeRange(isInTimeRangeis unchanged). Continuation slots are rendered with the
ui-calendar-event-continuationclass (CalendarEvent.render(continued:)). - The month view no longer drops the last day of some months; clicking the title date shows the date input and
updates the title.
- Week mode (
UILoadingConfig/$uiLoading:inline: falseis applied.UIDataSource: its content is hidden (display: 'node'typo).UIJsonRender: HTML inside JSON values is shown as text.htmlAsSvgContent: appliesrootClass, uses the title's text, no debugprint.UISVG:renderedElement/
isRenderedAsSVGare set forsvgContent.BUIRender: fixed aTypeErroron construction;BUIViewProvider.routes/menuRoutesno longer throw;
BUIRenderSource.sourceAsDOMElementworks with anElementsource ondart2wasm;renderThumbnailincludes
the document styles (they were dropped) and appendsstylesinstead of replacing them.UIMasonry:Elementitems render; fixedTypeErrors in the size calculation and withDOMElementitems.UIMultiSelection: filtering re-renders the options panel; the inlineoptionsattribute (a: A ; b: B)
works.UIInputTable: extra rows keep their text; extra rows of non-table elements no longer crash; thepath
input's value-provider button works.ui-template:variablesare applied, including JSON variables.UICapture.selectedFileDataAsBase64: fixed for data URL data.
-
UILayout:#id[n]expressions work ondart2wasm; negative values get their unit (-5px). -
UIExplorer:queryexplorers render (aTypeErrorin the controllers' properties);YAMLConfig/JSONConfig
toString()closing}.isGeneratedElement: removed debugprints. -
Test tools:
testUISleepappliesmaxMsand the 1 ms minimum;testUISleepUntilappliesminMs;
selectUntilTypedrejects elements of the wrong type (JS interop types erase at runtime); the
selectWhereUntil/selectWhereUntilTypedfuture extensions no longer throw aTypeError. -
Test CLI: an empty
--log-diris no longer the current directory; a missing<title>is inserted in reports;
compile()awaits the compile directory creation. -
Dependencies:
- dom_builder: ^3.1.0
- dom_tools: ^3.1.0
- web_utils: ^1.1.0
- js_interop_utils: ^1.1.1
- statistics: ^1.2.2
- yaml: ^3.1.4
- archive: ^4.3.0
- test: ^1.32.0
- test_api: ^0.7.14
- test_core: ^0.6.20
- stack_trace: ^1.12.2
- build_web_compilers: ^4.8.10
- build_runner: ^2.16.1
- lints: ^6.1.0
- dependency_validator: ^5.1.0
-
Tests: new browser integration tests (
bones_ui_core_integration_test.dart,bones_ui_components_a_test.dart,
bones_ui_components_b_test.dart,bones_ui_generator_explorer_test.dart,bones_ui_regression_test.dart) and
VM tests for the test CLI (bones_ui_cli_test.dart).