All Projects โ†’ ericwooley โ†’ React Nativeish

ericwooley / React Nativeish

Licence: mit
React Native / React Native Web Boilerplate

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Nativeish

React Typescript Web Extension Starter
๐Ÿ–ฅ A Web Extension starter kit built with React, TypeScript, SCSS, Storybook, Jest, EsLint, Prettier, Webpack and Bootstrap. Supports Google Chrome + Mozilla Firefox + Brave Browser ๐Ÿ”ฅ
Stars: โœญ 510 (+381.13%)
Mutual labels:  jest, chrome-extension, storybook
Moveit
๐Ÿš€ NLW #4 | React+ TypeScript + NextJS + StyledComponents + Firebase + MongoDb +Axios
Stars: โœญ 39 (-63.21%)
Mutual labels:  axios, jest, storybook
react-tools-for-better-angular-apps
Use React ecosystem for unified and top notch DX for angular developement
Stars: โœญ 30 (-71.7%)
Mutual labels:  jest, storybook, axios
Express React Boilerplate
๐Ÿš€๐Ÿš€๐Ÿš€ This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: โœญ 32 (-69.81%)
Mutual labels:  axios, jest, storybook
vuetibook
Integrating Vue.js, Vuetify and Storybook
Stars: โœญ 16 (-84.91%)
Mutual labels:  jest, storybook, axios
Svelte Tailwind Extension Boilerplate
A Chrome extension boilerplate built with Svelte, TailwindCSS, Jest, and Rollup.
Stars: โœญ 26 (-75.47%)
Mutual labels:  jest, chrome-extension
Vue Admin Webapp
this is a admin project
Stars: โœญ 673 (+534.91%)
Mutual labels:  axios, mock
React Redux Saga Starter
Basic, Opinionated starter kit for React+Redux+Redux Saga with support for SCSS CSS Modules, Storybook, JEST testing, and ESLint
Stars: โœญ 12 (-88.68%)
Mutual labels:  jest, storybook
Devtools Ds
UI components, libraries, and templates for building robust devtools experiences.
Stars: โœญ 105 (-0.94%)
Mutual labels:  chrome-extension, storybook
Graphql Query Test Mock
Easily mock GraphQL queries in your Relay Modern / Apollo / any-other-GraphQL-client tests.
Stars: โœญ 49 (-53.77%)
Mutual labels:  jest, mock
Vue Admin Beautiful
๐Ÿš€๐Ÿš€๐Ÿš€vue3 admin,vue3.0 admin,vueๅŽๅฐ็ฎก็†,vue-admin,vue3.0-admin,admin,vue-admin,vue-element-admin,ant-design๏ผŒvue-admin-beautiful-pro,vab admin pro,vab admin plusไธป็บฟ็‰ˆๆœฌๅŸบไบŽelement-plusใ€element-uiใ€ant-design-vueไธ‰่€…ๅนถ่กŒๅผ€ๅ‘็ปดๆŠค๏ผŒๅŒๆ—ถๆ”ฏๆŒ็”ต่„‘๏ผŒๆ‰‹ๆœบ๏ผŒๅนณๆฟ๏ผŒๅˆ‡ๆขๅˆ†ๆ”ฏๆŸฅ็œ‹ไธๅŒ็š„vue็‰ˆๆœฌ๏ผŒelement-plus็‰ˆๆœฌๅทฒๅ‘ๅธƒ(vue3,vue3.0,vue,vue3.x,vue.js)
Stars: โœญ 10,968 (+10247.17%)
Mutual labels:  axios, mock
Preact Jest Snapshot Test Boilerplate
๐Ÿš€ Test Preact components using Jest snapshots
Stars: โœญ 24 (-77.36%)
Mutual labels:  jest, snapshot
Vuejs Training
VueJS training including Vue ecosystem: HTTP (Axios), Vuex, Unit Testting (Jest)...
Stars: โœญ 6 (-94.34%)
Mutual labels:  axios, jest
Babel Test
An opinionated library to make testing babel plugins easier.
Stars: โœญ 79 (-25.47%)
Mutual labels:  jest, snapshot
Starter Lapis
Cutting edge starter kit
Stars: โœญ 72 (-32.08%)
Mutual labels:  axios, jest
Vue Lottery
๐ŸŽจ ๆŠฝๅฅ–ไปฅๅŠๆˆชๅฑไฟๅญ˜ๅ›พ็‰‡่‡ณๆœฌๅœฐ
Stars: โœญ 90 (-15.09%)
Mutual labels:  axios, mock
Vue3 Admin
๐Ÿ‘vue3.0ๅŽๅฐ็ฎก็†ๆก†ๆžถ๐Ÿ‘ๅŸบไบŽvue-cli4+compositionAPI+vue-router4
Stars: โœญ 54 (-49.06%)
Mutual labels:  axios, mock
React Native Cross Platform Starter
One codebase to build for iOS, Android, Web and Desktop with React-Native
Stars: โœญ 101 (-4.72%)
Mutual labels:  jest, react-native-web
Vue Cms
ๅŸบไบŽ Vue ๅ’Œ ElementUI ๆž„ๅปบ็š„ไธ€ไธชไผไธš็บงๅŽๅฐ็ฎก็†็ณป็ปŸ
Stars: โœญ 415 (+291.51%)
Mutual labels:  axios, mock
Snapshot Diff
Diffing snapshot utility for Jest
Stars: โœญ 490 (+362.26%)
Mutual labels:  jest, snapshot

