-
Notifications
You must be signed in to change notification settings - Fork 210
Conversation
Heavy refactoring of the README to update to the latest version of tools and npm packages as of 2018-03-18
Add types for react react-native and jest. Support the new module formats with esModuleInterop and allowSyntheticDefaultImports
New React-Native uses only a single index.js. This deletes the old files.
Add the new Index.js entry point and the index.ts in src.
React-Native generates theese files orginally now but these are updated to include Hello component.
@microsoftopensource @DanielRosenwasser @henrikra @sandersn @bowdenk7 @msftgits I don't mean to be rude but I have read that the team doesn't get automatic notifications for PRs. And request being mentioned so they will be notified. |
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 really prefer many of the stylistic changes made here would be undone, or done in a separate PR. There's a lot to run through, so I've only gone through part of it.
.flowconfig
Outdated
@@ -0,0 +1,54 @@ | |||
[ignore] |
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 file
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.
Removed and .gitignore updated
README.md
Outdated
When you've managed to deploy to a device or emulator, you'll be ready to start a TypeScript React Native app. | ||
Because you might be on one of several different platforms, targeting several different types of devices, other setup will be involved. You should first ensure that you can run a plain React Native app without TypeScript. Follow [the instructions on the React Native website to get started](https://facebook.github.io/react-native/docs/getting-started.html). When you've managed to deploy to a device or emulator following their instructions, you'll be ready to start a TypeScript React Native app. | ||
|
||
### Notes: |
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.
Remove colon
README.md
Outdated
Where we use npm, we encourage you to try using [Yarn](https://yarnpkg.com/lang/en/) in its place. | ||
Where we use npm, you can use the equivalent [Yarn](https://yarnpkg.com/lang/en/) command in its place. | ||
|
||
`The output of the npm commands will contain numerous warnings that you should be able to safely ignore.` |
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.
may contain
remove backticks and fold this into the previous paragraph
README.md
Outdated
You'll probably want to get a cup of coffee in general, and get two if you're using npm 4 and earlier. | ||
#### Original directory structure | ||
|
||
```sh |
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.
Remove the block type
README.md
Outdated
|
||
# Initializing | ||
|
||
Once you've tried scaffolding out an ordinary React Native project, you'll be ready to start adding TypeScript. | ||
Let's go ahead and do that. | ||
Start by initializing our new project (This could take a few minutes). |
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.
Let's start by initializing our new project with the `react-native` command.
Note that this may take a few minutes.
README.md
Outdated
#### Original directory structure | ||
|
||
```sh | ||
C:. |
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.
Just use MyAwesomeProject
, don't use C:
README.md
Outdated
├─── ... | ||
├───android | ||
├───ios | ||
└───__tests__ |
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.
Add a space following each directory entry
add .flowconfig to git ignore and remove the file from the repo.
As rule PureComponent should be the default when creating a component. It does a shallow compare on props and will save much re-rendering.
And clarified a few other items.
@DanielRosenwasser Thanks Daniel for the feedback. I updated the specific items you mentioned and re-read the Readme again and found a few other things that needed clarified or cleaned up. I have done a few other documentation PRs. And I try to keep them small. But this one just turned out to be more work. If you anyone else see anything else that needs addressed please let me know and I will do my best to address it ASAP. |
|
||
```json | ||
{ | ||
"compilerOptions": { | ||
// other options here | ||
"types": ["react","react-native","jest"], | ||
"allowSyntheticDefaultImports": true, | ||
"esModuleInterop": true |
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 am not sure if any one else has ran into some issue when the Typescript compiler.
I believe "skipLibCheck": true, should be added. to avoid this issue: ['types/react-native'] Property 'geolocation' must be of type 'Geolocation', but here has type 'GeolocationStatic'.
@DanielRosenwasser I updated the items you requested. |
Give the other doc refresh this is no longer applicable. Thanks guys for the work on that. |
This is an Update to the README file and associated source to bring this repo current as of 2018-03-18.
For review it would be excellent if someone could follow the updated README and confirm the instructions are correct and validate the source goes along with the instructions.
Questions or comments are welcomed.
This PR address many of the Issues concerned with later versions or React Native.
#23 #32 #31 #