Skip to content

Conversation

@whalemare
Copy link
Contributor

@whalemare whalemare commented Dec 10, 2022

See #352.

Added example usage like #522, but for bare react-native project.

Project generated with npx react-native init AwesomeTSProject --template react-native-template-typescript

Important parts start from there: https://github.com/ivanhofer/typesafe-i18n/pull/531/files#diff-34c05d48499a8d0600f5472677019d00e90f4224b03119ebefe3e90a690a2da5

Steps to integrate in your project

Extra steps to work with this library described in README.md:

  1. Install polyfills for mobile
yarn add @formatjs/intl-getcanonicallocales @formatjs/intl-locale @formatjs/intl-pluralrules
  1. Copy-paste polyfill folder in your project

  2. Do import './polyfill' in entry point

  3. Patch metro.config.js to allow .cjs extension

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time.
  • Prefix your PR title with [feat], [fix], [chore], or [docs].
  • This message body should clearly illustrate what problems it solves.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint

@whalemare whalemare changed the title Example/react-native chore: add bare example/react-native project Dec 10, 2022
@whalemare whalemare marked this pull request as ready for review December 10, 2022 07:48
@ivanhofer
Copy link
Collaborator

Hi @whalemare, thanks for the PR.
I'm having trouble testing it. What is the default port the web application is running in the browser?
I have also questions regarding the ios and android folders. For me those files look like generated. Should they be committed to the repo?

@whalemare
Copy link
Contributor Author

whalemare commented Dec 14, 2022

What is the default port the web application is running in the browser?

Not tested for web. Bare react native supported out of the box only android and ios

those files look like generated

Yes, it's generated by npx react-native init AwesomeTSProject --template react-native-template-typescript. When project start, it always generated by this command and should be committed to repo, because it's not Expo. Main difference between Expo and Bare react native is that Expo - manage all for you.
With Bare react native you should manage all environment by yourself, so we need this generated template in repo

@ivanhofer ivanhofer merged commit 7e6350b into codingcommons:main Dec 15, 2022
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