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

Javascript Bundles #1980

Closed
wants to merge 10 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@stefwalter
Contributor

stefwalter commented Mar 21, 2015

Create javascript bundles that combine multiple AMD modules into a single file for quick loading.

@stefwalter stefwalter added needswork and removed needswork labels Mar 21, 2015

@stefwalter stefwalter changed the title from WIP: Javascript Bundles to Javascript Bundles Mar 23, 2015

@mvollmer mvollmer self-assigned this Mar 24, 2015

Show outdated Hide outdated tools/Makefile-tools.am Outdated

stefwalter added a commit to stefwalter/cockpit that referenced this pull request Mar 24, 2015

systemd: Make a systemd bundle
Move code out of the HTML files into the javascript bundle as well.

Closes cockpit-project#1980
@stefwalter

This comment has been minimized.

Show comment
Hide comment
@stefwalter

stefwalter Mar 24, 2015

Contributor

Fixed whitespace, rebased.

Contributor

stefwalter commented Mar 24, 2015

Fixed whitespace, rebased.

stefwalter added a commit to stefwalter/cockpit that referenced this pull request Mar 24, 2015

systemd: Make a systemd bundle
Move code out of the HTML files into the javascript bundle as well.

Closes cockpit-project#1980
@mvollmer

This comment has been minimized.

Show comment
Hide comment
@mvollmer

mvollmer Mar 24, 2015

Member

The check-menu failure is genuine. If anything goes wrong with dropdowns, it usually means that bootstrap is loaded twice. Maybe that is the case?

Member

mvollmer commented Mar 24, 2015

The check-menu failure is genuine. If anything goes wrong with dropdowns, it usually means that bootstrap is loaded twice. Maybe that is the case?

@mvollmer mvollmer added the needswork label Mar 24, 2015

@mvollmer

This comment has been minimized.

Show comment
Hide comment
@mvollmer

mvollmer Mar 24, 2015

Member

When loading the dashboard (which I think avoids loading the "shell" component), I get this:

GET https://f22:9090/#/dashboard/list [HTTP/1.1 200 OK 20ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/cockpit.css [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/shell/shell.css [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/bundle.js [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/shell/bundle.js [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/patternfly.css [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/legacy/cockpit.css [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/branding.css [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/legacy/patternfly.css [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/shell/images/server-small.png [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/static/brand.png [HTTP/1.1 200 OK 42ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/jquery.js [HTTP/1.1 304 Not Modified 2ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/cockpit.js [HTTP/1.1 304 Not Modified 2ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/manifests.js [HTTP/1.1 304 Not Modified 2ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/po.en.js [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/socket

Thus, both base1/bundle.js and base1/jquery.js are loaded (but I am not sure whether they are loaded into the same iframe).

Member

mvollmer commented Mar 24, 2015

When loading the dashboard (which I think avoids loading the "shell" component), I get this:

GET https://f22:9090/#/dashboard/list [HTTP/1.1 200 OK 20ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/cockpit.css [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/shell/shell.css [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/bundle.js [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/shell/bundle.js [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/patternfly.css [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/legacy/cockpit.css [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/branding.css [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/legacy/patternfly.css [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/shell/images/server-small.png [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/cockpit/static/brand.png [HTTP/1.1 200 OK 42ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/jquery.js [HTTP/1.1 304 Not Modified 2ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/cockpit.js [HTTP/1.1 304 Not Modified 2ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/manifests.js [HTTP/1.1 304 Not Modified 2ms]
GET https://f22:9090/cockpit/$a2d150c685f4eb5d3382b34515b3a3882f263270/base1/po.en.js [HTTP/1.1 304 Not Modified 1ms]
GET https://f22:9090/socket

Thus, both base1/bundle.js and base1/jquery.js are loaded (but I am not sure whether they are loaded into the same iframe).

@mvollmer mvollmer removed their assignment Mar 24, 2015

@stefwalter

This comment has been minimized.

Show comment
Hide comment
@stefwalter

stefwalter Mar 24, 2015

Contributor

The check-menu failure is genuine. If anything goes wrong with dropdowns, it usually means that bootstrap is loaded twice. Maybe that is the case?

I'll take a look at this in a minute.

Contributor

stefwalter commented Mar 24, 2015

The check-menu failure is genuine. If anything goes wrong with dropdowns, it usually means that bootstrap is loaded twice. Maybe that is the case?

I'll take a look at this in a minute.

stefwalter added a commit to stefwalter/cockpit that referenced this pull request Mar 24, 2015

systemd: Make a systemd bundle
Move code out of the HTML files into the javascript bundle as well.

Closes cockpit-project#1980

@stefwalter stefwalter removed the needswork label Mar 24, 2015

stefwalter added some commits Mar 21, 2015

tools: Implement tool which bundles javascript files
Besides just merging them, this gives javascript files the right
identifier.
base1: Create a bundle for base javascript
This has require.js first in the minified bundle, and commonly loaded
modules after that.

This bundle is unlike javascript bundles for other packages:
 * The debug bundle has require.js rather than just being empty.
 * We distribute both the individual minified javascript files and
   the bundle, since these files are API.
 * requirejs must come first in the bundle
shell: Add a bundle including the index page
More stuff will go into this bundle. The shell code won't go
in here as it would otherwise just run on every page that loads
this bundle.
systemd: Make a systemd bundle
Move code out of the HTML files into the javascript bundle as well.

Closes #1980
@stefwalter

This comment has been minimized.

Show comment
Hide comment
@stefwalter

stefwalter Mar 24, 2015

Contributor

Fixed CI issue. It was because requirejs wasn't first in the base1 bundle. I broke this during cleanup of the patches.

Rebased as well.

Contributor

stefwalter commented Mar 24, 2015

Fixed CI issue. It was because requirejs wasn't first in the base1 bundle. I broke this during cleanup of the patches.

Rebased as well.

@stefwalter stefwalter deleted the stefwalter:bundles branch Mar 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment