[Enhancement] Possible configuration bloat
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 #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 #3832
BUG: 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 #986
[BUG]: Exported CSS cannot override body's background-color
When a body background style is defined in the style option of the init function it's not possible to override. Given the style: After chan...
Issue #1577
Inline CSS Comments break Code Manager
Apparently this is valid piece of html and css: <div style="color: red; / height 200px; /; font-weight: bold;"> (Hence the commented out he...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.