React Native...ish V2

Maximizing code reuse for Create React App and Create React Native App

Quick Feature Compare

  • Architecture that supports code sharing between CRA and CRNA
  • React Navigation for mobile & React Router 4 for web
  • Storybook for web and for mobile
  • jest
  • blueprints via redux-cli
    1. generates code based on the files in blueprints/
  • Intended for use with redux-sagas, but they are not installed by default (*blueprints for sagas are installed.)
  • jest with enzyme

Quick Links

  1. Dependencies โˆš
  2. OnBoarding โˆš
  1. Development โˆš
  2. Deployment ยฌ
  3. Blueprints โˆš
  4. References ยฌ
  5. Notes

Dependencies

  1. OSX with xcode (if you want to develop for ios, though you could also use the expo app on an ios device)
  2. Node >= 6 (I would use nvm or n)
  3. Yarn >= 0.21.3
  4. Create React App
  5. Create React Native App

OnBoarding

Make sure you understand react/redux/redux-sagas. (Links in the libraries section)

Take a quick look at the directory structure. (explanations follow)

Directory Structure

โ”œโ”€โ”€ App.js                                    # Entry point for exp
โ”œโ”€โ”€ App.test-m.js                             # unit test for Expo. All mobile tests end with .test-m.js to differentiate them from the mobile versions
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ __mocks__                                 # Mocks for testing
โ”œโ”€โ”€ app.json                                  # React native and expo file used for app settings, look at the expo docs for more about this
โ”œโ”€โ”€ blueprints                                # Blueprints folder, contains components, sagas, etc...
โ”œโ”€โ”€ combined                                  # something expo creates?
โ”œโ”€โ”€ package.json                      
โ”œโ”€โ”€ public                                    # CRA webpack public serve file
โ”œโ”€โ”€ src
โ”‚   โ”œโ”€โ”€ App.css                               # css file for CRA
โ”‚   โ”œโ”€โ”€ App.js                                # basic App for CRA, import by index.js
โ”‚   โ”œโ”€โ”€ App.test.js                           # Test for app for web, all web tests end in .test.js (not .test-m.js)
โ”‚   โ”œโ”€โ”€ components                            # components, all components should strive to be reusable
โ”‚   โ”‚   โ””โ”€โ”€ Button        
โ”‚   โ”‚       โ”œโ”€โ”€ index.js                      # default button for web (or native, if there is nothing native specific in it)
โ”‚   โ”‚       โ”œโ”€โ”€ index.native.js               # will be imported in mobile, instead of index.js. Use this pattern when you need components to be different for each. You should make them have the same api though.
โ”‚   โ”‚       โ”œโ”€โ”€ index.story.js                # storybook for native
โ”‚   โ”‚       โ””โ”€โ”€ index.story.native.js         # storybook for mobile
โ”‚   โ”œโ”€โ”€ constants                             # app config, different for mobile and native
โ”‚   โ”œโ”€โ”€ index.css
โ”‚   โ”œโ”€โ”€ index.js                              # Entry point for CRA, different than expo, expo expects it to be at the root.
โ”‚   โ”œโ”€โ”€ logo.svg
โ”‚   โ”œโ”€โ”€ navigation                            # Routes and navigation setup, different for mobile and native
โ”‚   โ”œโ”€โ”€ reducers                              # Basic redux reducer setups
โ”‚   โ”œโ”€โ”€ registerServiceWorker.js              # used by CRA to cache files
โ”‚   โ”œโ”€โ”€ scenes                                # Screens (routes) which are always different for native and mobile
โ”‚   โ”œโ”€โ”€ setupTests.js                         # test setup file
โ”‚   โ””โ”€โ”€ store                                 # stores that are different for mobile and native, so that react-router can be effectively synced.
โ”‚       โ”œโ”€โ”€ configure-store.js
โ”‚       โ””โ”€โ”€ configure-store.native.js
โ””โ”€โ”€ storybook                                 # storybook folder
    โ”œโ”€โ”€ addons.js
    โ”œโ”€โ”€ index.js
  • Components Components are like the View in MVC. It should only accept props, and output JSX, with generalized callback props (onClick, onHover, onSomethingCustom, etc...). Think of components like your own personal html framework, these shouldn't know anything about the state of the app.

    1. Stories Stories are react storybook stories, and are effectively documentation for the components.
    1. StoyShots Storyshots convert storybook stories to jest snapshots. So that when you run unit tests, it checks the underlying dom elements havn't changed.
  • Containers (Smart Components)

    Containers are components that use redux-connect to map a components props to redux state and actions.

  • Scenes

    Scenes are components that are loaded via react native navigation. It should be composed entirely of smart components.

  • Services

    Services are configurable (often singleton) objects which can be imported into other parts of the app. There is no boilerplates for this because each case for a service is probably too different.

  • Unit Tests

    Make sure you understand jest, unit tests, and TDD in general. This project has githooks which check your test on commit.

  • Mocks This project uses the axios library for xhr requests, and it's compatable with react native. Mocks are done using axios-mock-adapter

    • see src/services/network

