Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add React and React-router #6

Merged
merged 8 commits into from
Feb 11, 2019
Merged

Add React and React-router #6

merged 8 commits into from
Feb 11, 2019

Conversation

bobbiec
Copy link
Contributor

@bobbiec bobbiec commented Feb 8, 2019

This PR adds React with react-router.

image

I basically just deleted everything we had before and ran create-react-app, and then added react router and a little sample code.

package.json Outdated
"type": "git",
"url": "git+https://github.com/CMU-17-356/dronuts-2019-group-5.git"
"version": "0.1.0",
"private": true,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we change the repo to be private?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is entirely because I deleted old package.json to run CRA. Good catch!

@@ -0,0 +1,9 @@
import React from 'react';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we moved test directory from root to src in this PR - this is probably wise: http://www.wisdomofjim.com/blog/why-i-recommend-unit-tests-in-the-src-folder just want to make sure this was intentionally done...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not a conscious decision, just me following different directory structures in different tutorials at different points in time. I think it's fairly arbitrary, though, as long as we stick to one.

tslint.json Outdated
"no-null-keyword": true,
"prefer-const": true,
"jsdoc-format": true
"extends": [],
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what happened to linting here... it looks like we removed the core functionality - maybe this is added in later commit? Or will become clearer in later commit? WIll check back...

Copy link
Contributor Author

@bobbiec bobbiec Feb 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is actually an artifact of me messing around with manually putting all the parts together (before I just went to using create-react-app). CRA itself doesn't support typescript (link) right now, so I'm going to remove this. Linting is provided by ESLint instead.

package.json Show resolved Hide resolved
@@ -1,3 +1,7 @@
# Because otherwise Travis tests will fail
# Todo: look into this
package-lock.json
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't comment on your prior commit as it as deleting a file (package-lock.json) - but It's unclear to me why deleting this file was necessary? Rather than regenerating it.. trying to understand your thinking -- would love to hear your thoughts!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When package-lock.json is present, Travis runs npm ci rather than npm install (link). This causes tests to fail because dependencies are missing.

I suspect this is because devDependencies are not installed, but I don't know how to fix that. I also don't know how to disable the use of npm ci except by omitting package-lock.json.

import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import * as React from 'react';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still going through React tutorial - I'll return after I've finished tutorial to review - unless others beat me to it..

@ykotturi
Copy link

ykotturi commented Feb 8, 2019

I just pulled this PR branch locally and got it up n' running w/ docker. I'll finish the React tutorial and then return to finish the review (specifically, on the last commit of this PR), which is all React additions.

- Remove redundant tslint.json and update README about linting
- Restore package.json details from old version
@ykotturi
Copy link

Ok - I've reviewed your React code as well as tested locally. All looks good - although I have some questions about routing in general, which hopefully we can spend ~5 minutes on when you arrive for group meeting - if that's OK with you @bobbiec.

Merging this branch.

@ykotturi
Copy link

ykotturi commented Feb 11, 2019

Oh wait, can you update your branch w/ latest master locally, and then push? It's a few commits behind. @bobbiec And then I'll merge. Thanks.

@ykotturi
Copy link

When we rerun each of these Travis builds independently, they work. Going to merge to master!

@ykotturi ykotturi merged commit 9b7a539 into master Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants