Giter Club home page Giter Club logo

Comments (17)

schmittjoh avatar schmittjoh commented on September 17, 2024

Yes I'm working on improving this.

from fosjsroutingbundle.

willdurand avatar willdurand commented on September 17, 2024

@schmittjoh : did you work on this issue ?

from fosjsroutingbundle.

schmittjoh avatar schmittjoh commented on September 17, 2024

Well, I started on this, but my solution would put a dependency on the JMSSerializerBundle; so, I wasn't sure if it would fit into this bundle.

However, if you think this is not a problem, I can submit a PR for it.

from fosjsroutingbundle.

willdurand avatar willdurand commented on September 17, 2024

Why did you use the JMSSerializerBundle ?

Yes, you can submit a PR to let me see your work :)

from fosjsroutingbundle.

schmittjoh avatar schmittjoh commented on September 17, 2024

I've copy/pasted some code as a POC:
6699242

This is far from finished, but just to give you an idea how it would look like. Basically, that code is using some utility functions of the Google Closure Library, and is intended to be compiled with the Google Closure Compiler which replaces these utility functions with raw javascript.

If you think this is good, I could work on migrating the rest of the proprietary code.

from fosjsroutingbundle.

stof avatar stof commented on September 17, 2024

Do we really need JMSSerializerBundle here ? It should be doable using the core Serializer component to remove the dependency. The work should be doable by serializing the RouteCollection as JSON and doing a method call instead of using a bunch of connect method calls inherited from the sf1 plugin way to do.

I don't have issue about using Google Closure as long as the bundle contains the compiled version and the doc explains how to develop using it.

from fosjsroutingbundle.

willdurand avatar willdurand commented on September 17, 2024

I don't like the idea to add a dependency to the JMSSerializerBundle.

from fosjsroutingbundle.

schmittjoh avatar schmittjoh commented on September 17, 2024

Yeah, that's why I didn't continue to work on this.

Anyway, I need it for my set-up as I compile the Javascript aggressively and some of the properties might be renamed so that for example "pattern" becomes "zA" or some other gibberish stuff. The serializer then needs to take that into account, and that's not doable with the core serializer.

from fosjsroutingbundle.

stof avatar stof commented on September 17, 2024

Well, we should probably use a less aggressive compiling in the bundle to be able to use the serializer. Does it seem good for you ?

from fosjsroutingbundle.

schmittjoh avatar schmittjoh commented on September 17, 2024

It's fine for me if we don't type hint the serializer and let people provide
whatever they want (core serializer vs. bundle serializer).

Then I can use aggressive mode in my code and for the bundle we can use a
simpler approach.

On Tue, Sep 6, 2011 at 11:10 PM, Christophe Coevoet <
[email protected]>wrote:

Well, we should probably use a less aggressive compiling in the bundle to
be able to use the serializer. Does it seem good for you ?

Reply to this email directly or view it on GitHub:

#5 (comment)

from fosjsroutingbundle.

willdurand avatar willdurand commented on September 17, 2024

I'm +1 to serialize the RouteCollection in JSON and to connect all routes in one method call.

from fosjsroutingbundle.

stof avatar stof commented on September 17, 2024

I would be a good idea to have a common interface between both serializers (your SerializerInterface as it is a subset) to allow type-hinting the argument when we only use the serialize and unserialize methods but I'm fine with avoiding the type-hint.

from fosjsroutingbundle.

lsmith77 avatar lsmith77 commented on September 17, 2024

Yes .. I am now +1 on moving the JMSSerializerBundle interfaces to core.

from fosjsroutingbundle.

willdurand avatar willdurand commented on September 17, 2024

I'm +1 as well even if I'm weightless :p

BTW, try to keep things simple for the JsRoutingBundle.

from fosjsroutingbundle.

schmittjoh avatar schmittjoh commented on September 17, 2024

@willdurand, what do you think about the draft assuming that we remove the type hint. Do you think it's getting too complex?

from fosjsroutingbundle.

willdurand avatar willdurand commented on September 17, 2024

Sounds good but, as I never played with Google Closure, I'll hope you'll comment your code and you'll provide a compiled version out of the box :) If we remove the jQuery dependency, it's not to add a new dependency.

So, if there is no regression, I'm definitely +1 as I like the usage of the serializer in the response.

from fosjsroutingbundle.

schmittjoh avatar schmittjoh commented on September 17, 2024

Closing this in favor of the PR.

from fosjsroutingbundle.

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.