Skip to content
This repository was archived by the owner on Jan 9, 2019. It is now read-only.

Change bundle path and fix relative URL's#41

Open
rehandalal wants to merge 4 commits intojsocol:masterfrom
rehandalal:bundled-folder
Open

Change bundle path and fix relative URL's#41
rehandalal wants to merge 4 commits intojsocol:masterfrom
rehandalal:bundled-folder

Conversation

@rehandalal
Copy link
Copy Markdown
Contributor

Feel free to say: "THESE ARE USELESS CHANGES AND NOBODY NEEDS THEM!".

This does a couple of things:

  • CSS bundles will now be in MEDIA_PATH/bundled/css MEDIA_PATH/BUNDLES_DIR/css
  • JS bundles will now be in MEDIA_PATH/bundled/js MEDIA_PATH/BUNDLES_DIR/js
  • Relative URL's in CSS will now be fixed to point to the correct URL when bundled. (This was a problem on SUMO and recently on Input)

r?

@rehandalal
Copy link
Copy Markdown
Contributor Author

I should also probably point out the reason for bundling to the bundled folder.

I happened to have a bundle called jquery and sadly one of the files in the bundle was jquery-min.js which (you guessed it) got replaced with the bundle file.

Now admittedly, this is a silly edge case that would normally not be an issue, and is pretty easy to get around. But I generally like the idea of tossing bundled files in another folder because it also keeps file clutter down in my js/css folders.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be a raw string, like this

css_parsed = re.sub(r'url\(([^)]*?)\)', parse, css_content)

Otherwise, python and re get confused about the back slashes.

@willkg
Copy link
Copy Markdown
Collaborator

willkg commented Feb 24, 2013

If someone updates to this, will they be hosed? Are there things they need to do to update to this version?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is this not in get_media_root()?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if I decide to not set settings.BUNDLES_DIR can we not do the bundled/ stuff?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

sure i could default that to .

@rehandalal
Copy link
Copy Markdown
Contributor Author

@willkg with the new change to the default value of BUNDLES_DIR there should be no compatibility issues.

@rehandalal
Copy link
Copy Markdown
Contributor Author

Test added ^

@rehandalal
Copy link
Copy Markdown
Contributor Author

And now tests pass ^

If this is all good I'll squash and push

@jsocol
Copy link
Copy Markdown
Owner

jsocol commented Oct 28, 2013

@cvan any outstanding comments here? @rehandalal Still want to get this merged in?

Comment thread requirements.txt Outdated
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I can't find where you use that package in the diff.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

It's unrelated but missing. There's a test in #63 that demonstrates the issue. Any new tests that hit that area of code will trip over it.

@davidbgk
Copy link
Copy Markdown

davidbgk commented Apr 9, 2014

I can't understand why there is the /bundled/ path still hard-coded in some places given that there is a setting for that path.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shouldn't that one be wrapped in url() too?

dean added a commit to mozilla/kitsune that referenced this pull request Sep 3, 2014
This needs to be updated after the PR is merged into master at:
jsocol/jingo-minify#41
dean added a commit to dean/kitsune that referenced this pull request Sep 3, 2014
This needs to be updated after the PR is merged into master at:
jsocol/jingo-minify#41
dean added a commit to dean/kitsune that referenced this pull request Sep 4, 2014
This needs to be updated after the PR is merged into master at:
jsocol/jingo-minify#41
dean added a commit to dean/kitsune that referenced this pull request Sep 9, 2014
This needs to be updated after the PR is merged into master at:
jsocol/jingo-minify#41
dean added a commit to mozilla/kitsune that referenced this pull request Sep 17, 2014
This needs to be updated after the PR is merged into master at:
jsocol/jingo-minify#41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants