oleeskild / obsidian-digital-garden

MIT License
1.33k stars 124 forks source link

Question: What's up with the switch from Netlify to Vercel? #173

Closed amperag closed 1 year ago

amperag commented 1 year ago

I've just seen the changes in the README: 395a1f1339d2775187e79eedff40c865f9144f91

@oleeskild could you maybe shed some light on this?

How are existing digital gardens on Netlify affected?

Thanks in advance!

oleeskild commented 1 year ago

The garden now runs fully functional on both platforms. So existing gardens on Netlify are not affected in any way. They will work the same as they always have, and will receive the same updates. (I should perhaps put this somewhere in the documentation. I'll probably make an FAQ section or something).

Vercel and Netlify are really similar to each other, and I don't really have a strong preference either way. The reason I switched the default to being Vercel is due to new gardens not being properly deployed when people are creating new gardens. (See #167) This seem to be an issue with Netlify, and instead of waiting for them to fix it, I've changed to Vercel, so that new people using the plugin get it working right away, instead of having to do a workaround.

The basic architecture of the garden is as follows: Vercel and Netlify can both have "listeners" attached to GitHub repos. These listeners are notified when any change to the GitHub repo happens. Vercel or Netlify will then download the latest changes, build the site with these changes, and publish the result to the internet.

These "listeners" can either be set up by starting a new project in either platform, and then selecting any GitHub repo in your GitHub account. Or you can use the "Deploy to ..." buttons. These make the initial steps a bit easier as they will

  1. Create a copy of the repo in your own account
  2. Create a project in either Netlify or Vercel
  3. Attach a "listener" to the repo.

Any changes done to the repos will then be reflected on the deployed site/project. So when you do a publish from the plugin, you are changing the repo, which again triggers a build in either platform.

The digital garden gets built using Node.js, which both platforms support. The only difference between the two is how they handle "serverless-functions". These are just small snippets of code that is run on the server, and returns some result. The search functionality in the garden uses these. The two platforms needs these to be setup a bit differently. Until recently, I'd only made this the "netlify way", but I just added a serverless-function that will run on Vercel, making search available on both platforms.

So, as mentioned, because of the recent issues with Netlify I thought it best to use Vercel as the default, as their "Deploy to..." button is working as intended.

amperag commented 1 year ago

Thank you for the very deliberate and thoughtful response!

I understand the reasoning behind the switch from Netlify from Vercel better now. (Although all the technicalities I'm only understanding on a rough level.)

You are right, maybe a small explanation in the docs would be helpful for others who have the same question as me.

Anyway thank you Ole for your great work! Looking forward to all the future updates for the digital garden.