Giter Club home page Giter Club logo

Comments (7)

weierophinney avatar weierophinney commented on May 24, 2024 1

I've actually been thinking about this for some time; thanks for the nudge! I'll try and schedule this for development soon.

from laminas-diactoros.

Xerkus avatar Xerkus commented on May 24, 2024 1

@weierophinney I think we will want to handle this for 3.0.0

from laminas-diactoros.

weierophinney avatar weierophinney commented on May 24, 2024 1

actually... I'm removing from the 3.0 milestone, as it's a bigger issue.

I think the plan should be:

  • Finalize laminas-diactoros-serializer (and instead name it laminas-psr7-serializer)
  • Once that's released, in a minor version, we update the implementations here to proxy to those classes
  • Next major, we remove the implementations

The problem I have with doing this for 3.0 is because there's likely a lot of work for this, and I'd rather not delay pushing out our PSR-7 v2 support for something that's (a) optional, (b) has already lingered years, and (c) is not clearly defined. Because of the history limits with free versions of Slack, I don't have the full discussion notes from when we discussed this in July, 2020. All I have are what are in the minutes from the TSC meeting that month, and... frankly it's vague (e.g. "like to see interfaces created for serialization", "might be better suited as hydrators/extractors") or clearly a larger effort (e.g. "can they create HTTP/2 messages as well as HTTP/1.1").

I'll still start working on it, but I'm going to push to 3.1.

from laminas-diactoros.

weierophinney avatar weierophinney commented on May 24, 2024

I have this extracted here: https://github.com/weierophinney/laminas-diactoros-serializer

I'll be asking the @laminas/technical-steering-committee if we can bring this under the Laminas umbrella during the next TSC meeting (first Monday of July).

from laminas-diactoros.

matt-allan avatar matt-allan commented on May 24, 2024

Awesome, thanks so much!

This is a huge help; I wrote my own serializers using identical serialization so this will just drop right in!

from laminas-diactoros.

weierophinney avatar weierophinney commented on May 24, 2024

@matt-allan During the TSC meeting this week, some suggestions for improving the architecture were provided. I'm going to see which suggestions I can incorporate, and then will bring this back to the TSC. You can, of course, continue to use the package I've created in the meantime; just pin it to a sha1 when you do.

from laminas-diactoros.

weierophinney avatar weierophinney commented on May 24, 2024

I've prepared version 0.2.0 of laminas-psr7-serializer: https://github.com/weierophinney/laminas-psr7-serializer/releases/tag/0.2.0

I'll ask at the next TSC meeting if we can bring that into Laminas proper, and then we can work on updating the classes in Diactoros to proxy to that instead. When we do, we'll emit a deprecation notice, so folks know to update their code to the new library.

One thing to note: laminas-psr7-serializer does not define interfaces. It would be trivial to extract these, but essentially it becomes an interface per serialization type. The only place I see that being worthwhile is with array serialization, as that's the one place you could end up with different implementations. However, even there, it becomes problematic, because you wouldn't be able to rely on deserializing back to an object if the array structures vary, which makes me lean towards not providing interfaces.

from laminas-diactoros.

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.