Live data from Hacker News

Ask HN: JavaScript framework that I can use “right now”?

news.ycombinator.com

11–20 of 24 posts

Re: Ask HN: JavaScript framework that I can use “right now”?

#11
post #7

Earlier quoted context omitted.

My english is awful, I was trying to say it's not really a SPA that I'm making. I want to keep the routing mainly on my back-end and only do ajax calls to my API where needed. But if it's not another alpha-state component I would love to have the added possibility of using one or two extra routes on the JS side. It's just that checking the most popular repos and reading things like these is awful: "We are currently w…

> I want to keep the routing mainly on my back-end and only do ajax calls to my API where needed. I'm not trying to push React (I'm still evaluating it myself), but that sounds like just the job for React components?

Check my other reply. React is great but I think you need to buy the entire stack since one thing leads to the other. "I'm already using JSX so why not add just this one more babel line and get free ES6. It's the last thing I'll add, I swear"

Re: Ask HN: JavaScript framework that I can use “right now”?

#12
jQuery.

I'm the sole developer on a "rails monolith" (254 tables, 540 models/classes, 4 years old), with enterprise-like architecture (ecommerce, event ticket sales, booking engine, access control, etc) and I'm positive the only way I'm able handle it all is because I stick to basic jquery.

My secrets:

- The rails-ujs adapter

- $(document).on('event', '.element', ..) is fantastic. Never debug events ever again

- selectize select's for "find or create" relationships

- cocoon gem for nested form relationships

- parsley for form validation (hooks into html5 validators)

- bootstrap 3

- datatables.net + following the pattern of ajax-datatables-rails (gem - separate classes for each table)

- a single javascript function that accepts a DOM element (body, a modal, section) and initializes all the elements the app knows of (selectize elements, date/time pickers, etc) inside that container

- above function is hooked into by bootstrap's 'bs.modal.shown, bs.modal.hide, tab's, cocoon's 'cocoon:after-insert', etc.

rake stats says: 33k LOC models, 8k LOC controllers, 23k Javascript (though this must be all plugins. I'd guess 3-6k lines of javascript, max)

Needless to say, I don't believe in the frontend javascript hype.

Re: Ask HN: JavaScript framework that I can use “right now”?

#13
post #7

Earlier quoted context omitted.

> I want to keep the routing mainly on my back-end and only do ajax calls to my API where needed. I'm not trying to push React (I'm still evaluating it myself), but that sounds like just the job for React components?

Check my other reply. React is great but I think you need to buy the entire stack since one thing leads to the other. "I'm already using JSX so why not add just this one more babel line and get free ES6. It's the last thing I'll add, I swear"

I thought React was designed specifically so you won't have to buy into the entire stack (unlike Ember and friends). I've used React components without ES6, using plain old jQuery and AJAX calls during component mount (and nothing else). I didn't feel any particular temptation to add more things. Okay I'm lying :) . It's tempting, but it's possible to do without.

Re: Ask HN: JavaScript framework that I can use “right now”?

#14
post #12

jQuery. I'm the sole developer on a "rails monolith" (254 tables, 540 models/classes, 4 years old), with enterprise-like architecture (ecommerce, event ticket sales, booking engine, access control, etc) and I'm positive the only way I'm able handle it all is because I stick to basic jquery. My secrets: - The rails-ujs adapter - $(document).on('event', '.element', ..) is fantastic. Never debug events ever again - sele…

That's amazing! Believe it or not I was mocking a very similar thing (besides rails). And select2. What made me rethink was the heavy dependencie on using datatables and mobile compatibility. Am I worrying too much and datatables.net "just works"?

Re: Ask HN: JavaScript framework that I can use “right now”?

#15
post #13

Earlier quoted context omitted.

Check my other reply. React is great but I think you need to buy the entire stack since one thing leads to the other. "I'm already using JSX so why not add just this one more babel line and get free ES6. It's the last thing I'll add, I swear"

I thought React was designed specifically so you won't have to buy into the entire stack (unlike Ember and friends). I've used React components without ES6, using plain old jQuery and AJAX calls during component mount (and nothing else). I didn't feel any particular temptation to add more things. Okay I'm lying :) . It's tempting, but it's possible to do without.

You weren't using JSX?

Re: Ask HN: JavaScript framework that I can use “right now”?

#16
post #13

Earlier quoted context omitted.

I thought React was designed specifically so you won't have to buy into the entire stack (unlike Ember and friends). I've used React components without ES6, using plain old jQuery and AJAX calls during component mount (and nothing else). I didn't feel any particular temptation to add more things. Okay I'm lying :) . It's tempting, but it's possible to do without.

You weren't using JSX?

I did. It's part of React proper and merely syntactic sugar over React.DOM calls. You can use React.DOM directly, but it doesn't really change your level of investment in the 'stack', IMO.

Re: Ask HN: JavaScript framework that I can use “right now”?

#18
post #12

jQuery. I'm the sole developer on a "rails monolith" (254 tables, 540 models/classes, 4 years old), with enterprise-like architecture (ecommerce, event ticket sales, booking engine, access control, etc) and I'm positive the only way I'm able handle it all is because I stick to basic jquery. My secrets: - The rails-ujs adapter - $(document).on('event', '.element', ..) is fantastic. Never debug events ever again - sele…

Thank you for this comment. Several things there that I will look into! If you don't mind, could you elaborate a bit on the following:

> - $(document).on('event', '.element', ..) is fantastic. Never debug events ever again

> - a single javascript function that accepts a DOM element (body, a modal, section) and initializes all the elements the app knows of (selectize elements, date/time pickers, etc) inside that container

Re: Ask HN: JavaScript framework that I can use “right now”?

#19
- KnockoutJS (to keep HTML generation logic in the HTML)

- jQuery (for small stuff)

- RequireJS (so that you don't have to load all at once)

- MomentJS (Date / Time management done right)

- AmplifyJS (Pub / Sub and localstorage)

I really like KnockoutJS. Easy to learn and it grows with you so that you don't have to complicate your app if not necessary.

Re: Ask HN: JavaScript framework that I can use “right now”?

#20
post #12

jQuery. I'm the sole developer on a "rails monolith" (254 tables, 540 models/classes, 4 years old), with enterprise-like architecture (ecommerce, event ticket sales, booking engine, access control, etc) and I'm positive the only way I'm able handle it all is because I stick to basic jquery. My secrets: - The rails-ujs adapter - $(document).on('event', '.element', ..) is fantastic. Never debug events ever again - sele…

That's amazing! Believe it or not I was mocking a very similar thing (besides rails). And select2. What made me rethink was the heavy dependencie on using datatables and mobile compatibility. Am I worrying too much and datatables.net "just works"?

Thanks! That's a really good point - and it's currently one of the codebases biggest weaknesses. I use DataTables EVERYwhere. They're fantastic - I have tons of places where I need to show thousands of records, so I use server side processing for pagination, filtering, sorting, etc. However, they don't look good on mobile, and the responsive tables plugin is not the greatest. What I actually do (for now) is wrap the table in Twitter Bootstraps .table-responsive class, which basically creates a viewport for the table on mobile. You scroll left/right to see hidden columns. Works pretty well. Long term, I'm not sure what I am going to do as there are no other table plugins with as rich a featureset and I prefer not to write my own.
Post reply on HN