Skip to content
This repository has been archived by the owner on Oct 23, 2018. It is now read-only.

[WIP] Add minimal boilerplate #120

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

chakrihacker
Copy link

No description provided.

@DevanB
Copy link
Collaborator

DevanB commented Apr 9, 2018

@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 uri.

Here is the PR #72

And here is the blocking issue for which we haven't accepted many updates lately: #98

@chakrihacker
Copy link
Author

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.

@DevanB
Copy link
Collaborator

DevanB commented Apr 11, 2018

@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!

@chakrihacker
Copy link
Author

Sure No problem!!!

@DevanB
Copy link
Collaborator

DevanB commented Apr 16, 2018

@chakrihacker

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)?

@chakrihacker
Copy link
Author

Hey, I modified structure can you check??

@chakrihacker
Copy link
Author

Hello any updates on this??

{
"main": "node_modules/expo/AppEntry.js",
"private": true,
"dependencies": {

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"
  },

Copy link
Collaborator

@DevanB DevanB left a 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! 😄

@alecperkey
Copy link

Looks good to merge

@@ -0,0 +1,3 @@
node_modules/**/*
.expo/*
Copy link
Collaborator

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";
Copy link
Collaborator

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 @@

Copy link
Collaborator

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 @@
{
Copy link
Collaborator

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.

Copy link
Author

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",
Copy link
Collaborator

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?

Copy link
Author

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

"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"
Copy link
Collaborator

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"

},
"dependencies": {
"apollo-boost": "^0.1.4",
"expo": "^26.0.0",
Copy link
Collaborator

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"

"expo": "^26.0.0",
"graphql": "^0.13.2",
"graphql-tag": "^2.8.0",
"react": "16.3.0-alpha.1",
Copy link
Collaborator

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"

"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",
Copy link
Collaborator

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"

@@ -0,0 +1,2 @@
node_modules
package.json.lock
Copy link
Collaborator

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.

Copy link
Collaborator

@DevanB DevanB left a 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.

"prisma",
"graphcool"
],
"author": "Subramanya Chakravarthy",
Copy link
Collaborator

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 @@
{
Copy link
Collaborator

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.

import gql from 'graphql-tag';
import InputName from './InputName';

export class Home extends Component {
Copy link
Collaborator

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.

<View style={styles.container} >
<Query query={HELLO_QUERY} >
{props => {
{/* console.log(props) */ }
Copy link
Collaborator

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 {
Copy link
Collaborator

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.

@marktani
Copy link
Contributor

marktani commented May 7, 2018

Thanks a lot for your contribution @chakrihacker! 💪
Great that you identified all those improvements in your review, @DevanB! Let's get this polished and merged 😊

@DevanB
Copy link
Collaborator

DevanB commented May 7, 2018

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!

@DevanB DevanB changed the title Add minimal boilerplate [WIP] Add minimal boilerplate May 8, 2018
@chakrihacker
Copy link
Author

Hey @DevanB I have updated code based on your reviews. can we merge this.

@chakrihacker
Copy link
Author

Hi, Any updates on this??

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

Successfully merging this pull request may close these issues.

4 participants