-
Notifications
You must be signed in to change notification settings - Fork 796
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
Second edition: ES2015 #218
Comments
Hey @addyosmani |
Hi @addyosmani , |
Your book is one of the best resources on the internet for learning JS deeply; I referred many of my students towards it but have shied away lately because it is out of date as you say. For people learning, I think having ES5 / ES6+ side-by-side would be the best path for right now. That's how I teach it. In fact I actually show jQuery, ES5, ES6+ when I can - showing the arc of what people will see out in the real world. |
Thanks for the input folks. Some ideas for next steps here. Evaluate:
- What are patterns in the book that no longer hold true/useful in an
ES2015+ world? We can add a note to this affect under each one qualifying.
- What are ES2015+ patterns the book is missing?
- What other considerations should we keep in mind? A lot has changed in
the JS landscape over the last few years, including a shift to slightly
more functional programming and state management. Figuring out where to
draw the line in topics for this next edition would help I think.
…On Dec 19, 2017 8:42 AM, "John Serrao" ***@***.***> wrote:
Your book is one of the best resources on the internet for learning JS
deeply; I referred many of my students towards it but have shied away
lately because it is out of date as you say.
For people learning, I think having ES5 / ES6+ side-by-side would be the
best path for right now. That's how I teach it. In fact I actually show
jQuery, ES5, ES6+ when I can - showing the arc of what people will see out
in the real world.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#218 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGxaUhd90WTewY-q3rDx3lRfpryWvpLks5tB-dxgaJpZM4QjIGs>
.
|
I'll make some time to go back through the book tomorrow in-depth and make some constructive comments for you. |
I don't know if this type of feedback helps, but here is an example of what I did with your constructor JS stuff. Could be a model for how to do the ES5/ES6+ showcase.
|
@addyosmani - some feedback after a review of the book -I'm not really sure how much decorators would be used in a world where we have classes / subclasses now. They just seem outdated. I think ES6 classes might need a whole section to be explained. How they impact singletons is significant. -This might get confusing, but it could be interesting to try to explain the new Array methods (like map, reduce, etc) as facades or iterators related to for/forEach. That's how I think of them in my head. A similar approach for promises & async / await might also be useful. -Modular JS section needs the ES6 module info added, and probably some info on doing ES5 transpiling. -The whole back part of the book where you take apart jQuery methods to explain the design patterns was extremely powerful the first time I read it. It's really what made the whole book click for me. But I'm old at this point and jQuery isn't as widely used as it was back then. It makes me think this whole section has to go at some point. -Something more generic around plugin creation that adopts the idea of modular code structure would be welcome. That section feels old when I reread it now. -I wonder if younger developers would benefit from a take down of React patterns like you did for jQuery, undressing their approach in design or maybe recommending how design patterns would relate to structuring a React app. It would kind of make sense as a transition out of the MV* stuff. |
@jserrao regarding decorators, there is a new decorator syntax proposal. It is stage 2, so I think it would be useful to show how to decorate classes and functions with it https://github.com/tc39/proposal-decorators Another useful thing will be a reactive patterns. It may include examples of rxjs or something else. Maybe also state management patterns (Flux, Redux etc.) |
All of this detailed, insightful feedback is incredibly helpful. Thanks
John!
I agree with pretty much all of the points you raised.
Transitioning from the jQuery patterns section to one based on React could
certainly also be valuable if well scoped.
Decorators: closest modern change in that direction is the ES Decorators
proposal, however I would be skeptical of capturing patterns for something
that isn't a standard too much just yet.
…On Wed, Dec 20, 2017 at 8:14 AM John Serrao ***@***.***> wrote:
@addyosmani <https://github.com/addyosmani> - some feedback after a
review of the book
-I'm not really sure how much decorators would be used in a world where we
have classes / subclasses now. They just seem outdated. I think ES6 classes
might need a whole section to be explained. How they impact singletons is
significant.
-This might get confusing, but it could be interesting to try to explain
the new Array methods (like map, reduce, etc) as facades or iterators
related to for/forEach. That's how I think of them in my head. A similar
approach for promises & async / await might also be useful.
-Modular JS section needs the ES6 module info added, and probably some
info on doing ES5 transpiling.
-The whole back part of the book where you take apart jQuery methods to
explain the design patterns was extremely powerful the first time I read
it. It's really what made the whole book click for me. But I'm old at this
point and jQuery isn't as widely used as it was back then. It makes me
think this whole section has to go at some point.
-Something more generic around plugin creation that adopts the idea of
modular code structure would be welcome. That section feels old when I
reread it now.
-I wonder if younger developers would benefit from a take down of React
patterns like you did for jQuery, undressing their approach in design or
maybe recommending how design patterns would relate to structuring a React
app. It would kind of make sense as a transition out of the MV* stuff.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#218 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGxaUNOPMTmZshHEp4k0stjh1DmTeAyks5tCRZcgaJpZM4QjIGs>
.
|
State management would be a strong addition. Rx worth considering on the
reactive patterns bit.
…On Wed, Dec 20, 2017 at 8:33 AM Addy Osmani ***@***.***> wrote:
All of this detailed, insightful feedback is incredibly helpful. Thanks
John!
I agree with pretty much all of the points you raised.
Transitioning from the jQuery patterns section to one based on React could
certainly also be valuable if well scoped.
Decorators: closest modern change in that direction is the ES Decorators
proposal, however I would be skeptical of capturing patterns for something
that isn't a standard too much just yet.
On Wed, Dec 20, 2017 at 8:14 AM John Serrao ***@***.***>
wrote:
> @addyosmani <https://github.com/addyosmani> - some feedback after a
> review of the book
>
> -I'm not really sure how much decorators would be used in a world where
> we have classes / subclasses now. They just seem outdated. I think ES6
> classes might need a whole section to be explained. How they impact
> singletons is significant.
>
> -This might get confusing, but it could be interesting to try to explain
> the new Array methods (like map, reduce, etc) as facades or iterators
> related to for/forEach. That's how I think of them in my head. A similar
> approach for promises & async / await might also be useful.
>
> -Modular JS section needs the ES6 module info added, and probably some
> info on doing ES5 transpiling.
>
> -The whole back part of the book where you take apart jQuery methods to
> explain the design patterns was extremely powerful the first time I read
> it. It's really what made the whole book click for me. But I'm old at this
> point and jQuery isn't as widely used as it was back then. It makes me
> think this whole section has to go at some point.
>
> -Something more generic around plugin creation that adopts the idea of
> modular code structure would be welcome. That section feels old when I
> reread it now.
>
> -I wonder if younger developers would benefit from a take down of React
> patterns like you did for jQuery, undressing their approach in design or
> maybe recommending how design patterns would relate to structuring a React
> app. It would kind of make sense as a transition out of the MV* stuff.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#218 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAGxaUNOPMTmZshHEp4k0stjh1DmTeAyks5tCRZcgaJpZM4QjIGs>
> .
>
|
@addyosmani Also there are few |
Also for AJAX based section , there is jQuery API calls , we can try using |
@addyosmani |
For big React/Preact apps, |
@addyosmani - React design patterns, could be the start of redoing that big jQuery section towards the back of the book: http://lucasmreis.github.io/blog/simple-react-patterns/ |
@jserrao With a number of developers starting to shift away from jQuery, I have been wondering whether it's worth showing off simple framework patterns. As @destromas1 noted, there are quite a few out there in the React ecosystem (like HOCs etc) that we could include. The main thing I'm wondering is how evergreen / relevant those sections would be in 2-3 years. Definitely something to think about. |
An update on..updating the book :) @guar47 is taking a first-pass at extracting and porting over each of the patterns to ES2015. Part of this exercise will help identify where some patterns need a bigger overhaul (e.g anything to do with the module pattern switching over to ES Modules). We're going to work on this as a single PR. If anyone is interested in helping out with reviews, feel free to drop comments into #220 as we work along. @forforeach @jserrao etal. your input is more than welcome. At the end of this round, I think we'll have a better understanding of a few things:
|
@addyosmani |
Over the last two years one of the biggest pieces of feedback we’ve had on the book is that everyone would like a version that is updated to use ES2015+. There are a few different approaches we could take to this work in but I would like to explore starting on this soon.
Conversion of existing patterns to ES2015
One option would be a direct conversion of all code snippets to use ES2015 syntax. This could in part be done with Lebab.io with manual tweaks. Its perhaps the easiest initial option for getting to the goal. We need to decide whether the book includes both ES5 and ES2015 snippets or just the latter.
One argument for including both is that beginners often reading this book have come from a course or level of experience that hasn't really touched on ES2015 syntax all that much - we could initially include both to cater for different audiences. Interested in any perspectives folks have on this.
Full re-evaluation of patterns for an ES2015, ES2016+ world
The next option is that we reevaluate all of the different patterns in this book and try to ascertain if they still make sense in an ES2015 world. Most should.. but some may very well not. We might also want to document ES Modules or class patterns now that they are in the language.
In my daily work, we often also run into lots of patterns where using language features like
async
/await
can subtly have an impact on how code gets structured. I'm unsure just yet on how much we might do this for the book, but it's something I've got in the back of my mind right now.This larger re-evaluation effort is something we could either do after the initial ES2015+ port or instead of it.
When
I may try to tackle some of this rewrite over the Christmas break this year. If anyone would be interested in contributing to this effort help is always very welcome. Even if you're unable to contribute, I'm keen to understand what folks would like out of an ES2015 version so we can plan out that work accordingly.
Thanks!
The text was updated successfully, but these errors were encountered: