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

Proposal: automatically treat URLs as empty: #163

Closed
jwhitley opened this issue May 2, 2012 · 3 comments
Closed

Proposal: automatically treat URLs as empty: #163

jwhitley opened this issue May 2, 2012 · 3 comments
Milestone

Comments

@jwhitley
Copy link
Contributor

jwhitley commented May 2, 2012

In requirejs-rails 0.8.0, I added/documented support for folks doing an r.js build via the gem and using CDNs. One of the cases to be covered was the use of a paths config with URLs in the right-hand side. It occurs to me that I ended up effectively making a policy change to the way r.js works: instead of erroring out on URLs and requiring the build config to explicitly specify empty:, I automatically replace any URLS in paths with empty:. This was mostly in response to the stream of folks who get bit by that on the mailing list and the fact that r.js has no other non-error behavior in this case.

I'm proposing to push this logic up into r.js, turning this issue into a pull request which makes said changes. There are a few ways this could go:

  1. Just change the default, optionally emitting a notice whenever URLs are substituted (one notice per run) to reduce surprise by users.
  2. Leave the current default but add a build config option that globally allows the more friendly behavior. End users thus have less complicated logic when assembling a build config: use the require.js paths config plus one additional "yes, I mean it, I'm really using a CDN" option.
@jrburke
Copy link
Member

jrburke commented May 3, 2012

Seems reasonable, putting it in the 2.0 bucket as that is the active dev branch at the moment.

@jrburke
Copy link
Member

jrburke commented May 23, 2012

There is a dev2.0 snapshot update with a fix for this. It prints out a message that it is is skipping an url, and should only do it once per build layer. Feel free to give it a spin and confirm the behavior.

@jwhitley
Copy link
Contributor Author

Awesome. I'm overdue to update requirejs-rails' corresponding dev2.0 branch, so I'll take a look at it over the next few days when I do the update.

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

No branches or pull requests

2 participants