A free book that talks about design patterns/techniques used while developing with React.

Comments
  • npm scripts fail with path/command on windows

    npm scripts fail with path/command on windows

    On windows it seems impossible to run the npm scripts. It looks like this has to do with the paths in the scripts in package.json.

    Error:

    '..' is not recognized as an internal or external command, operable program or batch file.

    npm ERR! Windows_NT 10.0.10586 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build" npm ERR! node v4.4.7 npm ERR! npm v2.15.8 npm ERR! code ELIFECYCLE npm ERR! [email protected] build: ../../node_modules/.bin/browserify ./src/app.jsx -o ./public/app.js -t babelify npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] build script '../../node_modules/.bin/browserify ./src/app.jsx -o ./public/app.js -t babelify'. npm ERR! This is most likely a problem with the react-app package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! ../../node_modules/.bin/browserify ./src/app.jsx -o ./public/app.js -t babelify npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs react-app npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls react-app npm ERR! There is likely additional logging output above.

    I found a very old issue with the same problem: https://github.com/npm/npm/issues/2576

    The solution, removing the path, is not working of course. This has to do with the folder structure used in this repo.

    npm-debug.log

    _0 info it worked if it ends with ok 1 verbose cli [ 'C:\Program Files\nodejs\node.exe', 1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'build' ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info prebuild [email protected] 6 info build [email protected] 7 verbose unsafe-perm in lifecycle true 8 info [email protected] Failed to exec build script 9 verbose stack Error: [email protected] build: browserify ./src/app.jsx -o ./public/app.js -t babelify 9 verbose stack Exit status 1 9 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:217:16) 9 verbose stack at emitTwo (events.js:87:13) 9 verbose stack at EventEmitter.emit (events.js:172:7) 9 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14) 9 verbose stack at emitTwo (events.js:87:13) 9 verbose stack at ChildProcess.emit (events.js:172:7) 9 verbose stack at maybeClose (internal/child_process.js:827:16) 9 verbose stack at Process.ChildProcess.handle.onexit (internal/child_process.js:211:5) 10 verbose pkgid [email protected] 11 verbose cwd D:\Workspaces\Git\react-in-patterns\patterns\composition 12 error Windows_NT 10.0.10586 13 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "build" 14 error node v4.4.7 15 error npm v2.15.8 16 error code ELIFECYCLE 17 error [email protected] build: browserify ./src/app.jsx -o ./public/app.js -t babelify 17 error Exit status 1 18 error Failed at the [email protected] build script 'browserify ./src/app.jsx -o ./public/app.js -t babelify'. 18 error This is most likely a problem with the react-app package, 18 error not with npm itself. 18 error Tell the author that this fails on your system: 18 error browserify ./src/app.jsx -o ./public/app.js -t babelify 18 error You can get information on how to open an issue for this project with: 18 error npm bugs react-app 18 error Or if that isn't available, you can get their info via: 18 error 18 error npm owner ls react-app 18 error There is likely additional logging output above. 19 verbose exit [ 1, true ]

    opened by Tarabass 7
  • DI examples powered by InversifyJS?

    DI examples powered by InversifyJS?

    Hi,

    I fund this repo on twitter because some users mentioned InversifyJS I keep an eye on mentions to InversifyJS because I'm it main author.

    Would you be interested in adding examples to the dependency-injection page about DI in react powered by InversifyJS?

    You can find some real use cases here and here.

    If you think you would like it I can prepare a PR.

    Thanks!

    opened by remojansen 7
  • One-way direction data flow question

    One-way direction data flow question

    In 'One-way direction data flow', Store provides subscription for change. Does Store also need to implement unsubscription for component App to call it inside componentWillUnmount to unsubscribe?

    opened by thanhvg 4
  • Can i help translate this repo to Vietnamese for support our community

    Can i help translate this repo to Vietnamese for support our community

    Hi mates

    I really excited and wanna translate this repo to Vietnamese for help our React developer community in Vietnam Can i create new pull request or fork new repo 💃

    opened by hprobotic 4
  • High-order component example does not return the enhanced component

    High-order component example does not return the enhanced component

    In the High-order example, it seems we forget to return the enhanced component.

    var enhanceComponent = (Component) => {
      class Enhance extends React.Component {
        render () {
          return (
            <Component {...this.props} />
          )
        }
      }
      
      // should we return the component here?
      return Enhance;
    }
    
    opened by dennisXZX 3
  • Broken link

    Broken link

    opened by SangKa 3
  • Fix some Grammar/Typo issues

    Fix some Grammar/Typo issues

    I recently read your book and I really like it! I spotted some grammar issues and typos here and there. These commits fix the ones I found. Also some parts sounded a bit weird, I corrected these aswell.

    I'm sure though that there are more typos/grammar issues that I overlooked so I definitely suggest that you run this through a tool like Word that helps you in finding the issues and fixing them. It would make the reading experience a lot more pleasant.

    opened by panmona 3
  • Children is  a JSX expression

    Children is a JSX expression

    When I use a JSX expression as children, I got the warning..

    ...
    const record = {
          title: 'foo',
          status: 'bar',
    };
    return (
      <Record>{record}</Record>
    );
    

    warning is like this:

    Warning: Failed prop type: Invalid prop `children` of type `object` supplied to `Record`, expected a single ReactElement.
    

    React version is 16.2.0 can you help me??

    opened by horizon0514 3
  • Children in JSX

    Children in JSX

    Refering to : https://github.com/krasimir/react-in-patterns/tree/master/patterns/children-in-jsx

    I think:

            <i className='something-else'>
              { props.children }
            </i>
    

    Should be :

            <i className='something-else' children={children}/>
    

    Note that they are not equivalent. First one creates new children with a single item, the second one reuses the children. I've heard issues with the first pattern e.g. keys/ids confused React. Don't have an issue report as the second syntax fixed it :rose:

    opened by basarat 3
  • Communication pattern changes

    Communication pattern changes

    Hi Saw your repo on Hacker News; Wanted to help a bit

    • Changed the onClick on the communication patter files to not bind on every click but use it on constructor (it is considered a good practice)
    • Changed the order of the methods, render should be the last method called in a react component, handlers and other things should be up.
    • Remove extra spaces on curly braces and so (this will help if you consider adding ESLint to the flow later)
    opened by davixyz 3
  • In Chapter 8, the mixins link does not contain the content

    In Chapter 8, the mixins link does not contain the content

    opened by pakaponk 2
  • GitBook links no longer work

    GitBook links no longer work

    Great book, thank you for writing it!

    I've noticed that the GitBook links no longer work - none of the downloadable options work and neither is the link in the "About" section. Can still read everything on here, obviously, but perhaps these can be fixed as I understand GitBook has gone through some major changes recently but is still free for personal projects. Alternatively, there is a free GitBook-inspired option you could move the book to: https://github.com/filipowm/BooGi .

    opened by nina-py 0
  • Small typo in second section of Chapter 10 (plus Summary and repo Readme)

    Small typo in second section of Chapter 10 (plus Summary and repo Readme)

    The second section of Chapter 10 reads:

    Using React's context (prior v. 16.3)

    Since prior is an adjective (or noun), one of these would probably read better for the part in parentheses:

    1. prior to v. 16.3
    2. below v. 16.3 (this would align with "v. 16.3 and above" in the next section)
    3. before v. 16.3

    Whichever change is chosen, the same change would be needed in Chapter 10 itself (book/chapter-10/README.md), the Summary (book/SUMMARY.md), and the Content section of the repo readme (README.md).

    opened by jdsandifer 0
  • Flux Utils

    Flux Utils

    I didn't see a mention of Flux Util's(https://facebook.github.io/flux/docs/flux-utils.html) which seems like one of the least boilerplate implementations of Flux, and provided by facebook.

    You allude to this kind of solution in "Using a helper", but dismiss it because "may decide to switch to another Flux provider". That rationale is quite bizarre, I think 99.99% of applications will not be, and should not be, switching Flux providers.

    Would like to hear your opinion on using Flux-Util's ReduceStore with Containers

    opened by patelnav 1
  • Using HTML Entities/Special Characters

    Using HTML Entities/Special Characters

    Use String.fromCharCode() for special characters.

    // bad
    <div>John · Doe</div>
    
    // nope
    <div>John &middot; Doe</div>
    
    // good
    <div>{'John ' + String.fromCharCode(183) + ' Doe'}</div>
    
    // better
    <div>{`John ${String.fromCharCode(183)} Doe`}</div>
    
    // Unicode
    <i data-icon={String.fromCharCode(0xf00f)} />
    
    // or if you have it as a string for some reason
    <i data-icon={String.fromCharCode(parseInt('f00f', 16))} />
    
    opened by pivanov 2
  • Dependency Injection using .defaultProps

    Dependency Injection using .defaultProps

    I've created a gist that shows how DI could be solved for cases using only React features: https://gist.github.com/topa/efd6b170e18bda579aa751c5164f9211.

    Do you think this could be also a valid approach?

    This won't work with isomorphic apps as you'll have to initialize .getAppLocale() while bootstrapping the app either on server (e.g. in express Apps req.locale ) as on client (using window.navigator).

    opened by topa 1
Owner
Krasimir Tsonev
I'm a blogger, who writes and speaks. I love open source and I code awesome stuff.
Krasimir Tsonev
AweSome Book App displays the book details entered by user and saves the information in Local storage. User can add and remove a book title/author to the library and from the library.

Awesome Book App with ES6 Used npm init -y command to create package.json file. Created the entry point for the JavaScript code called index.js Create

Krishna Prasad Acharya 8 Aug 15, 2022
This is a single page web application that keeps tracks of books. Book details captured are the book title, author and ISBN. User can add a book, view a list of books and also remove any un wanted books.

Project Name This is a single page web application that keeps tracks of books. Book details captured are the book title, author and ISBN. User can add

Olivier 6 Nov 20, 2022
:books: The definitive guide to TypeScript and possibly the best TypeScript book :book:. Free and Open Source 🌹

TypeScript Deep Dive I've been looking at the issues that turn up commonly when people start using TypeScript. This is based on the lessons from Stack

Basarat Ali Syed 18.7k Jan 4, 2023
A repository demonstrating functional techniques with C# 10 and the similarities between JavaScript, TypeScript, and C#.

Building up from JavaScript to TypeScript to C# 10 and .NET 6 This repository is meant to highlight some of the various functional techniques availabl

Charles Chen 67 Dec 30, 2022
An ongoing curated list of frameworks, books, articles, talks, screencasts, recordings, libraries, learning tutorials and shiny resources about Javascript Development.

Javascript Frameworks Development Welcome to the world of Javascript Frameworks. An ongoing curated list of frameworks, books, articles, talks, screen

Paul Veillard 3 Jul 31, 2022
A useful list of must-watch talks about JavaScript

Must-Watch JavaScript This is a collection of well-received talks about JavaScript, covering topics such as ES6/ES2015, JavaScript frameworks, client-

Matt Smith 6.8k Jan 4, 2023
this is a single-page web application. we built a book website where the user can add , remove and display books. we used modules to implement these functionalities. also, we used the Date class to display the date and time.

Awsome Books In this Project, we have built A Books websites. Built With ?? HTML CSS javascript Git & Github Live Demo Here you can find the live Demo

Nedjwa Bouraiou 10 Aug 3, 2022
Open Source projects are a project to improve your JavaScript knowledge with JavaScript documentation, design patterns, books, playlists.

It is a project I am trying to list the repos that have received thousands of stars on Github and deemed useful by the JavaScript community. It's a gi

Cihat Salik 22 Aug 14, 2022
Open source privacy notice design patterns.

Design-first privacy notice template The Juro Privacy Notice is an open source project by https://juro.com and https://stefaniapassera.com/. A couple

Juro 159 Nov 10, 2022
A complete guide for learning Object Oriented Programming Pillars, SOLID Principles and Design Patterns with TypeScript!

Object Oriented Programming Expert With TypeScript This repository is a complete guide and tutorial for the principles and techniques of object-orient

Ahmad Jafari 44 Dec 29, 2022
Learn design patterns through games with TypeScript and Phaser 🕹️

Welcome to Design patterns gamified! I created this repo to teach design patterns through games. Each folder contains a tiny game that demonstrates ho

Paula Santamaría 41 Nov 10, 2022
Playground for studying design patterns, solid principles, GoF, testing and more with TypeScript

TypeScript design patterns study Playground for studying design patterns, solid principles, GoF, testing and more with TypeScript Index TypeScript des

Lucas Souza 9 Dec 9, 2022
This is another Express + TypeScript + DDD (Domain Driven Design patterns) + IoC/DI (Inversion of control and Dependency injection) + Primsa ORM + API REST boilerplate.

Express-TS-DDD REST API This is another Express + TypeScript + DDD (Domain Driven Design patterns) + IoC/DI (Inversion of control and Dependency injec

J.D. 6 Nov 3, 2022
These are examples of design patterns for FE projects.

Design Pattern For FE These are examples of design patterns for FE projects. Design Pattern Useds Topic Reference Adaper Tutorialspoint Factory Tutori

thuannguyenegany 3 Oct 6, 2022
The PatternFly Design Kit is a Sketch library used for creating PatternFly accurate design mockups

PatternFly Design Kit The PatternFly Design Kit is a collection of Sketch assets that make it easy for designers to create high-fidelity design mockup

PatternFly 44 Jan 2, 2023
This is an app developed in the Microverse course, it is a simple app used for developing a task list, using JavaScript modules and webpack

TODO LIST This is an app developed in the microverse course, developing a task list, using Javascript modules and webpack A simple app to help you man

JUSTINE IMASIKU 5 Jul 28, 2022
The Bookstore is a website that allows the user to :display a list of books , Add a book and remove a selected book.

Book Store The Bookstore is a website that allows the user to : -Display a list of books. -Add a book. -Remove a selected book. Built With ?? Basic CS

Nedjwa Bouraiou 4 Sep 6, 2022
BookStore is a website that allows a given user to view a list of books, to add a new book and remove a given book.

Project Name : BookStore CMS BookStore is a website that allows a given user to view a list of books, to add a new book and remove a given book. In or

Chris Siku 10 Aug 22, 2022
This is an app that displays a list of books, allow users add a book and remove a selected book.

BookStore This is an app that displays a list of books, allow users add a book and remove a selected book. Built With HTML CSS -React -Redux -JavaScri

ABDUL ALI 5 Jul 22, 2022