CodeHubOrg / discussions

Discussion board for CodeHub Bristol
2 stars 2 forks source link

JS101 Session 19 April - Promises, Redux, hacking on our project #21

Open katjad opened 8 years ago

katjad commented 8 years ago

We discussed several things today, mostly concerning the app we are working on together (organisations database).

@mjg17 gave a presentation about how he had started implementing the back end for the app with LokiJS, using ES6 and Promises. This then turned into a sort of challenge to understand how the chain of promises was being executed. A major point was to recognize that the 'save' step had to be wrapped in an anonymous function for the 'this' object to be bound properly (hope I got this right). Check Michael's post here: #20

@me--2014 has updated her slides from last session and put them online here: https://github.com/CodeHubOrg/discussions/issues/19#issuecomment-211818884

@rinse0ut made the point that we should strive to use ES2015 to write the app, as it is makes for cleaner and concise code. He also suggested that people should take on certain tasks, to be followed up, so there is better coordination of the work. Another suggestion was to do a 'hacking' session where we work on the app together, possibly with pair programming, to get the development going. Everybody found this a good idea so we decided to make next session into a pure 'hacking on the app' session, no talks.

The plan is now: 3 May - Hacking session 17 May - Short presentations on D3js (@wingedeel) and Scope and Closures (@gicela and @katjad)

In terms of tasks, some interests people have: @wingedeel map with d3js, @mjg17 backend, @katjad tooling (webpack), @rinse0ut Redux architecture

We decided that we would use Redux for the app architecture; currently it is Flux so will have to be rewritten. @rinse0ut is going to provide some links to familiarise yourself. He has tried out Redux for his Scrabble word filter -> https://github.com/CodeHubOrg/react-playpen/tree/master/usr/rinse0ut/scrabble/redux; running npm install and npm start in this directory gives you a working app

Other projects: @rinse0ut continued working on the Scrabble world filter; I have pushed the start of a 'turtles drawing on canvas' project to the React playpen although it has no React in it yet :) I liked using a lot of concepts I had come across previously; I have however not made the switch to ES6 yet

Another interesting thing discussed: Doing internships as a possible way into employment in web development. And despite the talking we also did about an hour of coding.

Also welcome Cheryl who was at the group for the first time. - And thanks everybody for their contributions!

@mattpill @marckimbrey

rinse0ut commented 8 years ago

Thanks for the great write up Katja!

I would recommend firstly reading the Redux docs intro and basic chapters to get a quick overview about Redux and it's main elements:

http://redux.js.org/index.html

Egghead.io have a free video series on Redux by it's creator Dan Abramov. It's well explained and goes into Redux in depth along with ES6 features and how to keep things immutable!

https://egghead.io/series/getting-started-with-redux

As part of this series he recommends separating components into presentation and container components, which I think is a great idea for the app. See the video links are below for further info:

https://egghead.io/lessons/javascript-redux-extracting-presentational-components-todo-todolist?series=getting-started-with-redux https://egghead.io/lessons/javascript-redux-extracting-container-components-filterlink?series=getting-started-with-redux

The github repo has several examples which are worth running and having a read of the code:

https://github.com/reactjs/redux

Here is a video of Dan Abramov's talk on Hot reloading and time travel 😎

https://www.youtube.com/watch?v=xsSnOQynTHs

Also as previously mentioned in todays meeting (and found in the discussions from months ago) there are some really well explained and cool videos by FunFunFunction on functional programming. The series includes higher order functions (map, filter, reduce), closures, currying and promises. Well worth the watch.

https://www.youtube.com/watch?v=BMUiFMZr7vk&list=PL0zVEGEvSaeEd9hlmCXrk5yUyqUag-n84

If that wasn't enough links I also found this on on more React Redux and other helpful links (ES6, functional programming, tools etc) on hacker news!

https://github.com/markerikson/react-redux-links

On 20 April 2016 at 02:04, Katja Durrani notifications@github.com wrote:

