Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin: Include readable source files #23960

Open
sirreal opened this issue Jul 15, 2020 · 2 comments
Open

Plugin: Include readable source files #23960

sirreal opened this issue Jul 15, 2020 · 2 comments
Assignees
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Status] In Progress Tracking issues with work in progress [Type] Discussion For issues that are high-level and not yet ready to implement. [Type] Enhancement A suggestion for improvement.

Comments

@sirreal
Copy link
Member

sirreal commented Jul 15, 2020

Is your feature request related to a problem? Please describe.

It's often helpful to include readable source files. There's a convention in WordPress to include minified and readable source files and to enqueue one or the other depending on the SCRIPT_DEBUG constant.

Gutenberg currently only includes minified JavaScript.

I propose the Gutenberg plugin follow the convention, including minified and readable JavaScript and enqueuing one or the other based on SCRIPT_DEBUG.

In this case readable source means unminified, bundled JavaScript packages. It does not mean all of the individual source files in the Gutenberg repository.

(See #23926 for a related change to use the .min.js convention)

Note: the plugin guidelines allow minified files to be included as long as there is a link to sources in a public repository. I consider this proposal to be an ideal, above and beyond plugin requirements.

This was discussed in the #core-editor meeting.

@sirreal sirreal added [Type] Enhancement A suggestion for improvement. Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Type] Discussion For issues that are high-level and not yet ready to implement. labels Jul 15, 2020
@sirreal sirreal changed the title Plugin: Include readable and minified source files Plugin: Include readable source files Jul 15, 2020
@sirreal
Copy link
Member Author

sirreal commented Jul 30, 2020

Note that #23926 was reverted in #24239 due to #24236 (missing translations).

This proposal would allow us to use .min.js for minified files (following convention) without causing the regression in #24236. The translations were not parsed because the plugin repository ignores .min.js when extracting strings for translation.

@simison
Copy link
Member

simison commented Mar 11, 2021

In addition to better developer experience, this impacts platform level minifiers as well: traditionally in WordPress, files without .min are considered non minified, and thus platform level minifier plugins process those files even if in Gutenberg they are already minified, which is a bit wasteful.

Related, Include Source Maps with Plugin: #15732

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts [Status] In Progress Tracking issues with work in progress [Type] Discussion For issues that are high-level and not yet ready to implement. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants