Comments (12)
It looks like this would be extremely easy to add. Any interest?
from js-routes.
And why is that? js routes comfortable that they have the same name as the ruby :)
from js-routes.
To solve the problem of case mismatch. If the standard / accepted case in the JS community is lower camel case, simply because something originates from a ruby source doesn't necessarily mean that it should retain the ruby standard case. Put a different way, if there was some piece of code that originated from javascript and was used in ruby, would you be at all put off by having to use camel case in a ruby file?
from js-routes.
So when data come from Rails/Ruby API in JSON format, do you also convert each key in camel-case?
from js-routes.
I have never done this myself, but it's not for lack of wanting the feature. I just haven't taken the time to search for a library that does this or patch rails for allowing it. If rails provided this feature out of the box, I'd use it.
from js-routes.
I would say that I am pretty ok with option like :camelcase => true
.
But this is more likely to bring problems than solve them: track some helper usage in code becomes harder.
Anyway @jtrim concerns sounds reasonable to me.
from js-routes.
@bogdan I tend to agree with your assertion on tracking helper usage in a library. However, a problem isn't any less of a problem simply because the solution is hard.
from js-routes.
@jtrim you can go ahead with a patch. Please also update a doc and add a test case.
from js-routes.
Sounds good, will do. Thanks guys!
from js-routes.
You can actually do both. As the holy-war of the case will never end.
I don't think it will generate any issues, except for the fact that there will be a bit more code.
And confusion when people will use both cases in the same source.
from js-routes.
@slash Don't generate both cases -- in addition to inviting people to deviate from whatever the project's convention is as you mentioned, it'd double the size of the routes JS file.
from js-routes.
I think we can also close this issue :)
from js-routes.
Related Issues (20)
- TypeError: Cannot set property 'NameSpace' of undefined at version 2.0.7 HOT 2
- Don't know how to build task 'js:routes' HOT 9
- Typescript doesn't resolve properly the dynamic routes module HOT 5
- No default export in Typescript definitions file HOT 2
- Automatic updates via rack middleware HOT 5
- Prefer default_url_options over implictly filling with params when passing options hash HOT 2
- module_type: nil causes "NIL is not supported by runtime" HOT 4
- Thoughts for using with webpacker within a Rails engine HOT 2
- Task not found in Rails 7 app HOT 9
- Custom output path HOT 8
- Custom output path HOT 2
- module_type: nil causes "NIL is not supported by runtime" HOT 8
- NameError: uninitialized constant JsRoutes::JsRoute HOT 6
- function to get all paths to do custom filtering and selecting? HOT 3
- Error: Cannot read config file: while running yarn lint HOT 3
- Upgrade `rake assets:precompile` to `update js-routes` files in Rakefile did not work for me HOT 13
- ESM Tree shaking not working because __jsr.r() is potentially impure HOT 3
- Use configured Webpacker directory instead of default
- Options style route params HOT 8
- Emoji caused URIError: URI malformed HOT 1
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 js-routes.