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

Remove removeCombined hack #116

Closed
wants to merge 1 commit into from
Closed

Conversation

redoPop
Copy link

@redoPop redoPop commented Jun 2, 2013

@peol's hack to honor removeCombined — introduced in 6ad9705 per #62 — is unsafe for projects that refer to the same template in multiple modules.

There are valid exceptions to the assumption that a template should only be used once in a build; for example, builds where cache optimization is balanced with optimizing the number of HTTP requests on initial page load.

requirejs/r.js#344 will address removeCombined support in a more robust way. Any objections to removing this hack and instead waiting for the removeFile API?

The removeCombined hack breaks builds that reference the same
template multiple times in different modules, since the template
gets deleted on the first encounter.

Removing the hack in anticipation of r.js 2.2.0's removeFile API
per requirejs/r.js#344 which will provide a more robust standard
way of offering removeCombined support.
@SlexAxton
Copy link
Owner

Any news on better fixes for this, @peol or @jdbartlett ?

@peol
Copy link
Contributor

peol commented Dec 4, 2013

I reported this to the main repo as a way for all plugins to hook into the removeCombined option. There hasn't been much movement on the issue though (I've since moved on to another implementation): requirejs/r.js#344

@brandonmcquarie
Copy link
Contributor

I know this is an old post, but is this issue still happening? If so do you have an example. I am using this in my production environment and use the same template multiple times in different places and haven't experienced an issue as of yet. But I am loading all of my templates through RequireJS' define statement for each project.

@redoPop
Copy link
Author

redoPop commented Apr 14, 2014

@brandonmcquarie I've not checked lately but you'll only be affected if your r.js configuration explicitly contains removeCombined: true (it's false by default). Per my and peol's previous comments, we've been waiting for the completion of r.js' removeFile API to resolve this issue fully.

@brandonmcquarie
Copy link
Contributor

Ah okay, I put in a pull request that was just merged in for a resolution to removedCombined: true for my configuration. I was just making sure there wasn't some configuration that I may stumble upon that would break further because of that flag being set to true. Thank you.

@redoPop
Copy link
Author

redoPop commented Mar 27, 2015

fb0d8cc fixes the same issue; this PR is no longer relevant.

@redoPop redoPop closed this Mar 27, 2015
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.

4 participants