You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Initial vdom rewrite
* refactor
* vdom
* Additional vdom changes
* More changes to vdom to support merges correctly
* Refactors
* More refactors
* Fix dom vnode logic and refactor property/attribute/event updates
* more refactors
* Use original properties passed to the widget when creating the instruction for an invalidation
* Do not try to merge for custom elements
* Move dom application to after the invalidation queue has been processed
* Run deferred properties in WidgetBase
* README
* Clean up and tests for ProjectorMixin
* Move invalidate back to instanceData
* Uncomment tests
* Move from class to function for vdom
* vdom reorg and tweaking
* README
* Add back remaining vdom unit tests
* refactor and fixes to ensure the latest wrapper is used
* Run filtering before clearing the node handler to allow meta usage in deferred props
* Move registry resolution to WidgetBase from vdom
* Create attach application for operations on a widget after it has been appended
* Fix insert before calculation to ensure results of widgets added to the correct position
* Falsy dnodes are now filtered by widgetbase, so deal with this in asserting render
* more tidying
Copy file name to clipboardExpand all lines: src/widget-core/README.md
+41-26
Original file line number
Diff line number
Diff line change
@@ -61,16 +61,30 @@ class HelloDojo extends WidgetBase {
61
61
62
62
#### Rendering a Widget in the DOM
63
63
64
-
To display your new component in the view you will need to decorate it with some functionality needed to "project" the widget into the browser. This is done using the `ProjectorMixin` from `@dojo/framework/widget-core/mixins/Projector`.
64
+
To display your new component in the view you will to use the `renderer` from the `@dojo/framework/widget-core/vdom` module. The `renderer` function accepts function that returns your component using the `w()` pragma and calling `.mount()` on the returned API.
By default, the projector will attach the widget to the `document.body` in the DOM, but this can be overridden by passing a reference to the preferred parent DOM Element.
74
+
`renderer#mount` accepts an optional argument of `MountOptions` that controls configuration of the mount operation.
@@ -596,7 +607,7 @@ These are some of the **important** principles to keep in mind when creating and
596
607
597
608
1. The widget's *`__render__`*, *`__setProperties__`*, *`__setChildren__`* functions should **never** be called or overridden.
598
609
- These are the internal methods of the widget APIs and their behavior can change in the future, causing regressions in your application.
599
-
2. Except for projectors, you should **never** need to deal directly with widget instances
610
+
2. You should **never** need to deal directly with widget instances
600
611
- The Dojo widget system manages all instances required including caching and destruction, trying to create and manage other widgets will cause issues and will not work as expected.
601
612
3. **Never** update `properties` within a widget instance, they should be considered pure.
602
613
- Properties are considered read-only and should not be updated within a widget instance, updating properties could cause unexpected behavior and introduce bugs in your application.
@@ -798,23 +809,27 @@ class MyWidget extends WidgetBase {
798
809
799
810
The `Registry` provides a mechanism to define widgets and injectors (see the [`Containers&Injectors`](#containers--injectors) section), that can be dynamically/lazily loaded on request. Once the registry widget is loaded all widgets that need the newly loaded widget will be invalidated and re-rendered automatically.
800
811
801
-
A main registry can be provided to the `projector`, which will be automatically passed to all widgets within the tree (referred to as `baseRegistry`). Each widget also gets access to a private `Registry` instance that can be used to define registry items that are scoped to the widget. The locally defined registry items are considered a higher precedence than an item registered in the `baseRegistry`.
812
+
A main registry can be provided to the `renderer`, which will be automatically passed to all widgets within the tree (referred to as `baseRegistry`). Each widget also gets access to a private `Registry` instance that can be used to define registry items that are scoped to the widget. The locally defined registry items are considered a higher precedence than an item registered in the `baseRegistry`.
In some scenarios, it might be desirable to allow the `baseRegistry` to override an item defined in the local `registry`. Use true as the second argument of the registry.get function to override the local item.
@@ -970,7 +985,7 @@ class MyClass extends WidgetBase {
970
985
971
986
### Containers & Injectors
972
987
973
-
There is built-in support for side-loading/injecting values into sections of the widget tree and mapping them to a widget's properties. This is achieved by registering an injector factory with a `registry` and setting the registry as a property on the application's `projector` to ensure the registry instance is available to your application.
988
+
There is built-in support for side-loading/injecting values into sections of the widget tree and mapping them to a widget's properties. This is achieved by registering an injector factory with a `registry` and setting the registry on the application's `renderer` to ensure the registry instance is available to your application.
974
989
975
990
Create a factory function for a function that returns the required `payload`.
976
991
@@ -1570,7 +1585,7 @@ Your widget will be registered with the browser using the provided tag name. The
1570
1585
1571
1586
##### Initialization
1572
1587
1573
-
Custom logic can be performed after properties/attributes have been defined but before the projector is created. This
1588
+
Custom logic can be performed after properties/attributes have been defined but before the custom element is rendered. This
1574
1589
allows you full control over your widget, allowing you to add custom properties, event handlers, work with child nodes, etc.
1575
1590
The initialization function is run from the context of the HTML element.
0 commit comments