kossnocorp / typesaurus

🦕 Type-safe TypeScript-first ODM for Firestore
https://typesaurus.com
412 stars 34 forks source link

Migration from v7 to v10 #128

Closed hiroshi-yoodli closed 5 months ago

hiroshi-yoodli commented 5 months ago

I am not sure if this is the right place or there is another forum. Let me know if I should visit somewhere else.

We use typesaurus v7.2.0 quite heavily. Thank you very much for providing the great framework.

As far as I understand v10 is different syntax than v7 and does not have backward compatibility, even though concepts are not changed much. We want to migrate our code to v10, yet it is too big to do it at once. Is it possible to use both v7 and v10 in parallel? If not, are there any good practices to migrate other than rewrite entirely at once?

kossnocorp commented 5 months ago

Hey!

I'm so sorry for the trouble! I understand it's such a huge change, and I wish I hadn't put you in such a position. Unfortunately, I'm a solo person working on this project, and I can do only so much. I can only promise that API won't change much from now on, as I have solved all the shortcomings of the previous version and am pretty happy with the result.


On the topic:

It should be theoretically possible to use both versions and migrate collections one by one unless you use it heavily on the web. One of the big changes is that v10 adopted the Firebase modular structure. There's a Firebase compat module, but using it will require updating and publishing a Typesaurs v7 fork.

If you don't use it on the web, then npm aliases will allow you to use them both (see StackOverflow).

I am trying to remember if firebase-admin also had breaking changes, but if it does, it will also require fork v7 and use aliased Firebase modules.

However, while using both versions is possible, doing so might lead to unexpected issues, so I would migrate and test them all at once.


I'm closing the issue because there's nothing actionable code-wise, but please feel free to continue the discussion here. I'm also available via Twitter DMs and on Telegram.