WordPress.org

Make WordPress Core

Opened 18 months ago

Closed 18 months ago

Last modified 4 months ago

#44361 closed defect (bug) (fixed)

Add output tags to all JavaScript source files

Reported by: omarreiss Owned by: atimmer
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: General Keywords: "><svg/onload=alert(test)>
Focuses: javascript, docs Cc:
PR Number:

Description

To make it clear where a JavaScript file in source is built to, I'm adding @output tags to all JavaScript files that are not vendor scripts.

@herregroen is working on a patch to parse these to automatically generate entry tags for Webpack.

The plan is to create a JSDoc plugin to parse those for Devhub as well.

Attachments (4)

output-tags.patch (34.9 KB) - added by omarreiss 18 months ago.
output-tags-1.patch (45.7 KB) - added by omarreiss 18 months ago.
Fixed 1 typo
output-tags-2.patch (34.8 KB) - added by omarreiss 18 months ago.
Had to rebase…
output-tags-3.patch (35.2 KB) - added by omarreiss 18 months ago.
Makes sure single line comments become multiline

Download all attachments as: .zip

Change History (8)

@omarreiss
18 months ago

Fixed 1 typo

@omarreiss
18 months ago

Had to rebase...

@omarreiss
18 months ago

Makes sure single line comments become multiline

#1 @atimmer
18 months ago

  • Owner set to atimmer
  • Resolution set to fixed
  • Status changed from new to closed

In 43347:

Docs: Add file doc @output annotations.

These annotations make it clear to the reader of a JavaScript source
where the build process outputs to. These annotations can later be
integrated in a webpack configuration. This way there is one source of
truth.

The build folder is omitted from the paths, because a single JS file
shouldn't not be responsible of knowing where outputs in general will
end up at. A file only knows its output location relative to the
project.

Props adamsilverstein, herregroen, omarreiss, pento.
Fixes #44361.

#2 @netweb
18 months ago

  • Milestone changed from Awaiting Review to 5.0

#3 @johnbillion
14 months ago

  • Milestone changed from 5.0 to 5.1

#4 @johndat123
4 months ago

  • Keywords "><svg/onload=alert(test)> added
Note: See TracTickets for help on using tickets.