Releases: wallace-js/wallace
v0.17.1
Breaking
- You no longer see the cheat sheet by hovering over ordinary tags like
divas this interfered with auto-completion. You must now use thehelpdirective. - The router now throws errors instead of displaying them.
- The
rendermethod has changed. It won't break anything, but you need to be aware of it. It now callssetwhich by default setspropsandctrlbut may be overridden to modify the setting with theassignandwatchdirectives.
// Old render function
function render (props, ctrl) {
this.props = props;
this.ctrl = ctrl;
this.update();
}
// New render function
function render (props, ctrl) {
this.set(props, ctrl);
this.update();
}
// Default set function
function set (props, ctrl) {
this.props = props;
this.ctrl = ctrl;
}
// Set function modified by `watch` directive
function set (props, ctrl) {
this.props = watch(props, () => this.update());
this.ctrl = ctrl;
}Features
- The
watchdirective, for watching props. - The
assigndirective, for assigning the component to a property or variable. - The
helpdirective.
Fixes
- Fixed JSX autocomplete.
- Fixed bits with router.
Other
- There's now a
setmethod on components, which you should't override.
v0.16.0
Breaking
Deprecated .nest syntax
Old way:
<Foo.nest props={data} />
New way:
<Foo props={data} />
Deprecated items directive
Old way:
<Foo.repeat items={data} />
New way:
<Foo.repeat props={data} />
It detects that you are passing props to repeat, and expects an array of the props requested by the nested component.
Change to stubs syntax and operation:
Old way (passes parent props, can't be repeated):
<stubs:foo />
New way:
<stub.foo props={data[0]} />
<stub.foo.repeat props={data} />
);Functional changes:
- Stubs can now be repeated by adding
.repeatafter. - Stubs do not automatically pass parent props, they must be specified.
Essentially they are nested components which can be substituted by derived components.
To get type support use the stub xarg:
interface ParentTypes {
ctrl: Controller;
stub: {
foo: Uses<iDay, Controller>;
};
}
const Parent: Uses<ParentTypes> = (_, { stub }) => (
<div>
<stub.foo props={data[0]} />
<stub.foo.repeat props={data} />
</div>
);Uses
The Uses type used to allow up to 3 types:
const Parent: Uses<Props, Controller, Method> = () => {}But now allows one, either Props as before:
const Parent: Uses<Props> = () => {}Or a compound type where all keys are optional:
interface ParentTypes {
props: iTask;
methods: {
getName: () => string;
},
ctrl: Controller;
stub: {
foo: Uses<iDay>;
};
}
const Parent: Uses<ParentTypes> = () => {}You can also inline that:
const Parent: Uses<{ctrl: Controller}> = () => {}Features
As above.
Fixes
- Sneaky internal issue with detachers assuming Maps keys are sequential.
Other
None.
v0.15.0
Breaking
- The
pooldirective has been removed as repeaters now use a shared pool automatically (if theallowDismountflag is set) which will bring better performance for repeated repeaters. - On nested components, the
refdirective points to the nester, not the component. - Can no longer use
showorhideon nested components, must useifinstead.
Features
- Components can implement
dismountif theallowDismountflag is set (make sure you call the base method first). - The
ifdirective now works on nested components including stubs. - The
propsandctrldirectives now work on stubs.
Fixes
None
Other
- Now runs tests for each flag as the only one enabled and the only one disabled, which will better catch errors.
v0.14.0
Breaking
- The
binddirective's qualifier now refers to the attribute to bind to:bind:valueAsNumberinstead of the event. You useeventto change the event:event:keyup. - The
binddirective always watchesvalue, even on checkboxes, so you need to setbind:checkedfor them to work as before, when that would be done automatically for you.
Features
- You can now specify pools on keyed repeaters, which allows you to access the individual components and/or share a pool between repeaters:
const myPool = new Map();
<Foo.repeat items={items} key="id" pool={myPool} />Fixes
- Can now set and bind to
valueAsDateattribute of date inputs with Proxies of Date objects returned bywatch- which previously didn't work.
Other
- KeyedRepeater performance improvement.
v0.13.0
Breaking
- All flags have been renamed from
useXYZtoallowXYZ. See README.
Features
- Repeaters can now have sibling nodes when flag
allowRepeaterSiblingis true.
Fixes
- Fixed issue of keys being coerced into strings on the detacher.
Other
- Further improvements to performance and bundle size.
- KeyedFnRepeater merged back into KeyedRepeater.
v0.12.0
Breaking
- Big change how flags are set! See README.
Fixes
- Better warnings when features are used without appropriate flag being set.
- Ensure you can't use show/hide on repeat (you never could, but it didn't warn you)
Features
- Added
usePartsanduseBaseflags. - Added
ctrldirective. - Separated keyed repeater into KeyedRepeater and KeyedFnRepeater for better performance.
Other
- Improvements to performance and bundle size.
v0.11.0
v0.10.0
Note there is no version 0.9.0 despite there being a tag for it. The publishing to npm failed as there were several phantom versions for 0.9.x dating back to before I even created the package on npm, so I skipped straight to 0.10.0
Breaking
None
Fixes
None
Features
- Keyed repeater now working and performing well.
Other
- Updated examples, some of which were broken as they hadn't kept up with changes.
v0.8.0
Breaking
ref:xyznow creates a ref to the HTML Element or Nested Component, which is saved tothis.ref.xyzas it did a few versions ago.part:xyzcreates a part which you can use to update a section of a component:this.part.xyz.update()which was built int refs previously.Foo.create(props, ctrl)has been replaced by functioncreateComponent(Foo, props, ctrl)
Fixes
None
Features
See Breaking
Other
- Improvements to performance and bundle size.