Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

v1.2.0 - Masters of the Universe

Choose a tag to compare

@ryansolidryansolid released this 26 Oct 07:04
· 726 commits to main since this release

This release centers around the addition of the universal JSX transform and runtime generator to enable custom renderers. This opens up whole new worlds of possibility with the opportunity to support new platforms beyond the web.

New Features

Custom Renderers

This release adds support custom renderers through a new "universal" transform. Solid now provides a sub modulesolid-js/universal that exports acreateRenderer method that allows you to create your own runtimes. This will enable things like native mobile and desktop, canvas and webgl, or even rendering to the terminal. This is still new so very much looking for feedback.

// example custom dom rendererimport{createRenderer}from"solid-js/universal";constPROPERTIES=newSet(["className","textContent"]);exportconst{  render,  effect,  memo,  createComponent,  createElement,  createTextNode,  insertNode,  insert,  spread,  setProp,  mergeProps}=createRenderer({createElement(string){returndocument.createElement(string);},createTextNode(value){returndocument.createTextNode(value);},replaceText(textNode,value){textNode.data=value;},setProperty(node,name,value){if(name==="style")Object.assign(node.style,value);elseif(name.startsWith("on"))node[name.toLowerCase()]=value;elseif(PROPERTIES.has(name))node[name]=value;elsenode.setAttribute(name,value);},insertNode(parent,node,anchor){parent.insertBefore(node,anchor);},isTextNode(node){returnnode.type===3;},removeNode(parent,node){parent.removeChild(node);},getParentNode(node){returnnode.parentNode;},getFirstChild(node){returnnode.firstChild;},getNextSibling(node){returnnode.nextSibling;}});

Working examplehere.

Spreads Added to Solid'shtml

It's been a long time coming but Solid's Tagged Template Literals now support element and component spreads using htm inspired syntax.

html`<div...${props}/>`

Fixes

Dynamic Spreads now work on Components

Previously spreads on components would only track property changes on bound objects and not when the whole object changed. This now works:

<MyComponent{...getStuff()}/>

ClassList properly merges multiple classnames in the key

It is common in libraries like Tailwind to apply multiple classes at the same time. There was an issue where true and false resolutions were cancelling each other out. This would only settext-sm.

<divclassList={{"px-2.5 py-1.5 text-xs":false,"px-3 py-2 text-sm":false,"px-4 py-2 text-sm":true,"px-4 py-2 text-base":false,"px-6 py-3 text-base":false}}/>

Consistent handling of HTMLEntities

Things like&nbsp; used to render differently depending if in elements or components(or fragments). This has been made consistent across all three.

Various improvements to Types and Transitions

A lot of bugs from the last minor release were around Transitions that have been addressed. And as always Types have been gradually improving.

Assets2
Loading
zhaoyao91, mzaien, easylogic, one-aalam, erkieh, orenelbaum, git-ced, Priestch, bannndi, aFuzzyBear, and 41 more reacted with hooray emojizhaoyao91, mzaien, wobsoriano, easylogic, orenelbaum, git-ced, bikeshedder, bannndi, aFuzzyBear, darioielardi, and 31 more reacted with heart emojialdy505, Ali-Fani, aminya, yhdgms1, Chalarangelo, pierre-H, N0tExisting, nrgnrg, danielpza, Suzan-Dev, and 44 more reacted with rocket emoji
94 people reacted

[8]ページ先頭

©2009-2025 Movatter.jp