Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Upgrade to Create React App 2.0 #72

Merged
merged 18 commits into from
Dec 19, 2018
Merged

Upgrade to Create React App 2.0 #72

merged 18 commits into from
Dec 19, 2018

Conversation

0xcaff
Copy link
Member

@0xcaff 0xcaff commented Dec 19, 2018

Did some housekeeping to make contributing to this project fun again.

  • Migrated to Create React App 2.0
    We were previously using an ejected version of create-react-app 1.0 with a few modifications (typescript support, css modules, and a couple other things). Now all of these things can be done with CRA2.

  • Migrated to Storybook 4.0
    It works out of the box with create-react-app 2.0. The only issue is that it creates a bazillion warnings when installing dependencies. All dependencies are handled by create-react-app and this is a non-issue.

  • Moved Mock Resolver to Proxy
    The mock resolver is no longer in the application bundle. Now, it is added to the dev proxy using src/setupProxy.js and apollo-server-express. This allows for accessing the graphql playground, probably reduces bundle size and allows for throttling response time with tools in network devtools but breaks the demo site. Need to think about whether this is a good idea. Will be helpful for Loading States Missing Everywhere #68 .

  • Added Formatting on Precommit Hook
    It is really easy to commit unformatted code. This makes it easier to not forget. yarn fmt is run before every commit with husky.

These changes have shaved about 80kb off the bundle size.

Closes #70
Closes #71

Storybook doesn't work but `yarn start` seems to.
Moved things to dev-dependencies and made scripts nicer. Things in devDepndencies are things which aren't used by the application at runtime.
Don't need it with create-react-app and cosmos.
Not targeting mobile. Don't really have an icon.
Why? Because it forces me to develop with loading states in mind.
This isn't great testing but it is free testing.
I think sticking to storybook is better. Cosmos doesn't use react
components for depndencies. Migrating is hard.
It seems to work with Create React App 2. Flawlessly even.
@0xcaff 0xcaff changed the title [WIP] Upgrade to Create React App 2.0 Upgrade to Create React App 2.0 Dec 19, 2018
@0xcaff
Copy link
Member Author

0xcaff commented Dec 19, 2018

The benefits of the mock resolver in the proxy outweigh the benefits of the demo thing. Developer experience is more important than what people think.

@0xcaff 0xcaff merged commit bea725b into master Dec 19, 2018
@0xcaff 0xcaff deleted the uneject branch December 19, 2018 21:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Format Code on Commit Upgrade to Create React App 2.0
1 participant