Code Monkey home page Code Monkey logo

react-express's Introduction

React Express

A guide and reference for learning React.

The production deployment of this app is running here: https://www.react.express.

Written by Devin Abbott (@dvnabbott).

Development

Installation

yarn

Running development server

yarn dev

Building and running production server

yarn build
yarn start

react-express's People

Contributors

behrends avatar cshg avatar dabbott avatar dependabot[bot] avatar dev99problems avatar emiaj avatar faridsafi avatar gabergg avatar gdowens avatar hackerkid avatar hramos avatar jkomyno avatar joestrouth1 avatar jozsefs avatar kittygiraudel avatar klaumann avatar macxim avatar me-shaon avatar msyleung avatar nikolasburk avatar slightlyoffbeat avatar xennygrimmato avatar youbiak 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-express's Issues

Babel page grammar error

Babel enables debugging of the the original source code by including source maps with the compiled JavaScript. JavaScript interpreters will run the compiled code, but map it to the source code in the debugger so that you can debug the source code instead of the (generally quite ugly) compiled output.

Routing?

I'm wondering if a section on routing options would be in scope for this project. Seems like it would fit well before the "Data Management" section in the table of contents.

Include Dark Theme

I am accustomed to read in dark mode. This made my eye sensitive to light mode! :)

Highlight important parts in the code

Would it be possible to highlight the parts in the code that are being focussed on in the section?
A few times there is a lot of code including styles around the one or two lines of code that is being talked about. For example, in Rendering with ternary -

{subtitle ? (
          <h2 style={styles.subtitle}>{subtitle}</h2>
        ) : (
          <h3 style={styles.empty}>No subtitle</h3>
        )}

this is the part that should attract the reader's focus, but it blends in with 50 other lines of code.

Misc things to add before launch

For mobile: add overflow: auto and image maxWidth: 100% so page doesn't overflow (the dev tools setup with ghetto code blocks)

Mention PureComponent and sfc in React Top-Level API

Actually explain Input handling example

"Setup & Build Tools" doesn't explain the crucial development/production difference

Like many beginner-oriented tutorials, it doesn't mention the difference between development and production builds. Unfortunately, this leads to people shipping development builds to production.

If the guide only used Create React App, this would not be a large problem since CRA strictly divides development (npm start) and production (npm run build) environments. However this is a section that tries to explain Webpack/Babel alone. I'm worried that people learning using that section will get the impression that the result is production-ready. (It's not.)

I think that if the guide chooses to explain Webpack rather than use CRA, it also needs to explain development/production configs, and show examples of both. It is important to teach people to think about these as two separate environments, and that one must never deploy a development bundle to production.

Add a note to "Setup & Build Tools" that understanding Webpack/Babel is optional

We often get issues in CRA repo from people who didn't believe CRA "just works" and tried to install Webpack or Babel on top of the generated project. To prevent issues like this, I think it would be nice to add extra notes on Babel and Webpack pages that they are not required for learning React, and you can use create-react-app alone if you don't want to learn them yet.

I've seen these notices on Environment page but they're easy to miss or forget.

make react.express PWA

Would love if you can make react.express a PWA.

I'm in an rural area of the world that has spotty internet, having offline access would be amazing!

Crazy memory leak

Hi, really enjoyed your guide, helped me get up and running quickly, however when leaving the site react.express open in safari it quickly consumes all of my available system memory. Rather concerning. Specifically noticed on the conditional rendering section.

Outdated webpack section

Hi there,

I have followed the steps under Webpack section but they don't work.
✅ mode: "development"; ❌ mode: env
2) bundle.js is not created
3)

"devDependencies": {
    "webpack": "^5.75.0",
    "webpack-cli": "^4.10.0",
    "webpack-dev-server": "^4.11.1"
  }
  1. When I go to the browser, "Cannot GET /" is showed.
  2. So, you wrote npm run dev when it should be npm run start, isn't it?

Best regards.

Guide Adjustment

Hi, first, thanks for the guide, it helps a lot.
Second, while reading through it i stumbled over some points which are outdated or probably would be helpful.
Can't say if you want to update them, but for the time being i will report it.

Link: https://www.react.express/environment/setup_and_tools/webpack

Section "Scripts" command "--env development" gets passed as boolean not as string (See Scripts & Configuration).
Section "Configuration" webpack-dev-server needs to define "allowedHosts" when not developing via localhost (See Configuration).
Section "Essential files" File "index.html" has to be moved to "/public/index.html".
Section "Running the development server" command "npm run dev" has to be replaced with "npm run start".

Scripts:

{
  ...
  "scripts": {
    "start": "webpack-dev-server --env mode=development",
    "build": "webpack --env mode=production"
  },
  ...
}

Configuration:

module.exports = (env) => {
  return {
    mode: env.mode,
    entry: './index.js',
    output: {
      filename: 'bundle.js',
    },
    devServer: {
      allowedHosts: [
        '.yourdomain.com'
      ]
    },
  }
}

Essential files:

Are inline styles a good fit for a beginner guide?

There is a myth that React requires using inline styles, and IMO this guide might confirm this idea for people who aren't experienced with React.

Would it be better to use plain CSS for learning? I understand the advantages of using a single file in examples, but it can hurt perception of React's flexibility.

In addition, inline styles implemented naïvely as objects have performance issues.

Mention React DevTools

I recommend mentioning React DevTools early on so that people can get comfortable with React component hierarchy and gain awareness of whether they're running development or production build.

I got an error when run this repository: You may need an appropriate loader to handle this file type

Firstly, sorry about my poor English.

I got an error like next, running on node 8.0.0 just clone this repository and yarn

It seems like that could not parse jsx syntax.

Can you help me?

 ERROR in ../~/react-disqus-thread/lib/components/DisqusThread.js
    Module parse failed: D:\mis\react-express\node_modules\react-disqus-thread\lib\components\DisqusThread.js Unexpected token (100:6)
    You may need an appropriate loader to handle this file type.
    |   render() {
    |     return (
    |       <div>
    |         <div id="disqus_thread"/>
    |       </div>
     @ ../~/react-disqus-thread/lib/main.js 1:17-53
     @ ./components/Disqus.js
     @ ./components/index.js
     @ ./pages/Animated.js
     @ ./pages lazy ^\.\/.*$
     @ ./index.js
     @ multi ./index.js

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.