Skip to content
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 from
Closed

Conversation

stefwalter
Copy link
Contributor

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

@stefwalter stefwalter force-pushed the bundles branch 3 times, most recently from db3411f to c93f59b Compare March 23, 2015 12:16
@stefwalter stefwalter changed the title WIP: Javascript Bundles Javascript Bundles Mar 23, 2015
@stefwalter stefwalter force-pushed the bundles branch 3 times, most recently from f5b96f2 to ff0793c Compare March 23, 2015 20:21
@mvollmer mvollmer self-assigned this Mar 24, 2015
@@ -1,7 +1,8 @@
EXTRA_DIST += \
tools/html-minifier \
tools/htmlmin.conf \
tools/jsmerge \
tools/jsbundle \
tools/cssbundle \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace

@stefwalter
Copy link
Contributor Author

Fixed whitespace, rebased.

@stefwalter stefwalter force-pushed the bundles branch 2 times, most recently from ff0793c to 36b9ba2 Compare March 24, 2015 10:28
@mvollmer
Copy link
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?

@mvollmer
Copy link
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).

@mvollmer mvollmer removed their assignment Mar 24, 2015
@stefwalter
Copy link
Contributor Author

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.

Besides just merging them, this gives javascript files the right
identifier.
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
@stefwalter
Copy link
Contributor Author

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 bundles branch March 24, 2015 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants