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

[Loader]: Loading CSS modules, fixes #1680 #1705

Closed
wants to merge 6 commits into from

Conversation

ezequiel
Copy link
Contributor

CSS modules the user creates should load after any YUI related CSS. This is in case the user wishes to override the default styles of a YUI module, for example.

This feature was missed in the recent Loader changes due to no test being written for it.

(fixes #1680)

@yahoocla
Copy link

CLA is valid!

@ezequiel ezequiel added this to the Sprint 13 milestone Mar 14, 2014
@@ -2182,7 +2189,12 @@ Y.log('Undefined module: ' + mname + ', matched a pattern: ' +
}
}

this.sorted.push(name);
var isExternalCSS = module && module.ext && module.type === "css";
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: a number of var.

@ezequiel
Copy link
Contributor Author

Thanks, @okuryu.


// External CSS modules must be inserted last,
// after all YUI related CSS.
if (this._externalCSS.length > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little worry about this. By adding _externalCSS to the loader instance (similar to ), we might get into some race conditions when multiple calls to load new modules might get mixed. With CSS this is not a big problem because it is sync I think.

Copy link
Member

Choose a reason for hiding this comment

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

probably if we rename the variable, that will be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your concern. As for multiple calls to load new modules-- I cannot imagine a scenario in which an error would occur.

_externalCSS seems reasonable to me. Can you elaborate?

@okuryu okuryu assigned apipkin and unassigned apipkin Mar 16, 2014
@caridy
Copy link
Member

caridy commented Mar 21, 2014

The more I think about this, the more I believe we should keep it as it is, and if they want to have explicit definition, they should call it out in the dependencies.

@ezequiel ezequiel closed this Apr 9, 2014
@ezequiel ezequiel deleted the css-fix branch April 11, 2014 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants