Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Usemin 2.0 #85

Closed
4 of 5 tasks
sleeper opened this issue Mar 25, 2013 · 50 comments
Closed
4 of 5 tasks

Usemin 2.0 #85

sleeper opened this issue Mar 25, 2013 · 50 comments
Assignees

Comments

@sleeper
Copy link
Contributor

sleeper commented Mar 25, 2013

Usemin needs a big overhaul to be simpler to understand and use, and be more configurable.
Namely we need:

  • configurable pipe for useminPrepare (e.g. users may want to disable uglifyjs, concat, ..)
  • simpler directories (input, output) configuration:
    • differentiate location dir (i.e. where the looked at file is), search path (where to look for assets), staging dirs and output dir
  • flexible parsers for usemin (e.g. add for example create a new parser for AngularJS)
  • comprehensive docs about how it works and how it should be used.
@ghost ghost assigned sleeper Mar 25, 2013
@passy
Copy link
Member

passy commented Mar 25, 2013

👍

@sindresorhus
Copy link
Member

👍

I would also like to see anything that could be generic made into a separate node module.

@sleeper
Copy link
Contributor Author

sleeper commented Mar 26, 2013

@sindresorhus Any precise idea ?

@sindresorhus
Copy link
Member

The cssprocessor, htmlprocessor and revfinder might be useful outside of usemin if refactored, though haven't looked at them in-depth.

@sleeper
Copy link
Contributor Author

sleeper commented Apr 1, 2013

Work in progress in branch v2.0 of sleeper/grunt-usemin

@passy
Copy link
Member

passy commented Apr 1, 2013

The new flow system looks really awesome. This will make usemin a lot easier and more transparent to use.

@sleeper
Copy link
Contributor Author

sleeper commented Apr 1, 2013

Yes, I hope so.
As well I'm working on clarifying the directories system ... Good progress on that ;)

@sindresorhus
Copy link
Member

I also think a goal of 2.0 should be to make it faster. Currently it takes some time to run.

Some ideas:

@sleeper
Copy link
Contributor Author

sleeper commented Apr 3, 2013

Ok for the perfs.
Not looked at it deeply but not sure async.parallel can be used for the various regexp replacement: we can launch it and have several replacement in parallel, but the difficult part is to merge the output of each of these replacements...

@sindresorhus
Copy link
Member

@sleeper good point, that would be difficult. maybe run multiple files in parallell then.

@sleeper
Copy link
Contributor Author

sleeper commented Apr 4, 2013

Yes, I was more on this side ;)

Frederick Ros
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

Le jeudi 4 avril 2013 à 13:56, Sindre Sorhus a écrit :

@sleeper (https://github.com/sleeper) good point, that would be difficult. maybe run multiple files in parallell then.


Reply to this email directly or view it on GitHub (#85 (comment)).

@frederikb
Copy link

What's the status on 2.0?

Being able to configure the pipeline for individual blocks would be a feature very much appreciated. In my case I would like to disable uglifyjs when concatenating third party code. On top of that, if it were possible to switch out those referenced JS files with their preminified equivalents (provided that they exist, which they often do in case of Bower components) before the concatenation step, that would be even better.

I am aware of many different grunt tasks for combining Bower components, but in the end they often fail due to the fact that hardly any Bower components are correctly configured (main file definition(s), dependencies).

@sleeper sleeper mentioned this issue Apr 29, 2013
@necolas
Copy link
Contributor

necolas commented May 9, 2013

Please can we get this in a branch on this repo. Doesn't need to be in a state that's suitable for merging into master any time soon.

@sleeper
Copy link
Contributor Author

sleeper commented May 9, 2013

Will do tonight.

@sleeper
Copy link
Contributor Author

sleeper commented May 9, 2013

Oki doki. Branch v2.0 created and populated.

Note that a lot needs to be done yet:

  • Review README
  • Allow user to define and pass his own steps for the flow
  • Ensure that we're capturing all the config produced by the steps of the flow (especially when they are created/furnished by the user)
  • Add an option to use a map file produced by grunt-rev (the code is written to work with, only the option stuff and passing it to the task needs to be done)
  • deprecate usage of require.js in blocks (see How to handle require.js in v2.0 ? #112)

Additionally, in order to be more efficient I submitted a PR to grunt-rev to have it produce a map of the transformed files.

Test are passing, but I still need to test it on real stuff ;)

@sindresorhus
Copy link
Member

  • make sure changes in master since the 2.0 rewrite begun is reintegrated

@sleeper
Copy link
Contributor Author

sleeper commented May 15, 2013

Agreed. Also:

  • document how to move from usemin v0.11 to v2.0

@sleeper
Copy link
Contributor Author

sleeper commented May 23, 2013

Added option to look for file in a map object instead of on file

@sindresorhus
Copy link
Member

@sleeper what's the status of the rewrite? :)

@sleeper
Copy link
Contributor Author

sleeper commented May 31, 2013

What is missing so far:

  • remove support of requirejs in blocks
  • update/beautify documentation
  • test it really (I mean ask people to help by testing it on real cases)
  • ensure all the stuff that has been merged on master is present somehow on this branch
  • Explain how to migrate the config from previous version to this one

We also need to push to have the PR for grunt-rev merged in master

@necolas
Copy link
Contributor

necolas commented May 31, 2013

Would it be worth breaking any of the more generic tasks into separate packages, like grunt-rev was.

@sleeper
Copy link
Contributor Author

sleeper commented May 31, 2013

Yes, I was thinking about this as well... Let's say that in a first phase, I would like to be sure it really works, and then split what can be split ... Not sure I have a lot of generic stuff there though ;)

@sleeper
Copy link
Contributor Author

sleeper commented Jun 8, 2013

OK, so last changes:

  • support for requireJS in blocks has been removed
  • usemin will now first look if a map object is available in grunt.filerev.summary otherwise it will look on the disk. You can still override the map object by using the revmap option)

@robwierzbowski
Copy link

@sleeper: Will usemin blocks in 2.0 have the ability to set alternate search paths like the ones described in yeoman/yeoman#959?

@sleeper
Copy link
Contributor Author

sleeper commented Jun 8, 2013

Humm .. this is not exactly what I have ... the alternate path are used as alternate search path, not alternate output path ...
What is the use case behind this ?

@robwierzbowski
Copy link

I think those describe alternate search paths. So

<!-- build:js(app,.tmp) scripts/tmp.js -->
...
<!-- endbuild -->

would look in .tmp then app for a script or stylesheet to add to the concatenation array. It addresses a couple of existing issues and would allow the build process and the server process to follow the same pattern in generators with preprocessors.

@sleeper
Copy link
Contributor Author

sleeper commented Jun 8, 2013

Oh, my fault I didn't read properly the issue you were mentioning.
AFAIR alternate path are already working in standard usemin and should in usemin v2.0 ;)