Libraries

Become very familiar with each of these libraries.

  1. React
  1. redux - Yes, read all of it.
  1. redux sagas are used instead of redux-thunk.
  1. React native
  • This project also builds on this using react-native-web which is a reimplementation of react-native to make it run in a browser.
  1. react-native-elements Basic semi-presytled components to make things more usuable.
  1. Recompose High Order components so that you can just use function based components

  2. Jest Unit test framework, integrates with storyshots instead of jest snapshots

  3. StoryBook/Storyshots used for individual component development, and to take snapshots of the UI, like jest snapshots.

  4. React Navigation - Native code excellerated navigation framework

Development

  1. Recommended Editor: vscode
  • There are recommended extensions in the .vscode folder.
  • Make sure your editor respects the .editorconfig file
  • Make sure your editor uses the eslint linter.
  1. Development commands
  • yarn start: Runs all processes in terminus-maximus. Open your browser window to localhost:3000 for web, open localhost:9001 for web storybook, localhost:7007 for storybook mobile controller, and open your expo app for developing natively. (note that storybook won't be able to connect from non localhost simulators).

Also note that the QR code in the terminal is not printed correctly. Try using the expo app, or running exp start outside of npm run start to get the qr code to load it onto your phone or simulator

  1. Development Workflow
  • Start by identifying which components you need and start react-storybook yarn start and open http://localhost:9001/

    1. Develop the component, and create comprehensive tests.
  • Create containers to wrap them to state, as needed (which can still be done via creating stories in storybook)

    1. This is also a good time to develop any sagas or reducers you need.
  • open http://localhost:3000/

    1. Create or open the view you want to develop, navigate there in your app, and happy developing!
  • Once you are happy with the way it looks in web, open it in ios and android, to make sure you didn't miss/break something.

  • At this point your unit tests are probably broken from storyshots. npm run test and take a look through the broken stories to make sure everything is acceptable. If not, fix whats broken, if so run npm run test:update to accept the new DOM changes, and make sure the rest of your tests pass.

  • TIP: when running tests run npm run test -- --watch to have jest watch your test files and only run the ones that change.

Blueprints

This project takes advantage of the redux-cli project. Which allows you to commit your own template files for generating.

** Start your component name with a lowercase, or things may not line up properly **

  • component - generates all tests/story/code boilerplate needed for a component. All files are placed in src/components.

    • EG: redux g component test
  • container - generates all tests/story/code boilerplate needed for a container. All files are placed in src/container.

    • EG: redux g container test
  • saga - generates all test/code boilerplate needed for a saga. All files are placed in src/saga.

    • EG: redux g saga test
  • scene - generates all test/story/code boilerplate needed for a scene. All files are placed in src/scene.

    • EG: redux g scene test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].