Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Creates Frontend Style guide | Filipa Lacerda | 2017-03-22 | 1 | -509/+2 |
| | |||||
* | Updates realtime documentation for the Frontend | Filipa Lacerda | 2017-03-17 | 1 | -7/+14 |
| | |||||
* | Fix spelling and grammatical errors.realtime-methods-docs | Jacob Schatz | 2017-03-16 | 1 | -1/+1 |
| | |||||
* | Add Server issues 429 Too Many Requests disable polling. | Jacob Schatz | 2017-03-16 | 1 | -1/+2 |
| | |||||
* | Fix up suggestions on content changes. | Jacob Schatz | 2017-03-16 | 1 | -2/+2 |
| | |||||
* | Add docs for realtime polling for the frontend. | Jacob Schatz | 2017-03-16 | 1 | -0/+14 |
| | |||||
* | Fix bad code example29326-update-documentation | Filipa Lacerda | 2017-03-13 | 1 | -2/+2 |
| | |||||
* | Fix code examples and add code highligth | Filipa Lacerda | 2017-03-10 | 1 | -5/+4 |
| | |||||
* | Adds best practices regarding context and vue to documentation | Filipa Lacerda | 2017-03-10 | 1 | -1/+32 |
| | |||||
* | Adds information about architecture step. | Filipa Lacerda | 2017-03-10 | 1 | -2/+20 |
| | |||||
* | Add newline to end of frontend.md.patch-14 | Bryce Johnson | 2017-02-28 | 1 | -1/+1 |
| | |||||
* | Document use of AirBnb js styleguide and eslint. | Bryce Johnson | 2017-02-28 | 1 | -0/+5 |
| | |||||
* | Merge branch 'replace-teaspoon-references' into 'master' | Clement Ho | 2017-02-10 | 1 | -12/+6 |
|\ | | | | | | | | | | | | | Replace teaspoon references with Karma Closes gitlab-com/gitlab-docs#68 See merge request !9011 | ||||
| * | Replace teaspoon references with Karmareplace-teaspoon-references | Clement Ho | 2017-02-10 | 1 | -12/+6 |
| | | |||||
* | | moved hyperlink reference section at the end of the content | Nur Rony | 2017-02-10 | 1 | -41/+43 |
| | | |||||
* | | fixes frontend doc broken link | Nur Rony | 2017-02-10 | 1 | -1/+1 |
|/ | |||||
* | First draft of "how to use vue.js in gitlab" documentation | Filipa Lacerda | 2017-01-30 | 1 | -18/+88 |
| | | | | | | | | | | | | Puts back trailing whitespace Changes after review Changes after review Adds Changelog entry Follow documentation styleguide | ||||
* | Fix markdown errors.patch-9 | Bryce Johnson | 2016-12-21 | 1 | -2/+2 |
| | |||||
* | Add documentation for possible causes of JS-related test failures. | Bryce Johnson | 2016-12-21 | 1 | -10/+68 |
| | |||||
* | Merge branch 'google-singletons-are' into 'master' | Jacob Schatz | 2016-11-17 | 1 | -0/+51 |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Decide on and document a convention for singletons > The singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. The simplest implementation uses an object literal to contain the logic. ```javascript gl.MyThing = { prop1: 'hello', method1: () => {} }; ``` A live example of this is [GfmAutoComplete](https://gitlab.com/gitlab-org/gitlab-ce/blob/172aab108b875e8dc9a5f1d3c2d53018eff76ea1/app/assets/javascripts/gfm_auto_complete.js.es6) Another approach makes use of ES6 `class` syntax. ```javascript let singleton; class MyThing { constructor() { if (!singleton) { singleton = this; singleton.init(); } return singleton; } init() { this.prop1 = 'hello'; } method1() {} } gl.MyThing = MyThing; ``` A live example of this is [Sidebar](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/assets/javascripts/sidebar.js.es6) Another functional approach to define Singleton using `Javascript Revealing Module Pattern` is like below ```javascript /** * 1. It instantiates only a single object * 2. It is safe – it keeps the reference to the singleton inside a variable, which lives inside a lexical closure, so it is not accessible by the outside world * 3. It allows privacy – you can define all private methods of your singleton inside the lexical closure of the first module pattern * 4. No this keyword trap (no wrong context referring) * 5. No use of new keyword * 6. Easy to write test code */ // const Singleton = (function () { // Instance stores a reference to the Singleton var instance; function init() { // Singleton // Private methods and variables function privateMethod(){ console.log( "I am private" ); } var privateVariable = "Im also private"; var privateRandomNumber = Math.random(); return { // Public methods and variables publicMethod: function () { console.log( "The public can see me!" ); }, publicProperty: "I am also public", getRandomNumber: function() { return privateRandomNumber; } }; }; return { // Get the Singleton instance if one exists // or create one if it doesn't getInstance: function () { if ( !instance ) { instance = init(); } return instance; } }; })(); const singletonObj = Singleton.getInstance() ``` ## Are there points in the code the reviewer needs to double check? ## What does this MR do? Creates a space for discussion and contribution for interested devs. ## Why was this MR needed? ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] All builds are passing (http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? See merge request !6620 | ||||
| * | Fix spacing in code sample.google-singletons-are | Bryce Johnson | 2016-11-01 | 1 | -3/+5 |
| | | |||||
| * | Document convention for singleton use in front-end code. | Bryce Johnson | 2016-10-31 | 1 | -0/+49 |
| | | |||||
* | | Fix broken link to observatory cli on Frontend Dev Guide | Sam Rose | 2016-11-06 | 1 | -1/+1 |
| | | |||||
* | | Add tip for using Chrome to run and debug teaspoon tests. | Bryce Johnson | 2016-11-03 | 1 | -0/+6 |
| | | |||||
* | | Merge branch 'patch-8' into 'master' | Fatih Acet | 2016-10-31 | 1 | -3/+8 |
|\ \ | |/ |/| | | | | | | | | | | | | | Add ES array methods as cause of Phantom.js errors. ## What does this MR do? Adds another example of something that causes a common error in JavaScript testing to the frontend dev docs. See merge request !7102 | ||||
| * | Add ES array methods as cause of Phantom.js errors. | Bryce Johnson | 2016-10-26 | 1 | -3/+8 |
| | | |||||
* | | Document how to run frontend tests | Winnie | 2016-10-28 | 1 | -0/+14 |
|/ | |||||
* | Document Capybara errors from es6 in es5 file.es6-es5-poltergeist | Bryce Johnson | 2016-10-12 | 1 | -0/+11 |
| | |||||
* | Update Frontend Docs based on feedback.cs-frontend-guidelines | Connor Shea | 2016-09-21 | 1 | -18/+18 |
| | |||||
* | Add a section on vue and one on supported browsers. | Connor Shea | 2016-09-21 | 1 | -0/+14 |
| | |||||
* | Add Overview section detailing our frontend stack. [ci skip] | Connor Shea | 2016-09-21 | 1 | -5/+44 |
| | |||||
* | Add short Testing section, minor fixes. | Connor Shea | 2016-09-21 | 1 | -1/+7 |
| | |||||
* | Add CSP and SRI information [ci skip] | Connor Shea | 2016-09-21 | 1 | -3/+71 |
| | |||||
* | Further revisions/additions [ci skip] | Connor Shea | 2016-09-21 | 1 | -6/+17 |
| | |||||
* | Add more information on page-specific JS. | Connor Shea | 2016-09-21 | 1 | -19/+45 |
| | | | | [ci skip] | ||||
* | Initial incomplete draft of the Frontend Development Guidelines. | Connor Shea | 2016-09-21 | 1 | -0/+61 |
[ci skip] |