objectbox / objectbox-dart

Flutter database for super-fast Dart object persistence
https://docs.objectbox.io/getting-started
Apache License 2.0
927 stars 115 forks source link

Null-safety migration #149

Closed RTrackerDev closed 3 years ago

RTrackerDev commented 3 years ago

Do you have plans for Null-safety migration? Dart 2.12 will have a stable release soon. I think it will happen in late December on Flutter interact.

greenrobot commented 3 years ago

Let's start by collecting individual action items? Maybe you want to start, @RTrackerDev ?

greenrobot commented 3 years ago

Beta is out, Stable in early 2021: https://medium.com/flutter/announcing-dart-null-safety-beta-4491da22077a

vaind commented 3 years ago

Looking into this already. I've started bothering our dependencies to upgrade too:

$ dart pub outdated --mode=null-safety
Package Name         Current  Upgradable  Resolvable  Latest                 

direct dependencies:
ffi                  ✗0.1.3   ✗0.1.3      -           ✓0.2.0-nullsafety.1    
flat_buffers         ✗1.12.0  ✗1.12.0     -           ✗1.12.0                

dev_dependencies:   
build_runner         ✗1.10.6  ✗1.10.6     -           ✗1.10.6                
ffigen               ✗1.1.0   ✗1.1.0      -           ✗1.1.0                 
objectbox_generator  ✗0.9.0   ✗0.9.0      -           ✗0.9.0                 
pedantic             ✗1.9.2   ✗1.9.2      -           ✓1.10.0-nullsafety.3   
test                 ✗1.15.6  ✗1.15.6     -           ✓1.16.0-nullsafety.11  
vaind commented 3 years ago

Prepared the first bunch of migration-tool hints and implementation changes in dart-lang/native#385. It doesn't enable type-safety yet because our dependencies aren't ready.

Merging the current state to main should be a priority because it doesn't break anything and I don't really want to do rebasing later because of the many changed files.

vaind commented 3 years ago

So the PR with the majority (hopefully!) of the prep work is merged to main - some changes to avoid nullable types, a lot of hints for the migration tool.

To get the null-safety release out, we still need to actually apply the migration-tool changes. I've tried that but there are a lot of blocking issues due to ffigen code not being migrated yet. After it is, we can have another look.

tng2903 commented 3 years ago

Hello, is there any update related to this issue? I want to implement objectbox in my app but got warning about it being legacy.

Katekko commented 3 years ago

Waiting too any answer, trying to upgrade my app but keeping stuck because objectbox (the generator) does not have any version null safe

greenrobot commented 3 years ago

If you dare, please have a look at https://github.com/objectbox/objectbox-dart/tree/next and https://pub.dev/packages/objectbox/versions/0.13.0-nullsafety.0 - more info coming very soon.

vaind commented 3 years ago

@Katekko @RTrackerDev @Buggaboo @tng2903 the 0.13.0-nullsafety.0 prerelease is now available. Please give it a go and share your experience, but being a pre-release I don't suggest you switch completely just yet.

vaind commented 3 years ago

Anyone had a look at or tried 0.13.0-nullsafety.x releases? Going to do a 0.13 release probably today, after the native dependency with the SDK update is out.