git ssb

0+

dinoworm 🐛 / campjs-viii-ludditejs



Commit 9493efb7168dd6cc9509e00e6d0b5eec8e50002c

practice

Michael Williams committed on 7/31/2017, 4:03:31 AM
Parent: d6c332a182ee3818f7ba43e380bd7de532155b64

Files changed

NOTES.mdchanged
README.mdchanged
index.htmlchanged
package-lock.jsonchanged
NOTES.mdView
@@ -450,4 +450,27 @@
450450
451451 ## references
452452
453453 - [The Post JavaScript Apocalypse - Douglas Crockford](https://www.youtube.com/watch?v=NPB34lDZj3E)
454 +
455 +---
456 +
457 +like framing
458 +
459 +- here's luddite.js
460 + - we are against centralized committees and decion-making
461 + - gonna show some examples of the luddite way to do things
462 +- there's a centralized committee making JavaScript standards
463 + - it's cool, but it's not the only way
464 + - here's how some people have been doing things for a while now
465 + - anyone can make standards
466 +- here's the committee way to do X
467 + - here's the luddite way to do X
468 +- at the end of the day, programming is supposed to be fun and anyone can play around with fun standards if they want.
469 +
470 +- if you don't use fancy syntax (jsx, etc), you don't need fancy build steps
471 +
472 +- add back es observables vs observ-ables
473 +- move redux to be a quinteesential example of a function signature standard over fancy syntax or library
474 +
475 +- acknowledge that pull streams could be its own talk
476 + - link to actual talks
README.mdView
@@ -1,9 +1,9 @@
11 # luddite.js
22
33 ---
44
5-## hey [CampJS VIII](http://viii.campjs.com)
5 +## hey [CampJS](http://campjs.com)
66
77 i'm [Mikey (@ahdinosaur)](http://dinosaur.is) from [Enspiral](http://enspiral.com)
88
99 <div class="row">
@@ -20,9 +20,9 @@
2020 ???
2121
2222 second time presenting at a conference.
2323
24-i'm going to attack some JavaScript patterns, but i use those patterns too.
24 +i might say negative things about some JavaScript patterns, but i use those patterns too.
2525
2626 everyone in the JavaScript community is doing a wonderful job.
2727
2828 apologies in advance if i disguise any opinions as facts.
@@ -34,25 +34,19 @@
3434 **luddite.js** is _simple decentralized JavaScript_.
3535
3636 ???
3737
38-a study of JavaScript evolution
38 +but really a study of functional JavaScript patterns that have evolved in userland
3939
40-also totally made up
41-
42-JavaScript was good
43-
44-now it's popular
45-
46-here's the beef
47-
4840 ---
4941
5042 ## Luddite?
5143
5244 the [Luddites](https://en.wikipedia.org/wiki/Luddite) was a political movement against _automated centralized technology_.
5345
54-<img src="./luddite.jpeg" />
46 +<div style='display: flex; justify-content: center'>
47 + <img src="./luddite.jpg" height='400' />
48 +</div>
5549
5650 ???
5751
5852 - many Luddites were skilled machine operators in the textile industry
@@ -62,28 +56,31 @@
6256 ---
6357
6458 ## but JavaScript?
6559
66-at the
60 +i'm going to talk about
6761
68-- simple primitives
69-- decentralized userland
62 +- simple functional patterns
63 +- decentralized userland ecosystems
7064
7165 ???
7266
67 +- less coupling to trendy libraries, more function signature conventions: https://twitter.com/jekrb/status/859242655011745793
7368 - top-down standards process
7469 - vs emergent (mad science) bottom-up module ecosystems
7570 - izs pants post
7671
77-## simple primitives
72 +---
7873
74 +## simple functional patterns
75 +
7976 what if i told you...
8077
8178 that you only needed plain functions and objects?
8279
8380 ???
8481
85-- no fancy syntax
82 +- no fancy syntax necessary
8683 - less language clutter
8784
8885 ----
8986
@@ -93,19 +90,11 @@
9390 function fn (...args) { return value }
9491 ```
9592
9693 ```js
97-const fn = (...args) => { return value }
98-```
99-
100-```js
10194 const fn = (...args) => value
10295 ```
10396
104-```js
105-const fn = (...args) => ({ value })
106-```
107-
10897 ---
10998
11099 ## sync function signals
111100
@@ -129,17 +118,8 @@
129118 ```
130119
131120 ---
132121
133-## import / export
134-
135-```js
136-import thing from 'module'
137-import { thing as thingy } from 'module'
138-```
139-
140----
141-
142122 ## require / module.exports =
143123
144124 ```js
145125 const thing = require('module')
@@ -152,8 +132,17 @@
152132 ```
153133
154134 ---
155135
136 +## vs: import / export
137 +
138 +```js
139 +import thing from 'module'
140 +import { thing as thingy } from 'module'
141 +```
142 +
143 +---
144 +
156145 ## hyperscript
157146
158147 ```js
159148 const h = require('react-hyperscript')
@@ -168,8 +157,12 @@
168157 })
169158 }
170159 ```
171160
161 +???
162 +
163 +- `React.createElement` is basically a strict hyperscript without the class/id sugar
164 +
172165 ---
173166
174167 ## vs: hyperx
175168
@@ -194,9 +187,8 @@
194187 </table>`
195188 }
196189 ```
197190
198-
199191 ---
200192
201193 ## vs: jsx
202194
@@ -217,8 +209,26 @@
217209 ```
218210
219211 ---
220212
213 +## redux
214 +
215 +reducer:
216 +
217 +```js
218 +(state, action) => nextState
219 +```
220 +
221 +---
222 +
223 +???
224 +
225 +- actions
226 +- reducers
227 +- global state tree
228 +
229 +---
230 +
221231 ## async function
222232
223233 ```js
224234 const request = require('request')
@@ -236,13 +246,10 @@
236246 ---
237247
238248 ## promise
239249
240-a "promise" is an eventual values
250 +a "promise" is an eventual value
241251
242-
243-a "continuable" is a function that takes a single argument, a node-style (error-1st) callback.
244-
245252 ```js
246253 const promise = new Promise((resolve, reject) => {
247254 // do stuff...
248255 resolve(value)
@@ -303,57 +310,122 @@
303310 ## async errors
304311
305312 with a error-first callback, there are three possible signals:
306313
307-1. programmer error: `throw error`
308-2. value: `cb(null, value)`
309-3. user error: `cb(error)`
314 +1. value: `cb(null, value)`
315 +2. user error: `cb(error)`
316 +3. programmer error: `throw error`
310317
311318 ???
312319
313320 promise errors smush the user and programmer errors together
314321
315322 ---
316323
317-## redux
324 +## pull stream
318325
319326 ???
320327
321-- actions
322-- reducers
323-- global state tree
328 +- [history of streams](http://dominictarr.com/post/145135293917/history-of-streams)
329 +- [pull stream examples](https://github.com/dominictarr/pull-stream-examples)
330 +- [pull streams intro](http://dominictarr.com/post/149248845122/pull-streams-pull-streams-are-a-very-simple)
331 +- [pull stream](https://pull-stream.github.io/)
332 +- [pull stream workshop](https://github.com/pull-stream/pull-stream-workshop)
324333
325334 ---
326335
327-## pull stream
336 +### source
328337
338 +```js
339 +function values (array) {
340 + var i = 0
341 + function read (abort, callback) {
342 + if (abort || i === array.length) cb(true)
343 + else cb(null, array[i++]
344 + }
345 +}
346 +```
347 +
348 +???
349 +
350 +- look ma, just functions!
351 +
329352 ---
330353
331-### source
354 +### sink
332355
333356 ```js
357 +function log (read) {
358 + read(null, function next (err, data) {
359 + if (err) return console.log(err)
360 + console.log(data)
361 + // recursively call read again!
362 + read(null, next)
363 + })
364 +}
365 +```
334366
367 +---
368 +
369 +### through
370 +
371 +```js
372 +function map (mapper) {
373 + // a sink function: accept a source
374 + return function (read) {
375 + // but return another source!
376 + return function (abort, cb) {
377 + read(abort, function (err, data) {
378 + // if the stream has ended, pass that on.
379 + if (err) cb(err)
380 + // apply a mapping to that data
381 + else cb(null, mapper(data))
382 + })
383 + }
384 + }
385 +}
335386 ```
336387
337388 ---
338389
339390 ## pull stream errors
340391
341-with a pull stream callback, there are four possible signals:
392 +with a pull stream source callback, there are four possible signals:
342393
343-1. programmer error: `throw error`
344-2. value: `cb(null, value)`
345-3. user error: `cb(error)`
394 +1. value: `cb(null, value)`
395 +2. user error: `cb(error)`
396 +3. programmer error: `throw error`
346397 4. complete: `cb(true)`
347398
399 +???
348400
401 +- both the source and sink can signal back-pressure ("hey i'm busy") by not calling the respective callback
402 +
349403 ---
350404
351405 ## stories
352406
353407 ---
354408
355409 ### catstack
356410
411 +build a framework alone from scratch
412 +
413 +learnings:
414 +
415 +- choose your battles
416 +- one person team is anti-pattern
417 +
418 +???
419 +
420 +reinvent all the wheels!
421 +
357422 ---
358423
359-### patch\*
424 +### patch ecosystem
425 +
426 +build an app with others, bring-your-own framework modules
427 +
428 +learnings:
429 +
430 +- do what you think #SomebodyShould do
431 +- collaborate with active listening and empathy
index.htmlView
The diff is too large to show. Use a local git client to view these changes.
Old file size: 882726 bytes
New file size: 884348 bytes
package-lock.jsonView
@@ -1,6 +1,6 @@
11 {
2- "name": "ludditejs",
2 + "name": "campjs-viii-ludditejs",
33 "version": "0.0.0",
44 "lockfileVersion": 1,
55 "requires": true,
66 "dependencies": {

Built with git-ssb-web