Turborepo, React Native and more
Published: 2022-01-29 16:22:48

As I was writing this blog post last night, I got distracted by a dependency vulnerability alert on [telescope](https://github.com/Seneca-CDOT/telescope). I ended up merging the automatic [PR](https://github.com/Seneca-CDOT/telescope/pull/2772) from [renovatebot](https://github.com/marketplace/renovate) and then did a patch release. We are now at version 2.5.4. Our fourth patch release in the span of one week!

One thing I love about Open Source is the flexibility. We have plans and a release schedule to keep everyone on track but, if I have an idea (or if I find a bug), I can bring it up, send a Pull Request and the unplanned change quickly finds its way to the master branch.

This week I had two of these moments while working on bigger tasks.

The [*first*](https://github.com/Seneca-CDOT/telescope/pull/2726) was fixing a css bug I noticed while using telescope on Safari on my mac. It can be tedious to find the reason why Safari is not acting the same as Firefox and Chrome (Safari is generally behind when it comes to implementing some CSS properties). However, after some trial and error and some luck, I managed to fix the bug by removing just on line of code.

The [*second*](https://github.com/Seneca-CDOT/telescope/pull/2749) small fix was an update that I [suggested](https://github.com/Seneca-CDOT/telescope/issues/2741) for our GitHub Actions CI implementation. I noticed that all of our tests (that usually take about 10 minutes to complete) would run even for a simple change that does not impact the code such as updating the docs.

I followed the GitHub Actions [documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-excluding-paths) and I added a `paths-ignore` option to ignore the `/docs` folder for the workflow that we run every time something is pushed to a PR or to master. There is now a docs specific workflow that is much faster because it only includes Prettier and ESLint (1 minute in total run time).

Other than these two small changes, what I worked on this week (and what took most of my time) involved [Turborepo](https://turborepo.org) and [Expo](https://expo.dev).

### Turborepo

I briefly talked about Turborepo in my previous [blog post](https://dev.to/menghif/telescope-25-update-4lcd): It is a fantastic tool to manage a monorepo like telescope. This week my [PR](https://github.com/Seneca-CDOT/telescope/pull/2721) to [add support for Turborepo](https://github.com/Seneca-CDOT/telescope/issues/1778) was merged and we are now ready to use it with `pnpm`. As of right, now it is only used for the `build` command: Using `pnpm turbo run build` will go look inside each workspaces (using `pnpm-workspace.yaml`) to look for a `build` command and then will run them all.

Other students have shown interest in the Turborepo setup. In the coming weeks, we will work together to get to a point where we can use this tool to its [full potential](https://turborepo.org/docs#why-turborepo).

### React Native with Expo

The last thing I worked on this week was [setting up a new React Native project](https://github.com/Seneca-CDOT/telescope/issues/2729) within the telescope monorepo.

As a group we decided to use Expo, which is a framework to manage a React Native app. The problem I ran into was that Expo is not currently compatible with `pnpm`. As a workaround we now change directory to `src/mobile` where the React Native app lives and then use `npm` there.

![Expo with iOS Simulator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cuhh41uhjb8m0kry3t7l.jpg)
 
I tested the app on iOS, Android and the web and it works on all 3 platforms (The [PR](https://github.com/Seneca-CDOT/telescope/pull/2744) was merged yesterday). The app is empty for now but by the end of the semester we should have something functional and maybe even publish it to the App Store and Play Store!