Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#44361 closed defect (bug) (fixed)

Add output tags to all JavaScript source files

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

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 6 years ago.
output-tags-1.patch (45.7 KB) - added by omarreiss 6 years ago.
Fixed 1 typo
output-tags-2.patch (34.8 KB) - added by omarreiss 6 years ago.
Had to rebase…
output-tags-3.patch (35.2 KB) - added by omarreiss 6 years ago.
Makes sure single line comments become multiline

Download all attachments as: .zip

Change History (8)

@omarreiss
6 years ago

Fixed 1 typo

@omarreiss
6 years ago

Had to rebase...

@omarreiss
6 years ago

Makes sure single line comments become multiline

#1 @atimmer
6 years 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
6 years ago

  • Milestone changed from Awaiting Review to 5.0

#3 @johnbillion
6 years ago

  • Milestone changed from 5.0 to 5.1

#4 @johndat123
5 years ago

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