-
Notifications
You must be signed in to change notification settings - Fork 329
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature/craftjs with grapes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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