IssueRaiser

Future of Craft.js - taking it to the next level! 🚀

# Background Hey folks! Craft.js is about 3 years old now and in that time we've seen plenty of Craft-based page editor implementations in the wild. I'm incredibly grateful for everyone who has been using Craft, and for the feedback I have gotten all this while. Having personally worked at some companies that used Craft has helped me to recognise the strengths and as well some of the shortcomings of the framework. One of those shortcomings that I felt was in the state management system itself. While the current `EditorState` in Craft works pretty well, it falls short for more complex page editor requirements. Currently, it isn't quite possible to build complete UI components with Craft. Let's take a look at how a typical UI component built in React looks like: ```tsx const posts = [...]; const MyComponent = (props) => { const [counter, setCounter] = useState(0); return ( <div> <h1>Hello World!</h1> { props.enabled && <p>I'm enabled!</p> } { counter > 0 && ( <h2>I'm non-negative!</h2> ) } { posts.map(post => <h2>{post.name}</h2>) } <button onClick={() => { setCounter(counter + 1); }}> Increment </button> </div> ) } ``` A React component is able to do the following:- - Render an HTML ou

Posted by prevwong on Apr 4, 2023, 12:41 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

ux (Other)

Future of Craft.js - taking it to the next level! 🚀

prevwongApr 4, 2023, 12:41 PM

# Background Hey folks! Craft.js is about 3 years old now and in that time we've seen plenty of Craft-based page editor implementations in the wild. I'm incredibly grateful for everyone who has been using Craft, and for the feedback I have gotten all this while. Having personally worked at some companies that used Craft has helped me to recognise the strengths and as well some of the shortcomings of the framework. One of those shortcomings that I felt was in the state management system itself. While the current `EditorState` in Craft works pretty well, it falls short for more complex page editor requirements. Currently, it isn't quite possible to build complete UI components with Craft. Let's take a look at how a typical UI component built in React looks like: ```tsx const posts = [...]; const MyComponent = (props) => { const [counter, setCounter] = useState(0); return ( <div> <h1>Hello World!</h1> { props.enabled && <p>I'm enabled!</p> } { counter > 0 && ( <h2>I'm non-negative!</h2> ) } { posts.map(post => <h2>{post.name}</h2>) } <button onClick={() => { setCounter(counter + 1); }}> Increment </button> </div> ) } ``` A React component is able to do the following:- - Render an HTML ou

Comments (0)

No comments yet. Start the discussion.

Comment on this issue