Make WordPress Core

Opened 14 years ago

Closed 11 years ago

#15783 closed enhancement (fixed)

JavaScript Coding Standards

Reported by: gamajotech's profile GamajoTech Owned by: koopersmith's profile koopersmith
Milestone: WordPress.org Priority: normal
Severity: trivial Version:
Component: WordPress.org Site Keywords:
Focuses: Cc:

Description

Following up on scribu's and azaozz's comments in #15650, would a JavaScript Coding Standards page on the Codex (equivalent to http://codex.wordpress.org/WordPress_Coding_Standards and http://codex.wordpress.org/CSS_Coding_Standards) be useful?

It would not only include the usual code formatting, whitespace, brace position, semi-colon requirements etc, but also clarify on which code patterns are preferable for performance, both for the specific dependency library, and those that will give the smallest file when minified.

Another idea might be to introduce a file docblock that outlines which JS library or other file dependencies the current file has.

Some references:

Change History (14)

#1 follow-up: @nacin
14 years ago

  • Component changed from General to WordPress.org site
  • Milestone changed from Awaiting Review to WordPress.org
  • Owner set to koopersmith
  • Status changed from new to assigned

koopersmith has been putting one together, for the core contributor handbook. He'll release a draft when he's gotten that far.

#2 @scribu
14 years ago

  • Cc scribu added

#3 @GamajoTech
14 years ago

One other useful reference I should have added to the ticket:

Thanks nacin, I'll get in touch with koopersmith.

#4 @ocean90
12 years ago

  • Cc ocean90 added

#5 @DrewAPicture
12 years ago

  • Cc xoodrew@… added

#6 @sc0ttkclark
12 years ago

  • Cc lol@… added

I'd also like to see this in the codex

#7 @beaulebens
12 years ago

  • Cc beau@… added

#8 @husobj
11 years ago

  • Cc ben@… added

#9 in reply to: ↑ 1 ; follow-up: @ocean90
11 years ago

Replying to nacin:

koopersmith has been putting one together, for the core contributor handbook. He'll release a draft when he's gotten that far.

Not sure if it's from koop, but the page exists: http://make.wordpress.org/core/handbook/coding-standards/javascript/

#10 in reply to: ↑ 9 @kpdesign
11 years ago

Replying to ocean90:

Replying to nacin:

koopersmith has been putting one together, for the core contributor handbook. He'll release a draft when he's gotten that far.

Not sure if it's from koop, but the page exists: http://make.wordpress.org/core/handbook/coding-standards/javascript/

The JavaScript Coding Standards were added to the Codex in March 2013 by tommcfarlin, and moved to the Core Contributor Handbook in April 2013. I don't know if he used something from koop to base them on. That part should be considered complete.

Are there any plans to implement the file docblock (list dependencies)?

#11 @kadamwhite
11 years ago

  • Cc kadamwhite added

#12 follow-up: @helen
11 years ago

Does this ticket still need to be open?

#13 in reply to: ↑ 12 @kpdesign
11 years ago

Replying to helen:

Does this ticket still need to be open?

The standard is done, and in the Core Contributor Handbook, which was the original intent of this ticket. We can look at the file docblock portion of the ticket during the 3.7 inline docs effort, and open a new ticket if needed. I think it can be closed.

#14 @DrewAPicture
11 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.