Giter VIP home page Giter VIP logo

Comments (21)

tom91136 avatar tom91136 commented on May 22, 2024

+1

from parceler.

johncarl81 avatar johncarl81 commented on May 22, 2024

Fantastic idea guys. I actually started working on this a few weeks ago after IcePick integration was closed. How does "Bundler" sound for a library name? https://github.com/johncarl81/bundler. I decided to make this a new library to keep Parceler small and focused on a single problem.

By the way, the functionality that IcePick offers exists in Transfuse right now under the @NonConfigurationInstance annotation http://johncarl81.github.io/transfuse/documentation.html#nonconfigurationinstance. So, if you're a user of Transfuse you already should have this available.

Also you will find Parceler integrated with Transfuse via the @Extra injections http://johncarl81.github.io/transfuse/documentation.html#extra.

Along the same lines, @f2prateek was gratious enough to accept my PR to integrate Parceler with android-dart: https://github.com/f2prateek/android-dart.

Lots of activity in this direction. Lets do it!

from parceler.

 avatar commented on May 22, 2024

Bundler sounds good to me.
I kind of had a feeling I read about a similar feature in transfuse.
Seems it doesn't work for fragments yet, though - johncarl81/transfuse#115.
Once it does, I'll switch from Icepick to @NonConfigurationInstance.
I'll take a look if t his is something I can implement myself an create a pull request. Not sure if I can do it today, though.

from parceler.

tom91136 avatar tom91136 commented on May 22, 2024

There's like 3 implementations the same idea: Dart, Icepick, Bundler. Which one is compatible with Parceler?

from parceler.

johncarl81 avatar johncarl81 commented on May 22, 2024

Dart is compatible with Parceler, Bundler will be (that's my implementation). Icepick is not directly compatible unless you rely on Parceler's generated code.

from parceler.

tom91136 avatar tom91136 commented on May 22, 2024

Is bundler functional? I've checked the readme but it only has license and nothing else....

from parceler.

johncarl81 avatar johncarl81 commented on May 22, 2024

Bundler is a work in progress, and is missing some key components currently. Stay tuned!

from parceler.

mdumrauf avatar mdumrauf commented on May 22, 2024

@johncarl81 maybe Bundler is confusing, having Ruby's Bundler going around. What will this library do?

from parceler.

johncarl81 avatar johncarl81 commented on May 22, 2024

@mdumrauf, This library will do butter-knife style injection of Bundle-able properties, automatically handling @Parcel wrapping/unwrapping, like so:

class ExampleActivity{
    @InjectExtra("one") int one;
    @InjectExtra("two") ParcelExample two;
}

@Parcel class ParcelExample{/*...*/}

Yes, this collides with the ruby library... do you have a name suggestion?

from parceler.

mdumrauf avatar mdumrauf commented on May 22, 2024

Hmm..maybe extractifier? I'm no good at naming. Btw, have you checked this very same feature done in android annotations? https://github.com/excilys/androidannotations/wiki/Extras

from parceler.

johncarl81 avatar johncarl81 commented on May 22, 2024

@mdumrauf, yes, the idea is to inject/pull extras from annotated fields just like AndroidAnnotations does with two differences: 1. Support Parceler transparently, 2. Not require the bean to be "enhanced".

By the way, Transfuse implements extra injection that transparently supports Parceler:
http://androidtransfuse.org/documentation.html#extra

from parceler.

johncarl81 avatar johncarl81 commented on May 22, 2024

Hmm, how about Android Arguments?

from parceler.

johncarl81 avatar johncarl81 commented on May 22, 2024

Is there any interest in a fork of Icepick with Parceler support? Im considering releasing it on Maven central: https://github.com/johncarl81/icepick/tree/parceler_support

from parceler.

almozavr avatar almozavr commented on May 22, 2024

Is there any interest in a fork of Icepick with Parceler support?

Would be great

from parceler.

ppamorim avatar ppamorim commented on May 22, 2024

+1

from parceler.

jacobtabak avatar jacobtabak commented on May 22, 2024

Yes

On Thu, Feb 26, 2015, 8:48 AM Pedro Paulo de Amorim <
[email protected]> wrote:

+1


Reply to this email directly or view it on GitHub
#36 (comment).

from parceler.

MichaelEvans avatar MichaelEvans commented on May 22, 2024

+1

from parceler.

jonathan-caryl avatar jonathan-caryl commented on May 22, 2024

+1

from parceler.

rockerhieu avatar rockerhieu commented on May 22, 2024

+1

from parceler.

tom91136 avatar tom91136 commented on May 22, 2024

I decided to roll my own Ickpick. It is written from scratch and works perfectly with Parceler, please take a look here.

One of the more unique feature of my library is that it supports a pluggable compile-time code generation system. The parceler support is done with ONLY the following lines:

@TransformationTemplate(
        save = @StatementTemplate("{{bundle}}.putParcelable({{keyName}}, org.parceler.Parcels.wrap({{fieldName}}))"),
        restore = @StatementTemplate(type = Type.ASSIGNMENT,
                                     value = "org.parceler.Parcels.unwrap({{bundle}}.getParcelable({{keyName}}))",
                                     variable = "{{fieldName}}"),
        filters = {@TypeFilter(type = @TypeConstraint(type = Parcel.class))}
        )

from parceler.

johncarl81 avatar johncarl81 commented on May 22, 2024

Awesome work @tom91136!

from parceler.

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.