TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: What's the best way to build Javascript widgets today?

3 pointsby jasongullicksonover 12 years ago
We're working on moving our site from a straight-up ROR app to hypermedia API on the back-end (still running on Rails) and Javascript/HTML5 on the front.<p>I've used everything from raw Javascript to jQuery to Dojo to build client-side components against a REST API before, and I'm comfortable with going that direction, but I'm asking the community here if something has come along that supersedes these tools for this sort of application?<p>In particular we want to develop a modular set of controls that can operate in a stand-alone fashion, composed only of client-side code but can also be combined and hosted in existing Rails-served pages as well as static HTML.<p>Thoughts?

3 comments

justinfover 12 years ago
JQuery still seems to be king at the moment. There's some pushback against it in this new world of a mobile web since it adds size to low-bandwidth pages, but there doesn't seem to be a risk that it'll be dethroned any time soon.<p>If I were looking to make a portable and semi-futureproof toolkit right now, I'd use jQuery as a base, but limit myself to some big features, like dom queries, events, and ajax. Then I'd make sure I had it sandboxed inside all my code via anonymous functions (function($) { /* my code */ })(jQuery); so I could swap in a lighter replacement later on without a headache.
评论 #4886974 未加载
tjholowaychukover 12 years ago
Check out <a href="https://github.com/component" rel="nofollow">https://github.com/component</a>
dotborgover 12 years ago
Moving stuff into CSS seems to be a good direction. i.e. you don't have to code shadows/animations/etc. in JS anymore.