Skip to content
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

Update for "Building a Single Page Application with Cro" (just a detail) #119

Open
arjancwidlak opened this issue May 2, 2020 · 1 comment
Assignees

Comments

@arjancwidlak
Copy link

Thank you for your great and complete tutorial "Building a Single Page Application with Cro". I'm in the process of following it.

There is an updated needed however, here:
https://cro.services/docs/intro/spa-with-cro#Setting_up_React
Because:

  1. babel-preset-es2015 is deprecated
  2. The automatic installation of peer dependencies was removed with npm 3.

Therefore, update the
npm install --save-dev babel-loader babel-core babel-preset-es2015 babel-preset-react
to:
npm install --save-dev babel-loader core-js@^3 @babel/core@^7 @babel/preset-react

And update the:
{ "presets" : ["es2015","react"] }
to
{ "presets": ["@babel/preset-react"] }
See also here: https://babeljs.io/docs/en/env/

With these changes
npm run build
works.

A bit further, after the text below, the code seems to be missing:

Next up, we'll create a Redux store, which is the thing that holds the latest version of the state produced by the reducer. We create it simply by passing our reducer to createStore:

Probably something like this is needed there: https://redux.js.org/api/createstore

And while I'm on it. I've also a question. Why doesn't the Cro server use the P6W/WAPI standard?

Kind regards,
Arjan.

@NoisomePossum
Copy link

Currently working through this tutorial myself so I appreciate the advice on the npm install part.

For the missing Redux code, there's a link to the code for the finished project at the bottom of the page. Seems like this might be the missing line: https://github.com/croservices/sample-app-spa-react/blob/master/frontend/index.js#L62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants