Skip to content

Releases: wallace-js/wallace

v0.17.1

03 Apr 22:01

Choose a tag to compare

Breaking

  1. You no longer see the cheat sheet by hovering over ordinary tags like div as this interfered with auto-completion. You must now use the help directive.
  2. The router now throws errors instead of displaying them.
  3. The render method has changed. It won't break anything, but you need to be aware of it. It now calls set which by default sets props and ctrl but may be overridden to modify the setting with the assign and watch directives.
// 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

  1. The watch directive, for watching props.
  2. The assign directive, for assigning the component to a property or variable.
  3. The help directive.

Fixes

  1. Fixed JSX autocomplete.
  2. Fixed bits with router.

Other

  1. There's now a set method on components, which you should't override.

v0.16.0

27 Feb 14:12

Choose a tag to compare

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:

  1. Stubs can now be repeated by adding .repeat after.
  2. 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

  1. Sneaky internal issue with detachers assuming Maps keys are sequential.

Other

None.

v0.15.0

21 Feb 21:43

Choose a tag to compare

Breaking

  1. The pool directive has been removed as repeaters now use a shared pool automatically (if the allowDismount flag is set) which will bring better performance for repeated repeaters.
  2. On nested components, the ref directive points to the nester, not the component.
  3. Can no longer use show or hide on nested components, must use if instead.

Features

  1. Components can implement dismount if the allowDismount flag is set (make sure you call the base method first).
  2. The if directive now works on nested components including stubs.
  3. The props and ctrl directives now work on stubs.

Fixes

None

Other

  1. Now runs tests for each flag as the only one enabled and the only one disabled, which will better catch errors.

v0.14.0

14 Feb 00:22

Choose a tag to compare

Breaking

  1. The bind directive's qualifier now refers to the attribute to bind to: bind:valueAsNumber instead of the event. You use event to change the event: event:keyup.
  2. The bind directive always watches value, even on checkboxes, so you need to set bind:checked for them to work as before, when that would be done automatically for you.

Features

  1. 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

  1. Can now set and bind to valueAsDate attribute of date inputs with Proxies of Date objects returned by watch - which previously didn't work.

Other

  1. KeyedRepeater performance improvement.

v0.13.0

11 Feb 22:15

Choose a tag to compare

Breaking

  1. All flags have been renamed from useXYZ to allowXYZ. See README.

Features

  1. Repeaters can now have sibling nodes when flag allowRepeaterSibling is true.

Fixes

  1. Fixed issue of keys being coerced into strings on the detacher.

Other

  1. Further improvements to performance and bundle size.
  2. KeyedFnRepeater merged back into KeyedRepeater.

v0.12.0

03 Feb 19:57

Choose a tag to compare

Breaking

  1. Big change how flags are set! See README.

Fixes

  1. Better warnings when features are used without appropriate flag being set.
  2. Ensure you can't use show/hide on repeat (you never could, but it didn't warn you)

Features

  1. Added useParts and useBase flags.
  2. Added ctrl directive.
  3. Separated keyed repeater into KeyedRepeater and KeyedFnRepeater for better performance.

Other

  1. Improvements to performance and bundle size.

v0.11.0

17 Jan 17:47

Choose a tag to compare

Breaking

  1. You need to set flags in your babel config to use certain features. See README.

Fixes

None

Features

  1. Flags as above.
  2. The unique directive.

Other

  1. Improvements to performance and bundle size.
  2. Fixed chart example.
  3. Added link to website.

v0.10.0

15 Jan 00:13

Choose a tag to compare

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

04 Jan 22:28

Choose a tag to compare

Breaking

  1. ref:xyz now creates a ref to the HTML Element or Nested Component, which is saved to this.ref.xyz as it did a few versions ago.
  2. part:xyz creates a part which you can use to update a section of a component: this.part.xyz.update() which was built int refs previously.
  3. Foo.create(props, ctrl) has been replaced by function createComponent(Foo, props, ctrl)

Fixes

None

Features

See Breaking

Other

  1. Improvements to performance and bundle size.

v0.7.2

04 Jan 00:42

Choose a tag to compare

Breaking

None

Fixes

  1. Renamed router.jsx to route.js as this broke the package.

Features

None

Other

  1. Added canary app test and lint to CICD.