Issue #2282✓ SolvedOpened September 20, 2019by pouyamiralayi6 reactions

Replace the current View for the core editor UI components

快速解答by artf5

Yes @lexoyo the final goal here would be to stop relying on Backbone's View and migrate all editor UI elements to web components. In the end, there will be @grapesjs/core (no UI) and @grapesjs/core-ui with a set of reusable and extendable web components for the editor UI

Read full answer below ↓

Question

Hi there! the currently used structure of grapesjs is based on leveraging backbonejs model-view concept for implementing the Virtual Dom inside the ecosystem of grapesjs. Virtual Dom is a great practice which has a vast area of applications and benefits; but the downside of virtual dom is the actual gap between virtual and actual dom itself, what this means is that the usage of virtual dom is some sort of performance sacrifice in order to achieve the model-view concept which is the already established architecture of grapesjs, react, vue & etc. based on the real-time nature of grapesjs and its ability to manage thousands of model objects based on each user interaction, there are cases that performance is poorly appreciated on model updates that as it's result there would be no real-time experience for the end user. as an example of this scenario think about calling addAttributes for property changes on a complex component type that will be invoked every time the end user provides us with new inputs in the associated trait section; each time that user presses a key, there would be a noticeable delay for the model to updates the attributes of the target component according to the user input. my proposal on this matter is to get rid of virtual dom in the sack of hyperhtml that benefits from actual dom that are bounded to a context object that acts as our current model. the way hyperhtml is achieving the model-view concept for actual dom is leveraging js native template literals and it's associated chunks and interpolations. i know this is a very scary taboo for the current implementation :) but i think if grapesjs architecture has been started up with backbone, the sub parts of the ecosystem should not follow the same lead although this is a common implication in the development path of a complex project like grapesjs; backbone can be really tempting to push developers mind to go with it until the end, but i am suggesting more flexibility by separating grapesjs into a solid core with backbone and all the other parts leveraging hyperhtml to introduce a more lightweight, performance friendly ecosystem that embraces the future with no fear of performance breakdowns. i am a very naive developer and please forgive me if i am going wrong with this. hyperhtml cheers.

Answers (3)

👍 Most helpfulartfDecember 7, 2023

Yes @lexoyo the final goal here would be to stop relying on Backbone's View and migrate all editor UI elements to web components. In the end, there will be @grapesjs/core (no UI) and @grapesjs/core-ui with a set of reusable and extendable web components for the editor UI

lexoyoDecember 7, 2023

Ok that's interesting :) I can't wait to see that and i will contribute as much as i can

lexoyoNovember 30, 2023

Nice idea I use lit-html quite lot, it's the same approach but also adds web components when/if needed But i don't get where would backbone stop? And what would be without it. I guess it is a question that is broader about what @artf announced in the roadmap (taking things out of the core)

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.