- Back porting marko PR #402 - Bug on jQuery Proxy when
w-id
contains dash/hyphen
- Fixed #165 -
event-delegation.js:44 Uncaught TypeError: Cannot read property '__widget' of null
- add cspNonce support
- Fixed #163 -
w-for
was not being removed - Testing: Use phantomjs-prebuilt binary when launching mocha-phantomjs
- Fixed #160 - Listeners for event delegation do not work if
document.body
is not available
- Fixed #154 - Listeners for event delegation do not work if
document.body
is not available
- Fixed #153 - Bubbling event listeners used by event delegation system are attached too late
- Upgraded to
raptor-util@2
- Fixed regression where
code
was note being returned fromgetInitWidgetsCode
.
- Fixed #150 - Integrated warp10 for high performance state/config serialization. Circular dependencies are now supported and duplicate objects are only serialized once.
- Revert back to
morphdom@^1
until more testing can be done
- Fixes #147 - Immediate widget initialization not working correctly with client reordering enabled
- Throw an error if a widget fails to initialize because DOM el is missing
- Upgrade to
morphdom@2
- Fixed #144 - ready callback invoked multiple times when using jQuery proxy
- Refactored testing harness
- Fixed #141 - w-preserve-if/w-preserve-body-if broken
- Fixed #137 - A widget should not update the DOM if it is destroyed (fixed by @avigy)
- Use lasso-modules-client for generating client-side widget module paths
- Upgraded test dependencies
- Improve how client-side module paths are generated when lasso is available
- Marko v3 compatibility
- Fixes #121 - Allow for w-preserve-attrs to enable preservation of attributes:
<div w-preserve-attrs="style,class"></div>
- The function for generating unique widget IDs on the client-side is not
exported as a global on the
window
object (fixes #118).
- Fixes #116 - Bug in browserify breaks browserify compatibility (workaround required)
- Use
<noscript>
tag for delivering widget IDs to the browser
- Fixes #112 DOM document should be bound to widget for purpose of using correct document.getElementById(...)
- Fixes #111 - Make registerWidget a no-op on the server
- Fixes #109 - checks addEventListener instead of attachEvent
- Fixes #109 - checks addEventListener instead of attachEvent
- Improvement to docs
- Fixes #106 - Fix immediate widget initialization
- Fixes #102 Fix how require path to marko-widgets is generated in compiled templates
- Fixes #101 - Widget binding broken when UI component is npm linked in
- Documentation fixes
- Fix for #98 - Properly preserve widget stack when beginning async rendering
- Fixes #92 - w-preserve* does not work on widget root node
- Integrated morphdom to more efficiently transform the existing DOM instead of replacing it entirely
- Significant performance improvements
- Code cleanup
- Breaking changes:
- The
onAfterUpdate
lifecycle event was renamed toonUpdate
- Reusing DOM nodes might change application behavior (in rare cases)
- The
init()
constructor for a widget is only called once even if a widget is rerendered
- The
- Dust-related code has been removed
- New lifecycle event: 'onRender'
- Fixed #41 - Initialize widgets in nested batched updates first
- Fixed #54 - Allow event handler method name to be dynamic
- Internal code improvements
- Fixed #49 - Allow
w-id
to be used in an intermediate template
- Fixed #48 - Improved logic for generating repeated widget IDs to handle gaps
- Fixed #47 - Switched from
optimizer
to lasso for tests - Fixed #46 - Allow
w-id
attr with<invoke>
- Added support
w-preserve-if
andw-preserve-body-if
. These new attributes allow DOM elements to be conditionally preserved. The right-hand side of the attribute should a JavaScript expression. If the expression evaluates tofalse
then the elements will not be preserved. Example usage:
<div w-bind>
<!-- Don't rerender the search results if no search results are provided -->
<app-search-results items="data.searchResults"
w-preserve-if="data.searchResults == null"/>
</div>
- Stateful widgets
- Batched updates to the DOM
- New methods exported by marko-widgets:
defineComponent(def)
defineWidget(def)
defineRenderer(def)
- New custom taglib attributes:
w-preserve
,w-preserve-body
andw-body
- New Widget methods:
setState(name, value)
setState(newState)
replaceState(newState)
setProps(newProps)
setStateDirty(name)
onBeforeDestroy()
onDestroy()
onBeforeUpdate()
onAfterUpdate()
- New rendering properties:
template
(String
path to a Marko template)getInitialProps(input)
getInitialState(input)
getTemplateData(state, input)
getWidgetConfig(input)
getInitialBody(input)
- General code cleanup and performance improvements
- ❗ Removed support for
Widget.prototype.render = function(input, out) { ... }
- ❗ Removed support for
this.widgets.foo
(usethis.getWidget('foo')
instead) - Added support for repeated DOM elements and repeated widgets:
<div class="my-component" w-bind="./widget">
<ul>
<li w-id="todoListeItems[]" for="todoItem in data.todoItems">
<app-todo-item w-id="todoItems[]" todo-item="todoItem"/>
</li>
</ul>
</div>
var todoListeItems = this.getEls('todoListeItems');
var todoItemWidgets = this.getWidgets('todoItems');
- Added new methods:
getEls(id)
getWidgets(id)
- Deprecate
w-el-id
in favor ofw-id
- Internal code cleanup
- Fixed #19 - Allow
w-on
for custom widget events
- Fixed #18 - Widgets in async blocks now initialize in the correct order
- Fixed #17 - Allow
w-config
withw-extend
- Internal: use 'renderBody(out)' instead of
invokeBody()
- Introduced
require('marko-widgets').render(renderer, input)
- Replaced
require('marko-widgets').renderFunc(renderer)
withrequire('marko-widgets').renderable(exports, renderer)
- Improved documentation
- Added support for using
exports.extendWidget = function(widget, widgetConfig) { ... }
- Allow
w-extend
attribute to be empty
- Allow empty value for
w-bind
(e.g.<div w-bind>...</div>
) and default to./widget
or./
- Export new method for creating a client-side render function:
function renderer(input, out) {
out.write('Hello ' + input.name + '!');
}
exports.render = require('marko-widgets').renderFunc(renderer);
- Added new sub-module,
require('marko-widgets/dom')
, that exports raptor-dom
Example:
require('marko-widgets/dom').removeChildren(document.body);
- Added new sub-module,
require('marko-widgets/renderer')
, that exports raptor-renderer
Example:
require('marko-widgets/renderer').renderFunc(renderer);
- Improved mechanism for registering and loading widget types.
- Use
exports.Widget
instead ofmodule.exports = Widget
- Fixes #14 - Making adding event listeners more robust by allowing initialization even if document is not ready
- Changes to prevent unoptimized code in V8
- Fixes #11 Added support for w-on* attributes. Other cleanup and tests