json_serializable.dart icon indicating copy to clipboard operation
json_serializable.dart copied to clipboard

Null safety version on pub dev

Open nank1ro opened this issue 5 years ago • 9 comments

Hello,

I can't find a null safety version of json_serializable on pub dev. Can you publish one please? I've seen this release json_serializable-v4.0.0-nullsafety.0 here on github. I've tried to use it with:

json_serializable:
    git:
      url: git://github.com/google/json_serializable.dart.git
      ref: 'json_serializable-v4.0.0-nullsafety.0'
      path: 'json_serializable/'

but when I run dart pub outdated --mode=null-safety I get back: json_serializable ✗4.0.0-nullsafety.0 (git) ✗4.0.0-nullsafety.0 (git) ✗4.0.0-nullsafety.0 (git) ✗4.0.0-nullsafety.0 (git) so this release doesn't support null-safety yet

nank1ro avatar Mar 05 '21 16:03 nank1ro

I've checked the pubspec of the release mentioned above, and I found:

environment:
  # Keeping this <2.12.0 because the code is not null safe – yet!
  sdk: '>=2.11.99 <3.0.0'

So, it's not null safe yet

nank1ro avatar Mar 05 '21 16:03 nank1ro

@nank1ro you are correct. It is not null safe but the code generated is, i have pending PR waiting to merge which which makes it completely operational.

tikyanatwork avatar Mar 05 '21 21:03 tikyanatwork

How much it takes to release new version with null-safety ? I'm stuck on some tasks which related to library 🤦🏽‍♂️

arefrafei92 avatar Mar 05 '21 23:03 arefrafei92

@z85510 – this package generates null-safe code – as of v4

The code itself is not null safe, but that shouldn't affect your package.

kevmoo avatar Mar 05 '21 23:03 kevmoo

Ignore the --mode=null-safety bits for this package. This code is run outside of your code.

kevmoo avatar Mar 05 '21 23:03 kevmoo

Waiting on down-stream dependencies to update first. This shouldn't block anyone from using this package w/ null-safety, though – as long as you're just using it as a normal builder.

kevmoo avatar Mar 07 '21 20:03 kevmoo

I think we also need json_annotation to be null-safety as well.

namchuai avatar Mar 18 '21 04:03 namchuai

@namchuai it's already null safety

fryette avatar Mar 18 '21 09:03 fryette

v4.1.0 is out!

kevmoo avatar Mar 19 '21 21:03 kevmoo