Skip to content

Initial gulp Documentation #24

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

Closed
wants to merge 14 commits into from
Closed

Initial gulp Documentation #24

wants to merge 14 commits into from

Conversation

travm
Copy link
Contributor

@travm travm commented Jan 6, 2014

Here's some of the initial gulp documentation for writing tasks (and a few other additions). There is a lot more to be done, but this should get us started.

With all the discussions going on, I'm unsure if this is the approved way of organizing this content. This was written using the initially approved content base by @rowoot.

@travm travm mentioned this pull request Jan 6, 2014
@dashed
Copy link

dashed commented Jan 6, 2014

@travm You don't mind that I flesh out things in this manner?

@dashed
Copy link

dashed commented Jan 6, 2014

@contra Would you like to review these md docs?

@travm
Copy link
Contributor Author

travm commented Jan 6, 2014

@dashed Not at all, I appreciate the help! It may be better to wait for it to be merged and then fork the main repo and submit a PR from your fork with your changes.

I'm wondering what would be the best way to collaborate on the docs. @addyosmani How would you prefer we update and submit changes to the documentation? I know organization discussions are still taking place and I don't want to get things started in the wrong direction.

@dashed
Copy link

dashed commented Jan 6, 2014

@travm I should probably do a PR on your fork of the repo?

@dashed
Copy link

dashed commented Jan 6, 2014

Also https://stackedit.io/ would be super useful for this.


## Difference
The core difference with gulp as compared to Grunt or other build systems is that it is a _streaming_ build system. This removes the need for temporary files and folders and gives you more refined control of how your files flow through the task runner. Additionally, the file you create to run tasks is code instead of config. If you are familiar with Node.JS or the CommonJS spec, then you will feel right at home when writing your tasks file.
Copy link
Contributor

Choose a reason for hiding this comment

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

Node.js

@sindresorhus
Copy link
Contributor

Also need some mention of streams, concurrency, and running tasks synchronously and task dependencies.

// @contra

@yocontra
Copy link

yocontra commented Jan 7, 2014

Check out the wiki again btw if you haven't seen it in a while - it has changed quite a bit and has a lot more info

@travm
Copy link
Contributor Author

travm commented Jan 7, 2014

Thanks everyone!

@sindresorhus and @dashed A lot of good points. I'll correct these asap.

@contra Thanks for letting me know. I hadn't seen the updates. Those recipes will help, especially the Mocha one as we need a testing example.

What is the best practice with documentation projects like this? Should I close the PR, resolve these issues and the submit another? Any guidance would be appreciated!

cc @addyosmani

@sindresorhus
Copy link
Contributor

@travm just push more commits to this PR when you're ready and we'll squash it at the end ;)

@travm
Copy link
Contributor Author

travm commented Jan 7, 2014

@sindresorhus Much appreciated. :) I'll get these fixed after work this evening and add in the remaining tasks.

@dashed
Copy link

dashed commented Jan 7, 2014

@travm I only looked through the beginning md docs. I'll need to set aside some time to look through the rest extensively.

@addyosmani
Copy link
Member

As @sindresorhus has already mentioned, great work. We can continue iterating on this PR and just squash your commits at the end of the process once you're ready :)

@travm
Copy link
Contributor Author

travm commented Jan 9, 2014

Okay, I think that should cover most of the initial corrections. I apologize if I missed a few. LiveReload section has been fleshed out a bit more, but may need to be further explained.

To do:

  • Streams
  • .pipe()
  • Testing Task
  • Deployment
  • Advanced Tasks Section?
  • Using Config Files (gulp Issue #120)

@0x-r4bbit
Copy link
Contributor

@addyosmani @sindresorhus what do you guys think of the little convention to only use one line per sentence and each sentence a new line.

So a sentence like

I am a sentence and I can be very long. I am another sentence and I'm short.

would be written as

I am a sentence and I can be very long.
I am another sentence and I'm short.

This makes it easier to see diffs in commits etc..

@sindresorhus
Copy link
Contributor

@PascalPrecht no, and github now support wrapping lines in diffs: https://github.com/blog/1707-soft-wrapping-on-prose-diffs

@travm
Copy link
Contributor Author

travm commented Jan 13, 2014

Streams introduction is complete. Let me know if I should go into more detail. I was afraid of overwhelming readers in the introduction, so I kept it very basic. Added a quick reminder about .pipe() to the first task in the Writing Tasks section.

To do:

  • Testing Task (Mocha)
  • Deployment
  • Advanced Tasks Section?
  • Using Config Files (gulp Issue #120)


## What are Streams?
Streams were designed to perform complex operations by using a collection of smaller, single purpose applications in a sequence. The idea was that we could stack these applications end to end and then pass the output of one application into the input of another. As the data passes through each application it is modified (or analyzed) and then piped to the next application in the sequence until the stream is complete. This connection of applications is referred to as _piping_ and the collection of pipes as a whole is referred to as the _pipechain_.
Copy link

Choose a reason for hiding this comment

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

Streams wereare designed to perform complex operations by using when constructed as a sequence of smaller, single purpose applications (streams?) in a sequence. The idea was that we could stack These applications (streams?) would connect from one end -point to end and a starting-point of another, then pass the output of one application into the input of another. As allowing the passage of the data passes through each application it is to be modified (or analyzed) at each application. and then piped to the next application in the sequence until the stream is complete. As data make their journey through streams, they may have been modified or transformed so as to be indistinguishable from what they have begun to be. This connection of applications is a concept referred to as piping, (comma here) and the collection of pipes as a whole is referred to as the pipechain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestions and corrections! I'll put some more thought into this and maybe add an real world example to make it easier to understand for people who are completely new to the idea of streams.

@dashed
Copy link

dashed commented Jan 14, 2014

Maybe a quick primer of http://nodejs.org/api/events.html and mention the standard events of streams?

These seem to be frequently used handlers: .on('data'), .on('error'), and .on('end'). At least from my experience with gulp.

@travm
Copy link
Contributor Author

travm commented Jan 14, 2014

I'm beginning to wonder if this stream and api information wouldn't better be suited in the Node and npm chapter? Thoughts?

@dashed
Copy link

dashed commented Jan 14, 2014

It may mislead readers to its relevance in the book until they read the gulp chapter.

@travm
Copy link
Contributor Author

travm commented Jan 14, 2014

Yeah, that's true. Maybe if another tool makes use of streams then we could unify the streams information in the Node chapter and each tool can reference it. For now, It's probably best to remain here.

My biggest fear with including api information this early is that we may overwhelm our target audience who may have never used Node or npm before. What do you think about including more advanced api information and examples after the introductory content?

@addyosmani
Copy link
Member

I certainly wouldn't mind seeing more advanced information after the introductory portions.

@travm
Copy link
Contributor Author

travm commented Feb 5, 2014

Sounds great! I'll be committing more of the basic documentation for review very soon.

@addyosmani
Copy link
Member

@sindresorhus how happy are you with the current state of the chapter?

@sindresorhus
Copy link
Contributor

@addyosmani happy :D

@travm very nice work!

@dashed thanks for reviewing.

@addyosmani
Copy link
Member

Thanks so much for all of the hard work @travm!

@travm
Copy link
Contributor Author

travm commented Feb 10, 2014

@sindresorhus @addyosmani My pleasure! I'm glad I can help!

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

Successfully merging this pull request may close these issues.

6 participants