-
Notifications
You must be signed in to change notification settings - Fork 826
[Bug 1139127,1139128,1143941,1143945] Community top contributors #2430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
2df033f
[Bug 1139127] API for top contributors.
mythmon 5f0ebc8
[Bug 1139128] Table UI for top questions contributors.
mythmon ee2eab4
Use bower for fontawesome and react.
mythmon 62d1a0a
Refactor for es6 classes.
mythmon 238634f
Add locale filtering.
mythmon 0e7c84a
Refactor top contributors controller to a class.
mythmon 616d07b
[Bug 1143941] Add Localization metrics top contributor API.
mythmon 2ba291c
[Bug 1143941] Fix l10n api and add UI.
mythmon de8b930
[Bug 1143941] Factor Questions and Localization to be two configurati…
mythmon 41b728b
[Bug 1143945] Date range picker for community top contributors.
mythmon c7c404f
Top Contributors: Add limited sorting
mythmon 55910f2
fixup
mythmon cec2495
Remove wrong STATICFILES_DIRS setting.
mythmon 433d988
Add hashes of new packages to lockdown.json
mythmon 6d91e5d
Remove empty file.
mythmon 62fbdd3
Update docs to talk about new front end practices.
mythmon 2cd7a18
Revert "Remove wrong STATICFILES_DIRS setting."
mythmon 31e6098
Feedback and tests.
mythmon d1a8f14
Add missing tests file.
mythmon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| ======================= | ||
| Frontend Infrastructure | ||
| ======================= | ||
|
|
||
| Frontends assets for Kitsune are managed through `Django Pipeline`_. | ||
|
|
||
| .. _Django Pipeline: https://django-pipeline.readthedocs.org/en/latest/ | ||
|
|
||
|
|
||
| Bundles | ||
| ======= | ||
|
|
||
| To reduce the number of requests per page and increase overall performance, | ||
| JS and CSS resources are grouped into *bundles*. These are defined in | ||
| ``kitsune/bundles.py``, and are loaded into pages with template tags. Each | ||
| bundle provides a list of files which will be compiled (if necessary), minified, | ||
| and concatenated into the final bundle product. | ||
|
|
||
| In development, the minification and concatenation steps are skipped. In | ||
| production, each file is renamed to contain a hash of it's contents in the | ||
| name, and files are rewritten to account for the changed names. This is | ||
| called cache busting, and allows the CDN to be more aggressive in caching these | ||
| resources, and for clients to get updates faster when we make changes. | ||
|
|
||
| Style Sheets | ||
| ============ | ||
|
|
||
| The styles written for Kitsune is written in `Less`_. Libraries, of course, | ||
| have styles written in CSS. These are combined into bundles and shipped as | ||
| minified CSS. | ||
|
|
||
| Less files are recognized by an extension of ``.less``. | ||
|
|
||
| .. _Less: http://lesscss.org/ | ||
|
|
||
| Javascript | ||
| ========== | ||
|
|
||
| There are a few kinds of Javascript in use in Kitsune. | ||
|
|
||
| Plain JS | ||
| -------- | ||
|
|
||
| Plain JS is not suspect to any compilation step, and is only minified and | ||
| concatenated. Plain JS files should be written to conform to ES3 standards, for | ||
| compatibility. | ||
|
|
||
| Plain JS files have an extension of ``.js``. | ||
|
|
||
| ES6 JavaScript | ||
| -------------- | ||
|
|
||
| EcmaScript 6 is the next version JavaScript that has been recently | ||
| standardized. Because it is very new, it does not have wide spread browser | ||
| support yet, and so it is compiled using `Babel`_ to ES5. Because it is | ||
| compiled to ES5, and not ES3, it is not suitable for use in user facing parts | ||
| of the site, which require maximum compatibility. | ||
|
|
||
| These files are recognized by the ES6 compiler by an extension of ``.es6``, and | ||
| *should* end in ``.js.es6`` for clarity. However, see the note about Browserify | ||
| below. | ||
|
|
||
| For more information about ES6 syntax and features, see | ||
| `lukehoban/es6featurse`_. | ||
|
|
||
| .. _Babel: https://babeljs.io/ | ||
| .. _es6: https://github.com/lukehoban/es6features | ||
|
|
||
| JSX | ||
| --- | ||
|
|
||
| JSX is a syntax extension on top of ES6 (and in some places, ES7) which adds | ||
| support for an XML-like trees. It is used in Kitsune as a way to specify DOM | ||
| elements in React Component render methods. JSX is compiled using Babel as | ||
| well, and in fact all ES6 files may contain JSX syntax, since Babel compiles | ||
| it by default. | ||
|
|
||
| These files don't have a specific individual extension, but use the ``.es6`` | ||
| extension. For clarity, standalone jsx files should use the extension of | ||
| ``.jsx.es6``. | ||
|
|
||
| Browserify | ||
| ---------- | ||
|
|
||
| Files with the extension ``.browserify.js`` are treated as Browserify entry | ||
| points. They may include other JS files using `ES6 modules syntax`_. The files | ||
| included in this way may also make use of the ES6 module system, regardless of | ||
| their extension. | ||
|
|
||
| All files loaded this way are treated as ES6+JSX files. This is generally the | ||
| only way ES6 and JSX code should be included in a bundle, and so in practice | ||
| the extensions assigned to those files don't matter to Django Pipeline, and | ||
| should be named to be clear to the reader. | ||
|
|
||
| Browserify has been configured with the babelify and bowerify transformers, to | ||
| be able to load ES6 files and files from Bower. | ||
|
|
||
| .. _ES6 modules syntax: https://github.com/lukehoban/es6features#modules | ||
|
|
||
|
|
||
| Bower | ||
| ===== | ||
|
|
||
| Frontend dependencies are downloaded using Bower. In a bundle file, they are | ||
| listed as ``package-name/path/in/package.js``. Django Pipeline will find the | ||
| correct Bower package to pull files from. | ||
|
|
||
| Bower is not normally compatible with Browserify. A Browserify transformer | ||
| called bowerify makes an include request for Bower packages load the primary | ||
| entry point of the Bower package to make them compatible. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding this. i totally dropped the ball on adding bower docs!