[wp-meta] [Making WordPress.org] #6723: Require source and map files for JS
Making WordPress.org
noreply at wordpress.org
Wed Feb 1 10:51:48 UTC 2023
#6723: Require source and map files for JS
------------------------------+---------------------
Reporter: kkmuffme | Owner: (none)
Type: enhancement | Status: new
Priority: low | Milestone:
Component: Plugin Directory | Resolution:
Keywords: |
------------------------------+---------------------
Comment (by kkmuffme):
If the developer knows how to minify their JS, they will certainly know
how to include the .map in their build process (if your plugin only
contains unminified JS, you don't need a map anyway)
Atm it's even missing in WP core in a few cases, but there's a discussion
to fix this with the next release.
>Do you have any suggestions on how best to handle this for existing
themes and plugins (as there are thousands)?
I am not too familiar with the plugin directory, but I assume this
shouldn't be too hard to do as a first step: automatically find all
plugins that contain a .min.js but no .map and .js with same name, send
message/email to the plugin author that this will be required going
forward (or: just give an error when a new plugin version is added, that
is missing either file?)
--
For future automation of this, in addition to the above check, one could
simply remove all code comments from the JS file and if the remaining code
of the file is less than e.g. 5 lines, one can be pretty certain that this
is minified JS (even when it doesn't have a .min.js in name), to avoid
things being missed (e.g. when the .js is generated from
.coffee/.ts/whatever)
--
Ticket URL: <https://meta.trac.wordpress.org/ticket/6723#comment:4>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org
More information about the wp-meta
mailing list