@robwierzbowski
Copy link

From what I see it doesn't cascade (app then .tmp), which is useful if you need to concatenate preprocessed css/js with vanilla css/js that lives in app.

Would it be better for me to open a separate issue with use case, references, etc?

@sleeper
Copy link
Contributor Author

sleeper commented Jun 8, 2013

yep, it would be simple ;)
I'm starting to give a "real life" run to usemin v2.0 (e.g. real world testing ;)), so I should wipe some issues

@robwierzbowski
Copy link

Thanks! New issue posted.

@sindresorhus
Copy link
Member

@sleeper hey man. How far along is the rewrite at this point?

@sleeper
Copy link
Contributor Author

sleeper commented Jul 19, 2013

I would say a couple of things to review/fix, plus rebasing on master to get the patch that have been incorporated on master since the initial branching ... which is not really cool, considering some people have probably checked out this branch .. but considering the huge amount of changes this is the only suitable way to do it ...

@sindresorhus
Copy link
Member

That's great to hear. Would be nice to get it into generator-webapp soon to test it out ;)

@sleeper
Copy link
Contributor Author

sleeper commented Jul 19, 2013

OK, so I invoked the wrath of Git Gods by squashing and rebasing v2.0 on master.
As some files have disappeared some PR are not "merged" anymore (#106, #137, #141). I'll need to re-implement this in v2.0.

@guifromrio
Copy link

Many anxious users ready to rock and roll version 2!

On Fri, Jul 19, 2013 at 8:42 PM, Frederick Ros notifications@github.comwrote:

OK, so I invoked the wrath of Git Gods by squashing and rebasing v2.0 on
master.
As some files have disappeared some PR are not "merged" anymore (#106#106,
#137 #137, #141#141).
I'll need to re-implement this in v2.0.


Reply to this email directly or view it on GitHubhttps://github.com//issues/85#issuecomment-21283738
.

@sleeper
Copy link
Contributor Author

sleeper commented Jul 22, 2013

OK, support for #106 and #141 are now part of v2.0

@sindresorhus
Copy link
Member

@sleeper how do you feel about doing the 2.0 release this/next week?

Usemin 1.0 has a lot of problems and would be a great help to people if they got 2.0 ;)

@guifromrio
Copy link

There's sure lots of folk dying in anticipation. I'm one of them!

@sleeper
Copy link
Contributor Author

sleeper commented Sep 23, 2013

Sorry for the delay in answering, I have/had lot of work plus additional things that kept me far from my duties ;)

From my point of view v2.0 is pretty stable... Most of the last fixes on the master branch have been back ported to v2.0.
Some additional stuff are not yet done (like the conditional stuff for IE).

In my view, we should ask for a wider test by integrating it with generator-webapp for example.

@sindresorhus
Copy link
Member

Thanks for the update @sleeper and no worries :)

Anyone up for doing a PR on generator-webapp?

@sindresorhus
Copy link
Member

@kevva
Copy link
Member

kevva commented Sep 26, 2013

What's to be updated? Seems like it should work out of the box. Maybe we need to change dirs to assetsDirs in the usemin task but other than that there shouldn't be any super big changes.

@sindresorhus
Copy link
Member

@kevva i haven't looked at it closely, but you're probably right. Most important thing is testing all edge cases and reporting back if something isn't working.

@kevva
Copy link
Member

kevva commented Oct 9, 2013

Implemented in yeoman/generator-webapp@40a2595. Could we release this soon @sleeper?

@guifromrio
Copy link

Christmas morning feelings.

@sleeper
Copy link
Contributor Author

sleeper commented Oct 14, 2013

Dudes, sorry for being so absent these days.
I'm going to try merging the 2.0 branch in master tomorrow morning (Paris time ;)).

@sleeper
Copy link
Contributor Author

sleeper commented Oct 15, 2013

Version 0.1.13 published: last head version before merge ;)

@sleeper
Copy link
Contributor Author

sleeper commented Oct 15, 2013

Holly crap dudes: v2.0 has been merged in master and has been published in npm.

Enjoy !!

@kevva
Copy link
Member

kevva commented Oct 15, 2013

👏

@sindresorhus
Copy link
Member

Awesome! Thanks for doing that @sleeper :D

We should get out a new release of generator-webapp

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants