Giter Site home page Giter Site logo

choojs / choo-handbook Goto Github PK

View Code? Open in Web Editor NEW
269.0 16.0 25.0 3.01 MB

🚂✋📖 - Learn the choo framework through a set of exercises

Home Page: https://handbook.choo.io

License: Other

HTML 92.31% CSS 7.69%
choo workshop tutorial handbook guide markdown book frontend framework

choo-handbook's People

Contributors

aknuds1 avatar allain avatar bcomnes avatar byronhulcher avatar corderophilosophy avatar delaguilaluis avatar dmitriz avatar greenkeeperio-bot avatar haroenv avatar jckfa avatar jjenzz avatar jp-rivera avatar loklaan avatar louiscenter avatar michaelck avatar petehouston avatar richardlitt avatar sethvincent avatar stpoa avatar timwis avatar wooorm avatar yoshuawuyts avatar zeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

choo-handbook's Issues

Change repo description

It's currently:

Learn the TCBY stack through a set of exercises

For those of us familiar with the "TCBY stack" term, I think the current description makes sense, but for folks who may come to this repo from choo, or see it starred in their feed by someone, it's a little cryptic. Perhaps:

Learn the choo framework through a set of exercises

Sup, choo bug?

Hi, I was doing the sup, choo tutorial. Copied word by word and I get this error:

Uncaught TypeError: Cannot read property '0' of undefined
    walk @ index.js:26
    sheetRouter @ index.js:48 
    createRouter @ index.js:123
    start @ index.js:70
    7.choo @ client.js [sm]:12
    s @ _prelude.js:1
    e @ _prelude.js:1
    (anonymous function) @ _prelude.js:

This is, currently, my client.js. Maybe I fucked something, but again. At the end, I literally copied:

const choo = require('choo')
const html = require('choo/html')

const app = choo()
const sexyView = () => html`
  <div>Hello chooters</div>
`

app.router((route) => {
  route('/', sexyView)
})

const tree = app.start() // this madafa is the one causing troubles
document.body.appendChild(tree)

the way it looks

The gcloud documentation is probably doing a good job; we could totes copy their design but change the font and make it like more pink. For reference:

screen shot 2016-08-10 at 15 35 31

screen shot 2016-08-10 at 15 36 17

especially the versioning + links to stackoverflow / github / npm would be grand

sample app click behavior is weird

for first choo app the clicking behavior seems odd, once you click on animal type , you have to randomly get a click on that animal, wouldn't it be better once having choosen an animal to now only click on that animal.
change index.js , see **** new line commented code
index.js:
// import choo
var choo = require('choo')

// import choo's template helper
var html = require('choo/html')

// import template
var main = require('./templates/main.js')

// initialize choo
var app = choo()

app.use(function (state, emitter) {
// initialize state
state.animals = [
{ type: 'lion', x: 200, y: 100 },
{ type: 'crocodile', x: 50, y: 300 }
]

state.atype='all'

// add animal
emitter.on('addAnimal', function (data) {
var animals = ['crocodile', 'koala', 'lion', 'tiger', 'walrus']
var type = Math.floor(Math.random() * 5)

if (state.params.type)                                      //**** new line
  type=animals.indexOf(state.params.type);   //**** new line
      
var x = data.x
var y = data.y

var obj = { type: animals[type], x: x, y: y }
state.animals.push(obj)

emitter.emit('render')

})

// remove animal
emitter.on('removeAnimal', function (i) {
state.animals.splice(i, 1)
emitter.emit('render')
})
})

// declare routes
app.route('/', main)
app.route('/filter/:type', main)

// start app
app.mount('div')

chapter overview

Which chapters should we write? How should they be ordered? Let's discuss it here. Anyone with push access should just update the section below so we can keep track as we write them. I'm like stuck in writing code so this is taking longer than I should; I reckon if we collaborate we can get there faster!


Index

  • introduction: welcome people to the repo in the name of all contributors. choo choo!; mention TCBY and link to tradeoffs between packages
  • reference: explain how to do specific things; probably what's mostly in the docs right now
    • reference: Actions:
      • action naming patterns
      • validating data
    • reference: Effects:
      • higher order composition
      • using pull-stream to compose
      • HTTP
      • testing
    • reference: Reducers:
      • testing
    • reference: Subscriptions:
      • keyboard
      • websockets
      • server sent events
    • reference: Router:
      • navigating using <a href="">
      • on-page navigation using anchor tags
      • hash routing
    • reference: Views:
      • explain how hyperx works
      • explain how yo-yoify works
      • explain how bel works
      • explain how morphdom and yo-yo work
      • lifecycles / widgetizing
      • function components
      • inline CSS
      • forms
    • reference: Servers:
      • server sent HTML choojs/nanohtml#29
      • server rendering (talk about tradeoffs, namely about cacheability)
      • combining HTML using hyperstream
      • caching HTML using bl
    • reference: optimizing builds: dive into the transforms and how to serve for production
  • guides: exact guides on how to build specific things; perhaps centered a common theme or smth?
    • guide: your first app: some sort of app in choo; guide people front-to-end
      • intro to browserify && show off budo ?
      • ... ehhh; create some static html and then make the rest of the app?
    • guide: wrapping for webcomponents: probably just one page
    • guide: react migration guide: translating react-speak to choo-speak
    • guide: choo + leaflet/mapbox.js: demonstrate basic usage of leaflet and/or mapbox.js with choo
    • guide: deploying choo: show examples of deploying to github pages, surge.sh, etc.
    • guide: choo & node:
      • choo & http servers
      • building a static site with choo

note: seriously, edit me


Probably the only constraints I'd have for writing style is trying to create an approachable style (e.g. add links to words; explain concepts; spell acronyms out the first time) and referring to people as people/they/them/their to like make assumptions on who they are. Perhaps this should be in a contributing section. Ah well - happy writing / updating / editing / tweaking! ✨

vector clocks for choo v5

03:25 <yoshuawuyts> oh super cool pattern for choo v5 btw: equality checks by creating a modified timestamp on individual items using an internal vector clock
03:25 <yoshuawuyts> will work real well for caching
03:26 <yoshuawuyts> (didn't come up with this btw, but yeah I just remembered discussing this last week)
03:27 <yoshuawuyts> e.g. rather than comparing properties on an object, you can check if the new timestamp on the incoming data is a newer version than the timestamp on the existing copy - if it's newer you re-render the element. If it's not you return the cached DOM node
03:28 <yoshuawuyts> circumvents creating new objects all the time just to satisfy triple equals checks, and removes the need to compare all properties

sample app maybe should highlight current animal type selected?

maybe highlight current animal type, so you know what you are clicking...
new main.js, code is messy since I'm learning choo & javascript...see create html template code area

main.js:
// import choo's template helper
var html = require('choo/html')

// import template
var animal = require('./animal.js')

// export module
module.exports = function (state, emit) {
// create html template
state.c=["","","","","",""]
var animals=['all','crocodile','koala','lion','tiger','walrus']
state.c[animals.indexOf(state.params.type || 'all' )] = 'highlight'

return html

${state.animals.map(animalMap)}

// map function
function animalMap (obj, i) {
return animal(remove, obj, i)
}

// add new animal to state
function add (e) {
var x = e.offsetX - 20
var y = e.offsetY - 10

emit('addAnimal', {x: x, y: y})
}

// map function
function animalMap (obj, i) {
var type = state.params.type

if (type && type !== obj.type) {
return // nothing
} else {
return animal(remove, obj, i)
}
}

// remove animal from state
function remove (e) {
var index = e.target.id
emit('removeAnimal', index)
}
}

Alice should have fun 3 times

In the example where Alice is having fun, the sentence function is called 3 times, but the output shows only one sentence.

Uglifyify breaks the build when using arrow functions

I tried making the main function into an arrow function and things broke, the page just said punc ()) Unexpected token. Removing -g uglifyify from the start command seems to have fixed things. Updating uglifyify might help since it's using a 2 year old version but I couldn't be bothered to test :P

[section] start

  • describe how subscriptions work
  • describe the "global start" pattern; e.g. wait until multiple models have booted before changing some other variable (e.g. "application has now loaded, stop rendering the placeholder view")

[guide] Choo Introduction For People Who Know Just Enough jQuery To Get By

@Kriesse pointed out today that it'd be cool to have a choo introduction
geared at people with light frontend skills (e.g. designers). An article that
she particularly liked was react introduction for people who know just enough
jquery to get by
. It'd be cool if something like that existed for choo.

The structure of the article is roughly:

  • define the target audience
  • overview of the project (create a tweet box)
  • introduction to JSBin (load libs and stuff, get some html)
  • set some state on the button in jquery
  • explain what you'll be doing in react to do the same thing
  • write some HTML markup in react
  • set some default state on the button using react (button is "disabled")
  • implement some state toggling in react
  • add a "remaining character count" thingy with jQuery
  • add a "remaining character count" thingy with react
  • explain the "add photo" feature
  • create the "add photo" button in jQuery
  • create the "add photo" button in react
  • reflecting on the react code (what makes it good?)
  • explain the "highlight overflow characters" feature
  • highlight "overflow characters" using react

Help with this is super welcome! - It'd be cool if someone (or a group of
people) could help guide absolute beginners to feel comfortable writing bel /
choo code! I probably won't have time to do this in the coming months, so if
someone else could pick it up it'd be amazing ✨ Thanks!

double check on adorable GIF licensing

hi friends,

i wanted to make sure that i can use your super awesome little animated critter GIFs. the project says MIT, but wasn't sure included the imgs.

they are fun, and i wanted to use them as loading animations on my recent choo app. where'd they come from, btw?

thx!

[guide] managing async logic with choo

This is the chapter overview to make people intimately familiar with choo's
async model. As parallel asynchronous programming is amongst one of the hardest
things to get right in programming, I think it's important to provide people
with a comprehensive guide. Feedback is very welcome! 🎉

Section overview

  • talk about why async is needed (the hamburger joint model)
  • base async patterns: parallel vs pipeline
  • go through choo's error handling model
  • go through choo's hooks system
  • bonus: talk about the missing pieces: backpressure cancellation
  • bonus: talk about pull-streams

Related issues

Feedback: Your First App

I'd like to leave this issue here for readers to post feedback about the "Your First App" tutorial. I'm particularly interested in the things that you have to re-read 3 times because it didn't make sense the first two times, or concepts that may have been taken for granted.

Let me know if there's a preferred venue for this kind of feedback than a GH issue.

QA: first app

currently guiding my friend through the first chapter; posting feedback here was we go:

  • explain they should create a new directory for the project so that it's scoped; probs recommend src/$github-username/my-first-choo-project or smth
  • installing choo is apparently hard; perhaps mention npm init --yes and npm install --save choo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.