Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
ae47afb9
Commit
ae47afb9
authored
Mar 12, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add section for universal code
parent
ab8ad58e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
doc/development/fe_guide/performance.md
doc/development/fe_guide/performance.md
+9
-5
No files found.
doc/development/fe_guide/performance.md
View file @
ae47afb9
...
@@ -47,6 +47,15 @@ properties once, and handle the actual animation with transforms.
...
@@ -47,6 +47,15 @@ properties once, and handle the actual animation with transforms.
## Reducing Asset Footprint
## Reducing Asset Footprint
### Universal code
Code that is contained within
`main.js`
and
`commons/index.js`
are loaded and
run on _all_ pages.
**DO NOT ADD**
anything to these files unless it is truly
needed _everywhere_. This includes ubiquitous libraries like
`vue`
,
`axios`
,
and
`jQuery`
, as well as code for the main navigation and sidebar. Where
possible we should aim to remove modules from these bundles to reduce our code
footprint.
### Page-specific JavaScript
### Page-specific JavaScript
Webpack has been configured to automatically generate entry point bundles based
Webpack has been configured to automatically generate entry point bundles based
...
@@ -75,11 +84,6 @@ In addition to these page-specific bundles, the code within `main.js` and
...
@@ -75,11 +84,6 @@ In addition to these page-specific bundles, the code within `main.js` and
can find this out by checking
`document.body.dataset.page`
while on any page
can find this out by checking
`document.body.dataset.page`
while on any page
within gitlab.com.
within gitlab.com.
-
Since
`main.js`
and
`commons/index.js`
are imported on all pages, it is
important to not add anything to these bundles unless it is truly needed
_everywhere_. This includes ubiquitous libraries like
`vue`
,
`axios`
, and
`jQuery`
, as well as code for the main navigation and sidebar.
-
Page-specific javascript entry points should be as lite as possible. These
-
Page-specific javascript entry points should be as lite as possible. These
files are exempt from tests, and should be used primarily for instantiation
files are exempt from tests, and should be used primarily for instantiation
and dependency injection of classes and methods that live in modules outside
and dependency injection of classes and methods that live in modules outside
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment