DEV Community

Francesco Menghi
Francesco Menghi

Posted on

Turborepo, React Native and more

As I was writing this blog post last night, I got distracted by a dependency vulnerability alert on telescope. I ended up merging the automatic PR from renovatebot 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 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 small fix was an update that I suggested 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 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 and Expo.

Turborepo

I briefly talked about Turborepo in my previous blog post: It is a fantastic tool to manage a monorepo like telescope. This week my PR to add support for Turborepo 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.

React Native with Expo

The last thing I worked on this week was setting up a new React Native project 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

I tested the app on iOS, Android and the web and it works on all 3 platforms (The PR 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!

Top comments (0)