We discussed several things today, mostly concerning the app we are working on together (organisations database).

@mjg17 https://github.com/mjg17 gave a presentation about how he had started implementing the back end for the app with LokiJS http://lokijs.org, using ES6 and Promises. This then turned into a sort of challenge to understand how the chain of promises was being executed. A major point was to recognize that the 'save' step had to be wrapped in an anonymous function for the 'this' object to be bound properly (hope I got this right). Check Michael's post here: #20 https://github.com/CodeHubOrg/discussions/issues/20

Amy has updated her slides from last session and put them online here: #19 (comment) https://github.com/CodeHubOrg/discussions/issues/19#issuecomment-211818884

@rinse0ut https://github.com/rinse0ut made the point that we should strive to use ES2015 to write the app, as it is makes for cleaner and concise code. He also suggested that people should take on certain tasks, to be followed up, so there is better coordination of the work. Another suggestion was to do a 'hacking' session where we work on the app together, possibly with pair programming, to get the development going. Everybody found this a good idea so we decided to make next session into a pure 'hacking on the app' session, no talks.

The plan is now: 3 May - Hacking session 17 May - Short presentations on D3js (@wingedeel https://github.com/wingedeel) and Scope and Closures (@gicela https://github.com/gicela and @katjad https://github.com/katjad)

In terms of tasks, some interests people have: @wingedeel https://github.com/wingedeel map with d3js, @mjg17 https://github.com/mjg17 backend, @katjad https://github.com/katjad tooling (webpack), @rinse0ut https://github.com/rinse0ut Redux architecture

We decided that we would use Redux for the app architecture; currently it is Flux so will have to be rewritten. @rinse0ut https://github.com/rinse0ut is going to provide some links to familiarise yourself. He has tried out Redux for his Scrabble word filter, which can be built running npm install and npm start from this directory https://github.com/CodeHubOrg/react-playpen/tree/master/usr/rinse0ut/scrabble/redux

Other projects: @rinse0ut https://github.com/rinse0ut continued working on the Scrabble world filter; I have pushed a little project to the React playpen https://github.com/CodeHubOrg/react-playpen which however has no React in it yet :) I liked using a lot of concepts I had come across previously; I have however not made the switch to ES6 yet

Another interesting thing discussed: Doing internships as a possible way into employment in web development.

Also welcome Cheryl who was at the group for the first time. - And thanks everybody for their contributions!

β€” You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/CodeHubOrg/discussions/issues/21

me--2014 commented 8 years ago

Hi @katjad and @rinse0ut - I said I'd look at whether I could make it to the hack event on Tuesday. I'm afraid it's turning into a busy week next week and I don't think I'll fit it in. But maybe next time something similar comes along we could form a team? Also looking forward to our own little hack event - this morning I finally got round to doing some React in my own time, hooray! Amy

katjad commented 8 years ago

@me--2014 @rinse0ut The hack night I meant is run by Simpleweb and it's only the week after, on Wednesday http://meetu.ps/e/BrFq5/1nxBB/d Is that week better? Would be great if you can make it.

P.S. Great about React. - I've managed to read the first React-Redux link since Tuesday. A start :)

(I accidentally closed this thread before, as I tried posting from my phone - in case you wonder ;) )

rinse0ut commented 8 years ago

A step by step redux tutorial: http://blog.tighten.co/react-101-using-redux?utm_source=twitter&utm_medium=social&utm_campaign=tweetPosts

me--2014 commented 8 years ago

Hiya! Yes turns out that would work for me so I am keen to do it. I hope I don't hold you back though!!

me--2014 commented 8 years ago

@katjad @rinse0ut

p.s. sorry it's taken me so long to reply (I get the notifications to an email account which I don't check all that regularly)

rinse0ut commented 8 years ago

Great news! I love it when a plan comes together. Let's get thinking about some ideas! On 28 Apr 2016 10:25 a.m., "Amy" notifications@github.com wrote:

@katjad https://github.com/katjad @rinse0ut https://github.com/rinse0ut

p.s. sorry it's taken me so long to reply (I get the notifications to an email account which I don't check all that regularly)

β€” You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/CodeHubOrg/discussions/issues/21#issuecomment-215364636

me--2014 commented 8 years ago

Great stuff! I'm away this weekend (in lovely yorkshire with the parents-in-law) but will get my thinking cap on while I'm there!

katjad commented 8 years ago

Yay that's great! Are we all on one team then @rinse0ut? Have a great time in Yorkshire @me--2014 . I'll also see my parents-in-law :) - but in Birmingham and only for one day. In any case I hope to think up some ideas. Looking forward to chat about it on Tuesday.

rinse0ut commented 8 years ago

Yes same team. I've RSPV'd with +2 for our team. I'm by Sheffield doing Push Hands this weekend. Have a good one! On 28 Apr 2016 12:08 p.m., "Katja Durrani" notifications@github.com wrote:

Yay that's great! Are we all on one team then @rinse0ut https://github.com/rinse0ut? - Have a great time in Yorkshire @me--2014 https://github.com/me--2014 . I'll also see my parents-in-law :) - but in Birmingham and only for one day. In any case I hope to be able to think up some ideas. Looking forward to chat about it on Tuesday.

β€” You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/CodeHubOrg/discussions/issues/21#issuecomment-215390614

katjad commented 8 years ago

Some more on React-Redux..

I have been ploughing through the egghead videos typing in the examples - sometimes hitting roadblocks even just getting all the right libraries in (I did it as standalone libraries in this case, no bundlers). I am at 10th video now, I don't know if I will ever manage to get through all of them at that pace, perhaps I should just resort to watching for a while. In any case I found this repository where somebody has published all the code for the videos with annotations. https://github.com/dwyl/learn-redux/blob/master/egghead.io_video_tutorial_notes.md Perhaps of interest to others, too.

Yesterday I went to the BristolJS meetup on React which unfortunately was totally oversubscribed. They will however put the videos up. I think the talks were very good. Both speakers thought it was good to learn React just for the concepts, even if you didn't use it in the end, which is how I feel too. Redux was also mentioned a few times, and the benefits of writing pure functions etc. They both showed quite a bit of code, one more the ES5, the other the ES6 version which was good, too.

rinse0ut commented 8 years ago

I would recommend just watching them and having a play with the to-do MVC example:

https://github.com/reactjs/redux/tree/master/examples/todomvc

I have written the tests for our hack session based on this and our application will be very similar.

It would be good to have a quick grok at the actions, reducers, components and ES6 syntax in preparation for the hack! On 28 Apr 2016 12:32 p.m., "Katja Durrani" notifications@github.com wrote:

I have been ploughing through the egghead videos typing in the examples - sometimes hitting roadblocks even just getting all the right libraries in (I did it as standalone links). I am at 10th video now, I don't know if I will ever manage to get through all of them at that pace, perhaps I should just resort to watching for a while. In any case I found this repository where somebody has published all the code for the videos with annotations. https://github.com/dwyl/learn-redux/blob/master/egghead.io_video_tutorial_notes.md Perhaps of interest to others, too.

Yesterday I went to the BristolJS meetup on React which unfortunately was totally oversubscribed. They will however put the videos up. I think the talks were very good. Both speakers thought it was good to learn React just for the concepts, even if you didn't use it in the end, which is how I feel too. Redux was also mentioned a few times, and the benefits of writing pure functions etc. They both showed quite a bit of code, one more the ES5, the other the ES6 version which was good, too.

β€” You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/CodeHubOrg/discussions/issues/21#issuecomment-215394988

katjad commented 8 years ago

I think it was good for me recreating the examples actually, it sounded too negative above. Other times I just binge watched videos and thought I understood, when that wasn't the case. But I think I need to find a balance :) I will definitely check out the todomvc - when they named that they clearly weren't away redux was coming, well nobody was of course ;)