Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Grapes with Craft.js #62

Merged
merged 217 commits into from Feb 4, 2023
Merged

Replace Grapes with Craft.js #62

merged 217 commits into from Feb 4, 2023

Conversation

LiveDuo
Copy link
Owner

@LiveDuo LiveDuo commented Dec 17, 2022

Overview

This PR replaces Grapes.js with Craft.js as briefly discussed in #22 . With this merge we expect to enabled a Destack specific editor with custom UI/UX and easier debugging for issues (due to the use of react for the editor too and typescript support).

Beta Testing

There a new starter project on destack-starter-beta for people willing to beta test the new version and Craft.js.

The New Editor

Screen.Recording.2022-11-11.at.5.19.51.PM.3.mov

Tradeoffs

Although we get a custom editor with better debugging there's a significant change in the architecture. That's because Grapes.js stores the pages in HTML form and Craft.js stores them in a custom serialised object and then renders them to HTML.

In short, there's no CSS styling for components by default and there's should be implemented from scratch. I think for now that's ok because the main focus of the editor is to use ready-made components (and just change the text, picture, links and buttons). In the tradeoff between simplicity and customisability Destack aims to be as simple first and then bring as many customisability features as possible.

As the new editor is made with React.js, is been transpiled the first time Destack is loaded in a new project. This transpilation adds around 5 seconds the first time Destack is loaded in development. There are ways to pre-transpile Destack and avoid the extra lag. I think for now is acceptable but it's something that needs to be figured out in the future.

Moving forward

  • Wait a few days/weeks for people to test out the released beta version
  • Fix e2e tests are not yet compatible with Craft.js (added support for Playwright)
  • Pre-transpile Destack to avoid the ~5 seconds lag for new projects (enabled Tailwind JIT and more tree-shaking)

@LiveDuo LiveDuo merged commit 23d50a5 into main Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants