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

Create Updated blog post on how to use TypeScript #705

Closed
wants to merge 6 commits into from

Conversation

Projects
None yet
8 participants
@janhesters
Copy link

janhesters commented Dec 12, 2018

TypeScript is getting ever more popular. Which is why I took the time to updated and enhance the existing blog post about using React Native with TypeScript. This update is more comprehensive that the few lines that have been added to the old post a couple of days ago.

In addition to getting TypeScript and Jest to work, it also covers TSLint, Enzyme and React Native Testing Library.

Create Updated blog post on how to use TypeScript
TypeScript is getting ever more popular. Which is why I took the time to updated and enhance the existing blog post about using React Native with TypeScript. This update is more comprehensive that the few lines that have been added to the old post a couple of days ago.

In addition to getting TypeScript and Jest to work, it also covers TSLint, Enzyme and React Native Testing Library.
@react-native-bot

This comment has been minimized.

Copy link

react-native-bot commented Dec 12, 2018

Deploy preview for react-native ready!

Built with commit 323dd60

https://deploy-preview-705--react-native.netlify.com

Changes to docs/ are reflected in the next "master" version.

Thank you for your contributions.

How to ContributeDocumentation Sources

@kelset

This comment has been minimized.

Copy link
Collaborator

kelset commented Dec 13, 2018

I feel that this should not be a blogpost, but it could be reworked to fit into the docs - as we are seeing more and more people wanting to use TS with RN.

cc @LinusU @ashfurrow would you mind checking it and LMK what you think about the content?

@ashfurrow

This comment has been minimized.

Copy link
Contributor

ashfurrow commented Dec 13, 2018

Hmm, this is really tricky. The content of the blog post is really great (well done @janhesters!) but I share @kelset’s concerns. However, I’m not sure this would necessarily fit as-is inside docs; it really is a tutorial that covers an expansive setup, much more than just RN and TS.

I think this would be a really helpful resource for learners, but I also see the benefit of having docs instead, that can be updated over time. In six months, will someone else need to rewrite this post again? Maybe, but even if they did, that’s not so bad. The benefits of having this available to learn from outweigh the concerns of docs-vs-blogs, imo. But that’s just me, I’ll leave it up to the React Native team 👍

@LinusU

This comment has been minimized.

Copy link

LinusU commented Dec 13, 2018

Haven't had time to read it all yet, just skimmed the first sections, will read all soon.

One thing I thought about was the Jest setup, I didn't realize that it doesn't work out of the box with TypeScript, as the normal TypeScript support does.

Could we fix this in the react-native Jest preset? I would be happy to submit PRs for this.

There is also a tsconfig.jest.json referenced in the config, but no more info about that file. What does it do? 🤔

janhesters added some commits Dec 13, 2018

@janhesters

This comment has been minimized.

Copy link
Author

janhesters commented Dec 13, 2018

@LinusU Whoopsie, forgot to add that part. I updated it. Thank you very much for catching that 🤗

It just extends the normal tsconfig for ts-jest so that Jest gets common JS code (and doesn't complain e.g. about import). See here.

Also the fact that Jest and linting don't just work out of the box was why I wanted to create this blog post and preferably share it directly on the official website. These just the common stap (which I had archived for myself in a private Slack conversation) which make setting up new RN projects with TypeScript - and remembering all steps - easy 👍.

janhesters added some commits Dec 13, 2018

@janhesters

This comment has been minimized.

Copy link
Author

janhesters commented Dec 17, 2018

@kelset @LinusU @ashfurrow So guys, what is the consensus? 🤗

@kelset

This comment has been minimized.

Copy link
Collaborator

kelset commented Dec 17, 2018

So, are the overall feedback I got from what written above by Ash + Linus + other people in the core that commented on the Discord is that this should not be a blogpost on the main website, hence two roads:

  • this gets reworked into a Documentation page, which means more or less:
    • removing the references to the other blogpost
    • define clearly why you are installing the other packages (ex: enzyme, react-native-testing)
    • provide a minimal github repo
    • add a link to the older blogpost referencing the new page of the docs
  • you publish it on your own platform of choice

As stated elsewhere, I'd really prefer to have a dedicated section in the docs for this - a conversation about having a "proper" Tutorial section also came out in another occasion last week. But it's your decision 😊

All of this said, from FB I also received a feedback that they would comment on this PR after they made up their mind about it. So don't take my feedback as "final", as they may want to chime in with a different take.

@janhesters

This comment has been minimized.

Copy link
Author

janhesters commented Dec 17, 2018

@kelset Thank you for answering, I was worried this PR would be dead now 😅

Okay, I'll wait for the Facebook's teams feedback.

If they agree with you, I'll happily create a PR as I don't care about the clout - I merely like to have all information in one source. Furthermore, I don't care about the format as long as all (= setup + linting + testing) is in one place (which might be better as a blog 🤔), since these are the most common steps for each TS project 🚀Lastly I don't think it would be that useful to publish it on Medium (or a similar platform) since the reach would be small and this probably benefits a lot of people.

@janhesters

This comment has been minimized.

Copy link
Author

janhesters commented Jan 8, 2019

@kelset The Facebook team didn't address this PR (Or will they do it in the future?) - therefore should I now go ahead and make a PR for the documentation? 😊👍🏻

@rickhanlonii

This comment has been minimized.

Copy link
Member

rickhanlonii commented Jan 8, 2019

Hey @janhesters, thanks for this!

I'm jumping in here without all the context but I would recommend:

  • Publishing it as a blog on medium
  • Tweet it from ReactNativeComm for reach
  • Tweak the content to work it into a doc on the site

This is what I did with https://medium.com/@rickhanlonii/understanding-jest-mocks-f0046c68e53c (though I still need to move it over into the Jest docs)

@janhesters

This comment has been minimized.

Copy link
Author

janhesters commented Jan 9, 2019

@rickhanlonii Thank you for your answer. Okay, I'll do it and then take care of the PR as soon as I can (I'm currently facing RSI though 😣)

How can I get ReactNativeComm to retweet? 😊

@charpeni

This comment has been minimized.

Copy link
Collaborator

charpeni commented Jan 26, 2019

To retweet, you can reach us here with a link.

@janhesters

This comment has been minimized.

@cpojer

This comment has been minimized.

Copy link
Contributor

cpojer commented Feb 7, 2019

Thank you for your hard work on this. We tweeted it on the React Native twitter account: https://twitter.com/reactnative/status/1093515749493227521

@cpojer cpojer closed this Feb 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.