-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Work in Progress: New build system and cleanup #1184
Conversation
@@ -1,4 +1,4 @@ | |||
# editorconfig.org | |||
# http://editorconfig.org |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is nessecary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem.
no matter what happens, bravo sir. I am impressed. |
// $ modernizr --config ./my-config.json --dest ./build/modernizr-build.js --min | ||
// $ modernizr -c ./my-config.json --d ./build/modernizr-build.js -m | ||
// Arguments: | ||
// See `help` variable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'd be great to actually document the help command here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I didn't want to have too much code duplication, but no problem.
Some questions: API ChangesI've changed the API a little: the node package outputs only a single file at a time, there's an options object (altered type signature) which includes a destination or false to output no file, and the callback has a single argument. My goal was to have less side effects, more specifying what you want the function to do. Also moved all non-Modernizr output options out of the config object and into the options argument. What do you think about taking it a little farther and making the node package only return string output in the callback? The CLI and Grunt plugins would still output files, but when you're coding node you can use whatever file writing or data storage method you like to handle the modernizr output. This would let us remove the Defaults?Right now a default Modernizr configuration doesn't exist, unless you're in the cli. What do you think about having an Verbose flag?How much success/error logging should there be? I included one try/catch block when writing the file (in case there are permission issues, for example) and assume that everything else will throw an error that will bubble up unless the user specifically catches it when calling Other little stuffEvery feature detect in the options object is prefixed with |
Today I'm going through the tests to get them working again. A couple questions: The API tests are pretty basic, looking good there. test/api/index.js can probably be blown away: it's testing if a modernizr main file exists, and if it has a function. IMO there's no need to test the first, as all future tests would fail if that returned false, and test/api/build.js tests the second part in a more specific and useful manner. I could use a little clarification on caniuse.html and modular.html. It looks like caniuse.html is there for visual/human reference only. True? Modular.html re-implements a require build in browser. Is it just there for human preview? Since it uses a separate, checked in version of r.js, the built code may differ from what's built by the updated r.js in node_modules/requirejs. I could browserify the build system in lib/ and load it in modular.html, but in order to see the code built in the browser you have to download the repo anyways, at which point you could just build with the cli. If it's not valuable. removing the file would reclaim some complexity and maintenance costs. |
yup! |
If you'd like any of the changes I'm making while getting tests working moved into their own PRs or reverted, let me know. Build rewrite is a pretty big change, and while I'm touching things I see a lot of stray files/unused config/etc. |
anything unrelated to the new build PR should be in a separate one. thanks a ton dude! On Sun, Jan 12, 2014 at 3:27 PM, Rob Wierzbowski
patrick |
Gruntfile is heavily changed by rewrite, so I'll leave those changes in. Moving the stray file cleanup from src to another PR. |
A few notes up top:
I'm all for this idea. The 'grunt can do files' vs. 'the cli tool just does streams' is a good one, I think.
Cool with a
As long as it's under a flag, the more logging the better. Show no restraint.
I think I'm cool with this. It breaks some consistency, but I think it's ok. Not too many people are going to think about it in the sense of a file system anyways.
|
@SlexAxton Thanks, that clears a lot of things up. Working tests and revisions coming soon! |
Done.
Currently the node package requires a config object, and the CLI outputs a "dev" file with all feature detects if it isn't given one. I'm happy to switch between all or nothing anywhere in here PR, and let's tackle named defaults in a separate PR.
I didn't implement much logging, only success messages on the CLI. Suggestions welcome, not sure what else is needed. Node unit tests are working. I'm going to take a look at generate-meta tonight. |
cc @doctyper also – need to make sure these changes work for grunt-modernizr |
I'm making headway implementing these changes in grunt-modernizr. I really like that Grunt has been abstracted away. I'm using it as an opportunity to make grunt-modernizr agnostic as suggested in Modernizr/grunt-modernizr/issues/54. @robwierzbowski So far the big missing piece is the metadata parameter in the CLI. I make heavy use of it to map and parse out test names in files. |
Glad you like it! The metadata generation is finished, just need to On Monday, January 13, 2014, Richard Herrera wrote:
Rob Wierzbowski |
Got generate working again, cleaned it up a little and added it as a method off of modernizr object and as a flag on the CLI. The output is compressed, so looks a little different from the previous. I beautified and diffed with the original and there are no content differences, only formatting. |
@doctyper: I revised the modernizr build function signature to make it a little more standard ( Last thing to do: Browser tests and in-browser generationOK, almost finished :D. Sorry for the long running PR, this month I've only had the weekends to work. When I started I accidentally broke in-browser generation: I thought that A couple questions (for @patrickkettner, @doctyper, @stucox, @SlexAxton, @paulirish in particular): What are the responsibilities of this repo? It
Does it also
It looks like the configuration (r.js) and a lot of the logic is inlined and duplicated. Let's define explicit responsibilities for these two repos. Should Modernizr (this repo) contain both a node and browser based build system, and modernizr.com uses the latter with no code duplication? Should Modernizr hold only the node based build system, and Modernizr.com pulls Modernizr in for source but holds the browser based build system (this would make sense if no one else is likely to build modernizr in the browser)? Or should the repos be further decomposed into modernizr-source.git, modernizr-node.git, modernizr-browser.git, modernizr.com.git? I'm going to start working on # 1 for now, which could easily be translated into # 2 — I get really nervous when a PR runs for a month 😄. But I love the decomposition @doctyper has done with grunt-modernizr, breaking the file parsing responsibility into its own node project, and I thought it was worth thinking about here. |
Actually, I think I need some input on those questions above before I proceed. Should this repo be primarily an in-browser build system that's wrapped in node for node.js and cli usage, or should it be primarily a node build system with consumable parts for a separate in-browser build system? |
I would think the best thing would be the former, if for no other reason than the fact that the browser testing has to be in this repo. That being said, I think your own input would be very valuable in informing me, at the very least. |
To add to the separate-repo argument, a smaller npm package makes it less annoying for developers to use as a dependency. When I build node packages, I tend to look for alternatives whenever one dependency takes too long or makes too much noise on install. I'm all for shaving ms wherever possible on package install time. Another point to consider is versioning. This npm package will eventually need to version bump with every push to master. It would be less confusing to split the repo based on intent. Otherwise, you might version bump to fix a browser bug or version bump to fix a CLI bug. |
Totally agree. My ideal would be:
I think it would be the same amount of work from here as solving the problems in a single repo, with a better final outcome. |
OK, back on this today. Note to self: normalizing naming of feature tests and files would make testing easier. |
Going to try creating responsibilities like this: Modernizr src/ is a require.js based script that creates a full Modernizr build based on a config argument. |
sgtm |
ping @robwierzbowski - lets do this, mang. I'm free whenever you are - I want to ship yer stuff |
Sorry, let this languish. I can make time to do a bit of work this weekend. Want to gchat on Saturday? On Tuesday, June 17, 2014, patrick kettner [email protected] wrote:
Rob Wierzbowski |
yes, yes I do :D |
Nice. I'll take some time this week to break up some tasks, and then Sat Rob Wierzbowski On Tue, Jun 17, 2014 at 9:12 AM, patrick kettner [email protected]
|
huzzah! |
OK, I got totally eaten by wedding recuperation and house cleaning on Sat, sorry about that. Up for rescheduling whenever you have some time. List of things that we can break out into separate PRs:
At the end we should have a more streamlined build sys that's nicely separated into universal base, node, and CLI parts. I can help with a bunch of this, but probably not all of it. Whatcha think? |
There has been a lot of recent @robwierzbowski @patrickkettner I'm ready and willing to carve some time out this weekend to land this PR. Can we make it happen? |
Totally my fault for not responding sooner - had a wedding (as well!) and I/O, and was a lot busier than anticipated. Totally down for this weekend. Do you guys want to meet up on chat/hangout/irc or something to make a gameplan quickly? Im free from ~7 hours from now onwards |
We're all so busy :). I can do Saturday morning (east coast), but tonight Rob Wierzbowski On Thu, Jul 3, 2014 at 12:26 PM, patrick kettner [email protected]
|
:D - saturday morning works for me, @doctyper ? |
I'm free Sunday and a possible bonus day Monday. But don't let me stop the game-plan, I can hop on to whatever shakes out. |
Is everyone east coast? Or are these mornings different mornings? Rob Wierzbowski On Thu, Jul 3, 2014 at 12:57 PM, Richard Herrera [email protected]
|
You and I are, @doctyper is cali, unless hes traveling. Wanna meet up saturday morning @robwierzbowski, and then we can catch @doctyper up on sunday? |
Hells yes. 10am? On Thursday, July 3, 2014, patrick kettner [email protected] wrote:
Rob Wierzbowski |
created the |
Notes from dipping into the code again today: Goals:Require based build system (which is 90% there) that can be used in the browser and in node. Its interface should be a single function that takes a config object and an environment object/function. Node package and CLI for interacting with the require based build sys. Changes
Catch up
First steps:Add rjs as the entry point to the current build system, find the options that aren't currently in the cofig and add them Side notes
|
sup @robwierzbowski |
My gut is that we should probably just rebase this branch into master so we're all working on the same code. I think it's probably already in a better state than the current master build system, so no need to just make the PR bigger. |
@SlexAxton - this branch's grunt is currently broken, so I would disagree that merging to master is a good idea. Maybe a branch on the modernizr account, though? I think creating a checklist of all the crap that needs to happen and saying what individuals are working on would be a decent idea |
Let's just fix the jshint error or whatever that is and get it in? or is it worse than that? |
it was like totally hosed last I checked, but that was a while back and am mobile at the moment. if its easy enough to have it "working" then 👍 |
I believe it is totally hosed. Basically there are parts of it that need to On Wednesday, August 27, 2014, patrick kettner [email protected]
Rob Wierzbowski |
Totally cool. Should we just abandon this attempt or is there stuff worth pulling out here? Do you have any state dump on what specifically is hosed? No worries on being busy, just wanna pick back up where we left off. |
I think the best idea would be to close this branch and continue on the We're getting a half day a month at my company to work on outside projects; On Wednesday, August 27, 2014, Alex Sexton [email protected] wrote:
Rob Wierzbowski |
OK, here we go!
I had a chance to go through the whole system. Cleaned up some unused files, reorganized, and rewrote the build system as promised.
This changes the API, which I'd like to get your feedback on. The cafe I'm working at is closing, so I'll expand a little on the benefits/reasoning tomorrow. Also, tests are currently broken but I'd like to nail down the API before I fix them.
The positive code is mostly comments, readme, and modularization. And the new CLI.
Can you explain what the use of generate-meta is? I've broken it a little and will fix up; knowing it's purpose will help with that.
Everything's documented in the readme.md. More tomorrow.