Comments (17)
Yes I'm working on improving this.
from fosjsroutingbundle.
@schmittjoh : did you work on this issue ?
from fosjsroutingbundle.
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.
Why did you use the JMSSerializerBundle ?
Yes, you can submit a PR to let me see your work :)
from fosjsroutingbundle.
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.
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.
I don't like the idea to add a dependency to the JMSSerializerBundle.
from fosjsroutingbundle.
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.
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.
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:
from fosjsroutingbundle.
I'm +1 to serialize the RouteCollection in JSON and to connect all routes in one method call.
from fosjsroutingbundle.
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.
Yes .. I am now +1 on moving the JMSSerializerBundle interfaces to core.
from fosjsroutingbundle.
I'm +1 as well even if I'm weightless :p
BTW, try to keep things simple for the JsRoutingBundle.
from fosjsroutingbundle.
@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.
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.
Closing this in favor of the PR.
from fosjsroutingbundle.
Related Issues (20)
- Wrong route in dev env. missing index.php in route HOT 2
- Exception when a route name is a parsable number
- Error: spawn bin/console ENOENT HOT 7
- webpack-inject-plugin > loader-utils vulnerability HOT 4
- Routing isn't finding any routes HOT 2
- webpack problem /FosRouting.js" contains a reference to the file ....
- Symfony 6.3 deprecations
- Symfony 6.3 deprecations when dump routes HOT 1
- Overwriting php location causes console errors that --php is not a valid options
- Document how to install using AssetMapper HOT 10
- Session handling is incompatible with stateless routes introducted with Symfony 6.3
- Run webpack encore and execute php fos:js-routing:dump separately HOT 2
- Support Symfony 7 HOT 6
- 3.4.0 not working with Symfony 6.4 HOT 11
- TS2732: Cannot find module './routes.json'. Consider using '--resolveJsonModule' to import module with '.json' extension.
- Is it possible to `npm install` | `yarn install` the router? HOT 1
- modify dump command to generate export call in js routes file.
- glob-parent package vulnerability
- Deprecation notice on Symfony's DependencyInjection/Extension
- High Vulnerability found after install FOSJsRoutingBundle
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fosjsroutingbundle.