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

[WIP] Add use of require.css and require.js #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RobLoach
Copy link

This is more of brainstorm than a pull request. This makes use of Component Installer's generated require.js and require.css, reducing the micro-management of dependencies, and the amount of HTTP requests.

  • require.css: Concatenated stylesheet of all Component CSS files
  • require.js: Built RequireJS configuration for loading scripts, along with their dependencies

@simensen and I had troubles getting RequireJS to pick up the correct base URL in Sculpin. We can get around that by telling Sculpin to register it directly in the template:

require.config({
    "baseUrl": "{{ site.url }}/components"
});

Was trying to use hljs.initHighlightingOnLoad(); here, and it wasn't quite working because I believe at the time the require callback is made, the page is already loaded and the event has already been triggered. I could be wrong though, but it is working with the following:

require(['highlightjs', 'bootstrap'], function(hljs) {
    hljs.initHighlighting();
});

Was wondering where this could improve, and was looking for both of your thoughts. I'm trying to get a better understanding of where Component Installer could be better, and how it could satisfy more use cases.

Thanks a lot! Stack looks great ❤️

simensen pushed a commit that referenced this pull request Sep 24, 2015
loop back server address and composer order. are changed.
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.

1 participant