Possible configuration bloat
Consider using avoidDefaults flag, it reduces config footprint by removing these default values: https://github.com/artf/grapesjs/blob/c1fb490a73adefb0fa073f37bef4e6178d9321a8/src/editor/config/config.js#L131
Read full answer below ↓Question
We had an issue with Grapes metadata (Components, Style, etc.) growing to the point it was causing issues on our end. After inspecting we noticed that the HTML/CSS grapes was outputting was less than 5k, but the Components/Style objects were storing at ~190k.
After looking into the components, I noticed most of the data is keys with empty/default values ("", [], 0, etc.). Would it be worth leaving these values out to save space, and changing the logic within grapes to assume undefined attributes represent empty/default values?
Answers (2)
Consider using avoidDefaults flag, it reduces config footprint by removing these default values:
https://github.com/artf/grapesjs/blob/c1fb490a73adefb0fa073f37bef4e6178d9321a8/src/editor/config/config.js#L131
Consider using avoidDefaults flag, it reduces config footprint by removing these default values
Correct
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3832
The css classes are removed and the autogenerated ids for each html tags gets changed ( Example : ivj5m-2) after each reload
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link Not there De...
Issue #1079
Improper Bg Repeat CSS Being Set
When importing components and initializing grapesjs, the css background-repeat property is being changed to background-repeat-x and backgro...
Issue #3244
grapes js version v0.16.34 giving unexpected script code after loading saved html
attaching code: while saving the html: <div class="gjs-row"> <div class="gjs-cell"> <div class="gjs-row"> <div class="gjs-cell"> <div id="i...
Issue #3139
FEAT: Disable <table> being auto amended during save
I'm getting an issue, when saving a custom HTML component (just a table), grapes JS will modify it. before save after save. So I want to be...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins →Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.
Browse premium plugins →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.