-
Notifications
You must be signed in to change notification settings - Fork 32
[WIP] Add minimal boilerplate #120
base: master
Are you sure you want to change the base?
Conversation
@chakrihacker Thanks for submitting this PR! We already have a PR open for a minimal boilerplate that is very similar to your PR, but had one main problem, the ApolloClient Here is the PR #72 And here is the blocking issue for which we haven't accepted many updates lately: #98 |
Hi @DevanB thanks for pointing out existing PR. I am using expo constants to find dev url,so this makes sure even your emulator/simulator is in wifi/lan it connects to server. |
@chakrihacker - thanks for updating your PR. I’ll review within the next few days. I might have a few more adjustments before accepting and merging. But if you’ll work through them, we will get your hard work merged in! Thanks for submitting the PR! |
Sure No problem!!! |
I started looking over your PR this evening. Can you refactor your PR to align with the same folder structure we have for the basic example and the PR I have mentioned (this one)? |
Hey, I modified structure can you check?? |
Hello any updates on this?? |
minimal/package.json
Outdated
{ | ||
"main": "node_modules/expo/AppEntry.js", | ||
"private": true, | ||
"dependencies": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR works for me on Windows 10 w/ exp cli commands exp lan --start
followed by exp android
Perhaps the exp cli scripts can be added as npm scripts (for transparency to those unfamiliar with exp cli requirements)
something like:
"scripts": {
"start": "react-native-scripts start",
"exp:start:lan": "exp start --lan",
"exp:android": "exp android",
"exp:ios": "exp ios",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js --watch"
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating this PR, however, it is still missing vital pieces to align it with the basic boilerplate. For instance, the package.json
is missing npm scripts.
Please take a look at the basic boilerplate and try to mimic it as much as possible. Thanks! 😄
Looks good to merge |
minimal/.gitignore
Outdated
@@ -0,0 +1,3 @@ | |||
node_modules/**/* | |||
.expo/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should change this to reflect the basic boilerplate. No need to globs to be used; it could just be node_modules/
and .expo/
minimal/App.js
Outdated
@@ -0,0 +1,23 @@ | |||
import React from 'react'; | |||
import { Text, View } from 'react-native'; | |||
import Expo from "expo"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to see Constants
imported specifically, instead of importing all of Expo.
@@ -0,0 +1,104 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has an assortment of updates that are necessary for the minimal boilerplate. Please review. 😄
@@ -0,0 +1,27 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd love to see this file more complete, rather than the defaults that Expo provides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the defaults are more than enough
"private": true, | ||
"scripts": { | ||
"start": "react-native-scripts start", | ||
"exp:start": "exp start --lan", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does --lan
afford users versus react-native-scripts start
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are depending on local ip rather than domain url, it's necessary to use --lan to make that app has access to prisma server
minimal/package.json
Outdated
"graphql-tag": "^2.8.0", | ||
"react": "16.3.0-alpha.1", | ||
"react-apollo": "^2.1.3", | ||
"react-native": "https://github.com/expo/react-native/archive/sdk-26.0.0.tar.gz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 27 would change this to: "https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz"
minimal/package.json
Outdated
}, | ||
"dependencies": { | ||
"apollo-boost": "^0.1.4", | ||
"expo": "^26.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 27 would change this to: "^27.0.0"
minimal/package.json
Outdated
"expo": "^26.0.0", | ||
"graphql": "^0.13.2", | ||
"graphql-tag": "^2.8.0", | ||
"react": "16.3.0-alpha.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 27 would change this to "16.3.1"
minimal/package.json
Outdated
"eslint-plugin-jsx-a11y": "6.0.3", | ||
"eslint-plugin-react": "7.7.0", | ||
"eslint-plugin-react-native": "3.2.1", | ||
"jest-expo": "25.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 27 would change this to "^27.0.0"
minimal/server/.gitignore
Outdated
@@ -0,0 +1,2 @@ | |||
node_modules | |||
package.json.lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love to make this identical to the basic server's .gitignore
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'm back from vacation and gave this a super thorough review. Feel free to respond to my comments and start a conversation. I don't want to be a gatekeeper, but do want to have a healthy discussion, a healthy group of contributors, and to maintain code reuse and best practices between all React Native boilerplates.
minimal/server/package.json
Outdated
"prisma", | ||
"graphcool" | ||
], | ||
"author": "Subramanya Chakravarthy", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this line 😄
@@ -0,0 +1,16 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the prettier settings from the basic server's package.json
.
minimal/src/Components/Home.js
Outdated
import gql from 'graphql-tag'; | ||
import InputName from './InputName'; | ||
|
||
export class Home extends Component { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this component only has a render
method, please convert it to a functional component.
minimal/src/Components/Home.js
Outdated
<View style={styles.container} > | ||
<Query query={HELLO_QUERY} > | ||
{props => { | ||
{/* console.log(props) */ } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this line 😄
minimal/App.js
Outdated
uri: `http://${url}`, | ||
}) | ||
|
||
export default class App extends React.Component { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this component only has a render method, please convert it to a functional component.
Thanks a lot for your contribution @chakrihacker! 💪 |
Totally agree! Let's get this merged in and we can move on to the advanced boilerplate, which will be awesome to release to other developers! |
Hey @DevanB I have updated code based on your reviews. can we merge this. |
Hi, Any updates on this?? |
No description provided.