sveltevietnam / sveltevietnam.dev

Go-to one-stop information hub for Svelte community in Vietnam
https://sveltevietnam.dev
MIT License
33 stars 4 forks source link

Migration Path to Monorepo (Turborepo) #32

Closed vnphanquang closed 1 year ago

vnphanquang commented 1 year ago

Initial Context

As the title states, should we consider turning this project into a monorepo (even though there's just one site) to be able to use remote caching?

No reason not to 🤔 ?

Update

Following #60, remote caching doesn't make sense anymore. Instead, monorepo migration acts as preparation for scaling up the repo. For example, #72 and #38 will require additional code to be added; we should scope these as separate projects within a monorepo, for better scoping (better than multiple repos), dependency sharing, and later on version tracking #76.

Todo

lvnam96 commented 1 year ago

How about "secret" env variables (if existed)? As they are supposed to be different among environments, does remote caching bring any benefits?

vnphanquang commented 1 year ago

@lvnam96 yes, supposedly. Env can be added to cache config, basically if 2 build with same env but different values will result in 2 hashed builds.

The best benefit of concern here is remote caching, which would bring a shared cache to multiple devs working on the same project, and also the same cache for pipeline, potentially saving resources across the project.

However, considering the current scope & scale of this project (just me working in my own time, no stable production env yet), caching won't have much impact. Also, in https://github.com/sveltevietnam/sveltevietnam.dev/issues/60, deployment was migrated to cloudflare from vercel, and enabling remote caching in cloudflare pipeline is not what I have experience in. Therefore this issue is still in backlog and kept for later consideration.