Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cdepillabout/purescript-road-to-react
PureScript translation of example JavaScript React app from https://www.roadtoreact.com/
https://github.com/cdepillabout/purescript-road-to-react
example frontend hacktoberfest purescript purescript-react-basic purescript-react-basic-hooks react react-basic react-basic-hooks
Last synced: 2 days ago
JSON representation
PureScript translation of example JavaScript React app from https://www.roadtoreact.com/
- Host: GitHub
- URL: https://github.com/cdepillabout/purescript-road-to-react
- Owner: cdepillabout
- Created: 2020-08-09T08:42:58.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-25T11:38:11.000Z (about 4 years ago)
- Last Synced: 2023-04-10T16:51:20.957Z (over 1 year ago)
- Topics: example, frontend, hacktoberfest, purescript, purescript-react-basic, purescript-react-basic-hooks, react, react-basic, react-basic-hooks
- Language: PureScript
- Homepage:
- Size: 65.4 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# purescript-road-to-react
The book [Road to React](https://www.roadtoreact.com/) is an introductory book
to React in JavaScript. In early 2020, the book was updated to use
[React Hooks](https://reactjs.org/docs/hooks-intro.html).The first half of the book iteratively develops a React-based frontend. Each
chapter gradually introduces more and more functionality from React. As the
first half of the book comes to an end, you've written a basic frontend that
demonstrates a good deal of the functionality of React.This repo translates the on-going example from into PureScript, using the
[purescript-react-basic-hooks](https://github.com/spicydonuts/purescript-react-basic-hooks)
library.## The Code
The original JavaScript code can be found on CodeSandbox
[here](https://codesandbox.io/s/github/the-road-to-learn-react/hacker-stories/tree/hs/Data-Re-Fetching-in-React).The translated PureScript code can be found [in this repo](./src/App.purs).
## Running
This repo can be built by running the following commands:
```console
# Enter into a Nix shell with all the dependencies available.
$ nix-shell
# Within the nix shell, build the PureScript app with spago.
$ spago build
# Run Parcel to handle the CommonJS modules.
$ parcel index.html
````parcel` serves the app on http://localhost:1234/.
If you want to do development interactively, you can start `spago` in one
terminal with a command line `spago build --watch`, and then start `parcel` in
another terminal. `parcel` sometimes gets autoreloading correct, but sometimes
you explicitly have to refresh the browser window to see changes.If you don't want to use Nix, it should be possible to install `spago`, the
PureScript compiler, and Parcel with NPM/yarn.