Skip to content

Releases: mbasso/gccx

Support [email protected], Fragment and ref

19 Jun 07:52
Compare
Choose a tag to compare

This release contains 2 features to support [email protected]

ref

refs are automatically converted to callbacks, you don't need to use parentheses:

<button ref={callback} />

// is equal to
<button (ref)={callback}>

Fragment

We support DocumentFragments using a special selector Fragment:

<Fragment>
	<div>Div content</div>
	Hello World!
</Fragment>

In this way you can group a list of children without adding extra nodes to the DOM.

// this cannot be done
/* asmdom::VNode* vnode = (
	<div>Child 1</div>
	<div>Child 2</div>
	<div>Child 3</div>
); */

// this is a valid alternative to the code above
asmdom::VNode* vnode = (
	<Fragment>
		<div>Child 1</div>
		<div>Child 2</div>
		<div>Child 3</div>
	</Fragment>
);

Automatically convert props to emscripten::val

17 Nov 10:41
Compare
Choose a tag to compare

With this release you don't have to care about the type of props, values are automatically passed to emscripten::val constructor, so, you can do something like this:

// you can provide any type:
// int foo = 7;

// or emscripten::val
// emscripten::val bar = emscripten::val::undefined();

<div
  [foo]={foo}
  [bar]={bar}
/>

First release 🎉

17 Nov 10:38
Compare
Choose a tag to compare

first release, compatible with [email protected]