4 ms·
I'm not a RoR boy, but sometimes watch RoR screencasts to pick out good points. Really surprised that RoR was using its own JS library and has not adopted any o
by clu3 15y ago
I'm not a RoR boy, but sometimes watch RoR screencasts to pick out good points. Really surprised that RoR was using its own JS library and has not adopted any other dedicated js lib out there
Drupal for example, initially had its own js lib, but then adopted jQuery officially many years ago
Edited: I must have misunderstood the RJS's purpose. Thought it was a JS lib, but it's not, it's just a way to generate JS code. And so i learned RoR's been using prototype. Sorry RoR fans, my bad
- ryanbrunner 15y agoRails doesn't have it's own JS library. It initially used only the prototype library (which exists outside of Rails), but with Rails 3 any javascript supplied by Rails was made library agnostic. RJS is a rails specific thing, but it's more a method of generating javascript inside of rails than a JS library in it's own right. This change simply changes the default from Prototype to JQuery - a long-overdue change IMO, since the vast majority of the Rails community has been using solely JQuery for quite a long while now. Here's hoping that the same treatment is done to RSpec vs. TestUnit.
- vijaydev 15y agoDHH had already made it clear that RSpec will not get into Rails.
- deleted 15y ago[deleted]
- philcrissman 15y agoRspec doesn't really need to be in the default stack; switching to it takes what; a minute? That's not a benchmarked timestamp, but I'm just saying... :-)
- JonnieCache 15y agoPrototype was never "rails' own" js library. It existed before rails AFAIK.
- xal 15y agoPrototype was actually written by Sam Stephenson who these days works at 37signals and has been part of the Rails Core team since it's inception (read, before making prototype). Prototype is a stand alone library and predates jQuery by almost two years. jQuery is more or less a direct descendent of Prototype and reimplemented all it's features with a slight twist to emphasis method chaining which was a key insight that simplified everything.
- JonnieCache 15y agoI stand corrected.
- deleted 15y ago[deleted]
- pilif 15y agoerm... Ruby On Rails was bundling prototype ever since and was using that by default for their JS needs. Prototype might actually be a tad bit older than jQuery even and it tries hard at "rubyfying" JavaScript. Because it does so by happily extending built-in prototypes and because it's a huge amount of monolithic code, over the years, people began moving to jQuery. And now, finally, Rails is moving too. Also note that with Rails 3.0, they began using data-* attributes for the framework-provided JS-dependent logic, so it became possible to easily replace the built-in prototype with jQuery. For 3.1, they are just switching the default.
- rsbrown 15y agoRails has been using prototype/scriptaculous up to now.