Umbraco-cms: TinyMCE loads non-minified plugins in non-debug mode and vice-versa

Created on 23 Jun 2020  路  8Comments  路  Source: umbraco/Umbraco-CMS

When running Umbraco on a live environment (with debug="false"), I see the following plugin is loaded when TinyMCE/the RTE is initialized in the back-office: /umbraco/lib/tinymce//plugins/autoresize/plugin.js?umb__rnd=7de6bda4e77ab561e3b19a72a59cdb67. This loads the non-minified version of the plugin (5,58 kB).

When running in debug mode, the minified version is loaded (2,03 kB - 63% smaller size), so this logic seems mixed up: /umbraco/lib/tinymce//plugins/autoresize/plugin.min.js?umb__rnd=64f3d65f34f0673f8fc49a60d0d01780.

Umbraco version

I am seeing this issue on Umbraco 8.6.2.

Reproduction

Steps to reproduce

Switch the debug attribute in the web.config and check the loaded plugins in the developers tools network tab.

Expected result

Load the normal version in debug mode and minified ones in live/release builds.

Actual result

TinyMCE loads the minified version in debug mode and normal version on live/release builds.

categorperformance communitpr releas8.8.0 typbug

All 8 comments

Uh oh, yeah that seems to be the wrong way around! We'd love some help with that! 馃憤

Hi @ronaldbarendse,

We're writing to let you know that we would love some help with this issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post

Thanks muchly, from your friendly Umbraco GitHub bot :-)

@ronaldbarendse I've tried flipping the debug setting in web.config but nothing really changes; I still see minified plugins loaded - both for the standard plugins (the TinyMCE config shipped with Umbraco) and for manually added plugins (i.e. autoresize):

image

This is on vLatest though.

I can reproduce with an RTE in the Grid on vLatest! Not when it's not in the grid..

We changed a lot about how tinymce loads assets in https://github.com/umbraco/Umbraco-CMS/pull/6147, i can't recall all of the details but helped @warrenbuckley with the implementation. Just mentioning here as it might be related.

Turns out this is an issue caused by how the JS is bundled by ClientDependency in release mode. The MVC bundler has the same issue.

TinyMCE automatically detects if it should load minified or non-minified plugins/themes etc. based on the dedicated TinyMCE script tag source. Since bundlers make this script tag disappear, TinyMCE performs a fallback to loading non-minified resources.

I've got a fix for it, will submit it tomorrow 馃憤

PR in #8512 ... turns out the issue _does_ affect both normal and grid RTEs.

Was this page helpful?
0 / 5 - 0 ratings