Task #10086

Story #10367: As Roger, I want to have Guidelines for JavaScript and CSS Programming

Create a JavaScript CGL for Phoenix

Added by Sebastian Kurfuerst almost 5 years ago. Updated almost 3 years ago.

Status:Resolved Start date:2010-10-06
Priority:Should have Due date:
Assigned To:Sebastian Kurfuerst % Done:

80%

Category:-
Target version:- Estimated time:0.00 hour

Description

Create a JavaScript CGL for Phoenix

js-cgl-export-v2.pdf (167.5 kB) Sebastian Kurfuerst, 2010-10-27 07:37


Related issues

precedes TYPO3.Neos - Task #10369: Add API Documentation to JavaScript files, and format the... Resolved 2010-10-07 2010-10-07

History

#2 Updated by Karsten Dambekalns almost 5 years ago

  • Target version set to 707

#3 Updated by Sebastian Kurfuerst almost 5 years ago

Nils and I will do that.

#4 Updated by Sebastian Kurfuerst almost 5 years ago

  • % Done changed from 0 to 20

#5 Updated by Karsten Dambekalns almost 5 years ago

  • Category set to Documentation
  • Status changed from New to Accepted
  • Assigned To set to Sebastian Kurfuerst

#6 Updated by Sebastian Kurfuerst almost 5 years ago

  • Target version changed from 707 to 711

#7 Updated by Sebastian Kurfuerst almost 5 years ago

  • Parent task set to #8797

#8 Updated by Sebastian Kurfuerst almost 5 years ago

  • Parent task changed from #8797 to #10367

#9 Updated by Rens Admiraal almost 5 years ago

Draft CGL looks good, a few comments:

- The @private annotation is used in the example class, but should be stated clearly in the CGL
- I think we agreed to use _methodName for private methods, this should also be added

#10 Updated by Sebastian Kurfuerst almost 5 years ago

  • File js-cgl-export.pdf added

added a file with the current JS CGL version

#11 Updated by Nils Dehl almost 5 years ago

Sebastian Kurfuerst wrote:

added a file with the current JS CGL version

wow looks good so far,

for array/ object code formating we can use
http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml#Code_formatting
as discussion base

#12 Updated by Sebastian Kurfuerst almost 5 years ago

attached is version 2, after discussion yesterday.

#13 Updated by Sebastian Kurfuerst almost 5 years ago

  • File deleted (js-cgl-export.pdf)

#14 Updated by Nils Dehl almost 5 years ago

TODO: find out how to make cross-references

{@link #methodOne This is a example link to method one}

how to nicely format multiline-text inside doc comments

to have a nice multiline output in the rendert api you have to format the code with <br />, <pre> ..

 * <br/>
 * Description of the class. Make it as long as needed,
 * feel free to explain how to use it.
 * This is a sample class <br/>
 * The file encoding should be utf-8 <br/>
 * UTF-8 Check: öäüß <br/>
 * {@link #methodOne This is a example link to method one} <br/>

a single var statement

i also prefer version 1

#15 Updated by Nils Dehl almost 5 years ago

7 ExtJS specific things

extendig a store example:

F3.TYPO3.Content.DummyStore = Ext.extend(Ext.data.Store, {

    constructor: function(cfg) {
        cfg = cfg || {};
        var config = Ext.apply(
            {
                autoLoad: true
            },
            cfg
        );

        F3.TYPO3.Content.DummyStore.superclass.constructor.call(
            this,
            config
        );
    }
});
Ext.reg('F3.TYPO3.Content.DummyStore', F3.TYPO3.Content.DummyStore);

#16 Updated by Christian Müller almost 5 years ago

I had a look and didn't find something to add right now. Looks already quite good. I would have something like an Appendix and put the JSlint explanation there as it has nothing to do with code style but more with testing the code style...
I will think about chapter 7 (ExtJS) I think there is more to that.

#17 Updated by Sebastian Kurfuerst almost 5 years ago

Hey,

I was thinking about @return {void} -- should we require this? I think it adds not really any value, so why add that to methods and clutter the code with it?

Greets,
Sebastian

#18 Updated by Karsten Dambekalns almost 5 years ago

Sebastian Kurfuerst wrote:

I was thinking about @return {void} -- should we require this? I think it adds not really any value, so why add that to methods and clutter the code with it?

For the same reason we use it in the PHP code: if it's there you can be sure it has not simply been forgotten. It tells about the intention.

#19 Updated by Fabien Udriot almost 5 years ago

It would make sense for me to have return {void} documented since it gives additional information in the method's description particularly if the method becomes a bit longer... Also, I can imagine this may be useful when reading JSDoc.

#20 Updated by Sebastian Kurfuerst almost 5 years ago

ok, I updated the CGLs, now stating that @return {void} is required if there is no return value.

#21 Updated by Sebastian Kurfuerst over 4 years ago

The tool https://github.com/kassens/javascript-formatter looks quite promising -- It is not fully done yet and I am not fully sure if it covers all cases -- but to me it makes perfect sense to do it this way :)

#22 Updated by Sebastian Kurfuerst over 4 years ago

  • Status changed from Accepted to New

#23 Updated by Robert Lemke over 4 years ago

  • Status changed from New to Needs Feedback

#24 Updated by Robert Lemke over 4 years ago

  • Status changed from Needs Feedback to Resolved
  • Estimated time set to 0.00
  • Remaining (hours) set to 0.0

#25 Updated by Robert Lemke almost 3 years ago

  • Project changed from Base Distribution to TYPO3.Neos

Also available in: Atom PDF