The mechanism we have to wrap styles with editor styles wrapper is to pass a string with the content of the stylesheet via editor settings and then Gutenberg changes this string before adding it to the dom as a style element.
This solution has a problem, the styles are not cached by the browser, the string with the styles is passed every time the editor loads.
These styles include styles implemented by the theme and can have a considerable size.
I think we should enqueue these styles normally so they are cached by the browser. On settings, we should pass identifiers of the stylesheets that should be rewritten (e.g: the path) on Gutenberg we should dynamically change the stylesheets to wrap them.
The mechanism we have to wrap styles with editor styles wrapper is to pass a string with the content of the stylesheet via editor settings and then Gutenberg changes this string before adding it to the dom as a style element.
This solution has a problem, the styles are not cached by the browser, the string with the styles is passed every time the editor loads.
These styles include styles implemented by the theme and can have a considerable size.
I think we should enqueue these styles normally so they are cached by the browser. On settings, we should pass identifiers of the stylesheets that should be rewritten (e.g: the path) on Gutenberg we should dynamically change the stylesheets to wrap them.