Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A new chapter: Hive v4 #1225

Open
simc opened this issue Aug 1, 2023 · 23 comments
Open

A new chapter: Hive v4 #1225

simc opened this issue Aug 1, 2023 · 23 comments
Labels
enhancement New feature or request

Comments

@simc
Copy link
Member

simc commented Aug 1, 2023

Dear Hive Community,

I'd like to apologize for my lack of support and updates for Hive over the past year. Despite this, your commitment to the community has ensured that the package is still in a remarkably good state, and for that, I'm incredibly grateful.

As many of you know, I have spent a lot of time optimizing Isar to be as fast, reliable, and fun to use as possible. However, I recognize that a lot of you truly appreciate the simplicity of Hive. The thought of discontinuing Hive did cross my mind, but I now see a much more constructive way forward:

Over the next several weeks and months, I plan to invest my energy into the development of Hive v4. The primary focus will be to maintain the user-friendly interface and feature set that you've come to love. However, instead of continuing with the custom storage engine that has been causing several issues, we will transition Hive's data storage to Isar.

This significant change comes with several exciting advantages, including support for multiple isolates, significantly improving resource efficiency and reducing startup time, among others. Moreover, this will simplify the maintenance of Hive, ensuring its longevity through sustained support.

I cannot thank you enough for your continued support and use of Hive. Together, let's continue to make it a tool we all love and rely on. 💜

Simon

@simc simc added problem An unconfirmed bug. enhancement New feature or request and removed problem An unconfirmed bug. labels Aug 1, 2023
@simc simc pinned this issue Aug 1, 2023
@Zchandev
Copy link

Zchandev commented Aug 4, 2023

Great news!

I love Isar, but I also still use Hive in the same project, because it's just a simple key-value storage.

I use it to store cache, counters, json responses, lists and maps. I don't need complex stuff like indexes and queries, because I already have that data in isar.

@themisir
Copy link
Contributor

themisir commented Aug 7, 2023

Hey Simon, thanks for an update! I am wondering what's your plans regarding storage migration. How do you think to handle the transition to make sure existing applications won't lose any data.

Also considering both hive and isar has (or had) their own way of encoding data types, not sure about isar, but hive also have support for writing custom encoders/serializers. What's the plan for migrating them?

@simc
Copy link
Member Author

simc commented Aug 9, 2023

I am wondering what's your plans regarding storage migration.

That's indeed the biggest problem to solve. I think the best approach for now is to let the hive generator generate migration code.

For custom encoders & decoders I didn't find a solution yet. Maybe we can just deprecate them and ask users who rely on them to stay on Hive v2

@themisir
Copy link
Contributor

themisir commented Aug 9, 2023

Are you planning to support database queries like Isar does? If so, then it's tough, I don't have an idea to create smooth migration plan.

If not (only key to value lookups), maybe we can continue using the existing hive generated (and custom) encoders to encode structs into byte stream and store it within isar with its respective key.

@jamesdixon
Copy link

This is really exciting news!

Are you planning to support database queries like Isar does? If so, then it's tough, I don't have an idea to create smooth migration plan.

In my opinion, a migration to Isar as the data store should focus solely on that and leave out advanced functionality that Isar could provide. That simplifies the migration and maintains the simplicity of Hive. If you need more advanced functionality, using Isar directly is likely a better fit.

@simc
Copy link
Member Author

simc commented Aug 14, 2023

Are you planning to support database queries

In my opinion, a migration to Isar as the data store should focus solely on that

Yeah agreed! I think Hive has a good feature set and if someone is looking for queries, Isar should be used directly. The only feature I think would be valuable for Hive is (optional) atomic transactions.

@simc
Copy link
Member Author

simc commented Aug 21, 2023

I merged my work in the main branch. Check it out and provide feedback please 💜

@t-kozak
Copy link

t-kozak commented Aug 21, 2023

Hey @simc , that plan sounds great!

I wanted to use Isar but decided to stick with Hive, as Hive supports Flutter on the web. With the migration to Isar as the engine for Hive, will it still work over IndexedDB?

@holocronweaver
Copy link

holocronweaver commented Aug 22, 2023

This is promising, but I have a few questions.

Is there a list of things that Hive v4 will lack vs. v2?

Will there be a v2 support branch if v4 will not have feature parity?

Also what of Hive v3, is it being abandoned?

BTW, thanks for all this work! Glad to hear Hive will live on in one form or another.

@simc
Copy link
Member Author

simc commented Aug 22, 2023

With the migration to Isar as the engine for Hive, will it still work over IndexedDB?

No. Isar web uses SQLite compiled to WASM and so will Hive.

Is there a list of things that Hive v4 will lack

I don't think there is anything Hive v4 will lack. The API is almost identical with a few minor differences.

Edit: HiveObject and HiveList will be removed.

Also what of Hive v3, is it being abandoned?

To my knowledge Hive v3 was never released as a stable version and I don't have time to maintain it unfortunately.

@simc
Copy link
Member Author

simc commented Aug 22, 2023

I published the first version of Hive v4 and I'd love to hear your feedback

@978bobs
Copy link

978bobs commented Aug 23, 2023

Does "No more code generation" mean that we don't need to reference a generated file like part 'main.g.dart';?

If so sounds pretty good. As a follow-on, does this also hold for Isar 4.0?

@t-kozak
Copy link

t-kozak commented Aug 24, 2023

@simc, thanks for reply. Can you confirm that given this issue: isar/isar#1362 (Isar on the web supports only in-memory sqlite), in practice, Hive v4 cannot be used as a persistency service on the web?

@simc
Copy link
Member Author

simc commented Aug 24, 2023

Not right now that's correct @t-kozak. I hope to implement that before a stable release

@pishguy
Copy link

pishguy commented Sep 1, 2023

Because MY_APP depends on hive ^4.0.0 which doesn't match any versions, version solving failed.

You can try the following suggestion to make the pubspec resolve:

  • Consider downgrading your constraint on hive: flutter pub add hive:^2.2.3

@sprimm98
Copy link

sprimm98 commented Sep 2, 2023

@pishguy You can use hive: ^4.0.0-dev.2 to get access to the pre-release :)

@jamesdixon
Copy link

@simc we're working on testing this and noticed that it's leveraging Isar 4 Alpha. Any timeline on Isar 4 getting to stable? Also, any chance that Hive 4 could leverage Isar 3?

@Yetispapa
Copy link

Hi @simc,

First of all, I want to express my sincere appreciation for all your hard work on Hive and the dedication you've shown to the community. Hive has been an invaluable tool for me, and I'm excited to see its future unfold with Hive v4.

I'm sure many of us are eager to get our hands on the new Hive v4. Do you have a rough estimate of when we can expect a release candidate or a beta version?

Lastly, cheers from Munich! 🍻

Looking forward to Hive's continued evolution and success.

@rivella50
Copy link

@simc Do you have any rough time schedule when a stable release for Hive v4 will be available?

@sonysm
Copy link

sonysm commented Feb 6, 2024

Please make it happen i can't wait to see Hive V4.0.0 official release

@Macacoazul01
Copy link

@simc Do you have any rough time schedule when a stable release for Hive v4 will be available?

At the same week US starts using metric system 👀.

@giridat
Copy link

giridat commented Feb 28, 2024

LGTM!

@stavgafny
Copy link

Hi @simc,
I tried the v4 pre release version(^4.0.0-dev.2) and its absolutely awesome, registering the type with its .fromJson method is such an elegant way.
I really want to use it on my app and just wondering when will there be stable release.
If its still got time can you maybe specify how unstable it is? I would love to switch to that for an Android app I'm working on.

Anyway thanks for making this amazing package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests