Git Product home page Git Product logo

Comments (12)

eredo avatar eredo commented on August 30, 2024 3

To keep you posted. I'm working on a new alpha version, which should support current functionality but requires small amount of builder setup. I'll probably have something released by the weekend.

from dartson.

eredo avatar eredo commented on August 30, 2024 1

The latest version 1.0.0-alpha now supports dart 2. Please check the README.md for the setup instructions.

from dartson.

eredo avatar eredo commented on August 30, 2024

Adding support for 2.0 isn't easy and comes with some great changes to the API of dartson (because transformers are no longer supported and builder come with some API and usage changes). There's currently an ongoing discussion in #48 . It would be great if you contribute some insights on how you're using dartson and why you are using it.

I'll definitely provide a newer version of dartson which will support 2.0. However I'm currently struggling in regards of how the API will change and what the benefits of dartson compared to other libraries like json_serializable will be.

from dartson.

rootext avatar rootext commented on August 30, 2024

I use dartson to parse glTF files.
Main benefit compare to other libraries is easy to use:

  1. It just works - one line of code and JSON is deserialized.
  2. No configuration, no additional build steps, no annotations, no boilerplate code etc.
  3. Familiar experience from Java.

To my mind, it much more important than all other features. It is a reason why I use dartson.

I see no reason to write additional code for all my 30 classes to make them serializable using json_serializable. In all other languages there are commonly used libraries, which can serialize/deserialize classes without additional annotations/code. In Dart it is only dartson (as I know).

from dartson.

eredo avatar eredo commented on August 30, 2024

Thanks for the feedback! This is valuable input.
So you're using the Dart VM and not compile to JavaScript?

Based on the current planning, there will be additional build steps in order to support cross platform compatibility. However it might be possible to keep this as small as possible or even only for web targets.

from dartson.

rootext avatar rootext commented on August 30, 2024

So you're using the Dart VM and not compile to JavaScript?

Correct. Desktop only - Windows and Linux. As I see it isn't popular.

By the way, dartson works with SDK 2.0.0-dev.54.0.

from dartson.

rootext avatar rootext commented on August 30, 2024

@eredo,
I've just locally replace dynamic to Object in type_transformer.dart+simple_type_transformer.dart and
JSON to JsonCodec in dartson.dart+dartson_static.dart and the following code compiles and works with SDK 2.0 now:

import 'package:dartson/dartson.dart';

class A {
  int b;
}

void main() {
  var a = new Dartson.JSON().decode('{"b": 1}', new A());
}

How are transformers used in Dartson? Is it required part of Dartson? Is it possible to release light version of Dartson compatible with SDK 2.0? Sorry for noob question.

from dartson.

eredo avatar eredo commented on August 30, 2024

Transformers are only used for dart2js compilation using previous pub build which is no longer compatible. We can go ahead and provide a separate version for now, which only supports VM usage for now.

from dartson.

rootext avatar rootext commented on August 30, 2024

from dartson.

koliyo avatar koliyo commented on August 30, 2024

I have the same need, VM only usage. An updated version would be very appreciated!

from dartson.

eredo avatar eredo commented on August 30, 2024

Closing this. For new issues related to 1.0.0-alpha create a new issue please. For further design discussions and usage experience use #48 please.

from dartson.

rootext avatar rootext commented on August 30, 2024

Thank you

from dartson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.