TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Why we left AngularJS

296 点作者 route66超过 11 年前

48 条评论

dchuk超过 11 年前
A lot of people seem to think that Single Page App frameworks like Angular&#x2F;Ember are suitable for use on the public facing client side. I&#x27;ve always believed that SPAs are meant to be behind a login, where you don&#x27;t have to also deal with spiders and other sub-optimal browsing devices, and you have a little bit more wriggle room when it comes to routing and web history.<p>Just look at Blogger...their client-side rendering is annoying as all get out. It&#x27;s just a blog post, render it server side and give me the content, then sprinkle on some gracefully degrading JS on top to spice it up.<p>I say this as a huge proponent of Angular who uses it for all his web app projects who also wouldn&#x27;t ever use it on a public facing application.
评论 #7256891 未加载
评论 #7256004 未加载
评论 #7255495 未加载
评论 #7255507 未加载
评论 #7255515 未加载
评论 #7256212 未加载
评论 #7256186 未加载
评论 #7257748 未加载
评论 #7257501 未加载
评论 #7255504 未加载
neya大约 11 年前
I had the opportunity to work for a million dollar budget client project, about a year ago. (Obviously I&#x27;m bound by an NDA, so I won&#x27;t go into specifics). You can think of this site like an oDesk&#x2F;Freelancer competitor, but with some social features.<p>We also had another team from California working on this project, who consistently insisted that we go with Angular for a project of such complexity. Back then, on HN, everybody was writing about how awesome Angular is, and how you must use it for your next project and so on. It reminded me of the early MongoDB days here.<p>I was under constant pressure from my client too, since he was also reading a lot about Angular everywhere and the Californian company had him almost brainwashed in favor of angular. After already falling trap for the MongoDB buzz (I used MongoDB for the wrong use-case and suffered the consequences), I decided to carefully evaluate the decision to go with Angular for the project.<p>After about 6 months of using Angular for a different medium-scale project, I decided against it for my client. I realized that Angular is the all powerful Battle Tank. It can do everything you want it to. But it&#x27;s very tempting to choose a battle tank when all you need is a sedan to get you from home to office.<p>Angular has it&#x27;s own use-cases, but for the most part what I observed was that you could get a lot of mileage without using Angular, with just plain Jquery+Knockout (or any other similar framework of your choice) for most of the front-end.<p>In a simple calculation that I made (to pitch to my client), I estimated about easily 25% of time (and thus money) savings by not going with Angular for our project. (YMMV)<p>Usually I tend not to open my mouth about&#x2F;against angular here because most HNers seem to like Angular a lot and they downvote without a reason just for having a different opinion. But, I am really glad someone wrote a blog post about this.
评论 #7257735 未加载
评论 #7257682 未加载
评论 #7259304 未加载
评论 #7258028 未加载
评论 #7258433 未加载
评论 #7257939 未加载
评论 #7257737 未加载
评论 #7258067 未加载
randomdrake超过 11 年前
This mayaswell be titled: &quot;Why we&#x27;re paying for re-discovering client-heavy apps are hard or bad.&quot; Angular, or &lt;insert hot new JavaScript framework&gt; doesn&#x27;t particularly matter.<p>Twitter learned it[1].<p>Lots of us learned it when we were experimenting as Web 2.0 was being born. Things were far more obvious, far more quickly then, as bandwidth and resources weren&#x27;t anywhere near what they are today. Back then, we quickly realized that just a couple of delayed asynchronous calls could cause your app to slow to a halt and feel sluggish.<p>That&#x27;s not to say it can&#x27;t be done[2], it&#x27;s just to say that, thus far for the most part, folks end up discovering reasons why they didn&#x27;t &quot;do it right&quot; too late over and over. I could be wrong, but I feel like there&#x27;s been a few posts to Hacker News within the past couple months with similar sentiment.<p>When people start suggesting client-side rendering, I usually ask something along these lines:<p>Why on earth would you leave something as simple as textual document model creation up to the client&#x27;s 5 year old machine that is busy playing a movie, a song, downloading a torrent, doing a Skype call, and running 15 other tabs, when your server is sitting around twiddling it&#x27;s thumbs with it&#x27;s 8 cores, scalable, SSD and memory-heavy architecture?<p>[1] - <a href="https://blog.twitter.com/2012/improving-performance-on-twittercom" rel="nofollow">https:&#x2F;&#x2F;blog.twitter.com&#x2F;2012&#x2F;improving-performance-on-twitt...</a><p>[2] - <a href="http://www.quora.com/Web-Development/What-are-the-tradeoffs-of-client-side-rendering-vs-server-side-rendering/" rel="nofollow">http:&#x2F;&#x2F;www.quora.com&#x2F;Web-Development&#x2F;What-are-the-tradeoffs-...</a>
评论 #7255557 未加载
评论 #7255545 未加载
shirro超过 11 年前
I need to stop clicking on the &quot;why we left x for y&quot; articles on HN. Mostly people have picked the wrong tool for the particular job and the articles are just an embarrassment.<p>Obviously SPAs take a lot of extra work to make search engine friendly and are probably going to be the wrong tool for the job for any site which requires that. Much of the web isn&#x27;t searchable and doesn&#x27;t want to be searchable. If you are writing a web app to solve some business problem which sits behind a login angular really isn&#x27;t a problem.<p>Think of the millions of poorly maintained and inflexible VB and Java business apps out there that are due to be replaced and the employees who are wanting to do business on the road with their macbooks, chromebooks and tablets. There is your market for Angular.
评论 #7257293 未加载
Cthulhu_大约 11 年前
&gt; 3. Slow, complex build tools<p>Slow... depends on what you&#x27;re used to; I&#x27;ve worked with Java &#x2F; Maven and such, and one step worse, Scala; if you want slow, go for those.<p>Complex. The author links to a certain gruntfile[0] as an example of a large, unmaintainable gruntfile, but apparently people forget that a gruntfile is just a Javascript &#x2F; NodeJS file, and thus can be broken up into more manageable chunks - like any code[1]. Alternatively, there&#x27;s newer, less config, more code build tools like Gulp.js[2].<p>#4 is also no longer valid; Angular&#x27;s Protractor[3] wraps around Selenium etc and deals with angular&#x27;s asynchronous behaviour, as long as you stay within angular&#x27;s framework.<p>And #5 is to be blamed on the developer for not having attention to performance &#x2F; total load times, not the framework.<p>I&#x27;m defensive, but then, I don&#x27;t have a public-facing app.<p>[0] <a href="https://github.com/ngbp/ngbp/blob/v0.3.1-release/Gruntfile.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ngbp&#x2F;ngbp&#x2F;blob&#x2F;v0.3.1-release&#x2F;Gruntfile.j...</a> [1] <a href="http://www.thomasboyt.com/2013/09/01/maintainable-grunt.html" rel="nofollow">http:&#x2F;&#x2F;www.thomasboyt.com&#x2F;2013&#x2F;09&#x2F;01&#x2F;maintainable-grunt.html</a> [2] <a href="http://gulpjs.com/" rel="nofollow">http:&#x2F;&#x2F;gulpjs.com&#x2F;</a> [3] <a href="https://github.com/angular/protractor" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;angular&#x2F;protractor</a>
carsongross超过 11 年前
I&#x27;ve been working on an Angular alternative called IntercoolerJS:<p><a href="http://intercoolerjs.org/" rel="nofollow">http:&#x2F;&#x2F;intercoolerjs.org&#x2F;</a><p>The idea is to keep a lot of the advantages of the traditional web development model, but, via HTML5-style attributes, RESTful URL design and partial driven UX, achieve a better UX.<p>It&#x27;s not for everyone or for every problem, and it is still in pre-alpha (we are going to change from a preamble to HTTP headers for meta-directives, for example) but, if you find Angular too heavy-weight and foreign for your UI, it might be of interest.<p>Please contact me if you are interested in contributing.
评论 #7255871 未加载
评论 #7256939 未加载
dlau1超过 11 年前
Have you tried react.js [1] ? If you use node to serve your content, you can pre-render the initial state of your app. When everything loads up, react will take a checksum of the rendered portions to ensure that it doesn&#x27;t re-render the same DOM. This should come close to solving your SEO&#x2F;test issues with minimal work.<p>In my opinion, a setup like this is close to what the next big wave of frameworks will use.<p>You can break your layout up into parts and have a site that is partially dynamic and partially static. You just pass the html that react renders to your templating engine.<p>Getting everything setup correctly can be a little hassle, but gulp is fast enough when doing a watch on the compilation step. Of course, because everything is javascript you share the exact same component code between client and server.<p>This is a good example that helped me a bit[2]<p>[1] <a href="http://facebook.github.io/react/" rel="nofollow">http:&#x2F;&#x2F;facebook.github.io&#x2F;react&#x2F;</a> [2] <a href="https://github.com/mhart/react-server-example" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mhart&#x2F;react-server-example</a>
评论 #7255405 未加载
评论 #7256843 未加载
taude大约 11 年前
One thing people don&#x27;t really think about is that this whole notion of SPA is kind of a pipe-dream, overkill. There might be some apps that are really a single page application (likely just those simple, demo add task apps), but most really can be broken down and composed of many mini-applications.<p>For example, how often do your users go to their settings page? Does that need to be part of the SPA? Have a complex Settings pages that&#x27;s composed of 5 or six tabs and 20 different user interactions? Maybe the settings page is itself it&#x27;s own mini-SPA<p>How does a user flow through your app, do they really need every screen bundled under a single SPA?<p>Routing issues, complexity, code dependencies, etc...are all good reasons to not make one monolithic application, even if it&#x27;s behind a login.<p>Likely your SPA should really be an app composed of a bunch of smaller SPAs. You search functionality...mini app, your separate workflows...a mini app, your timeline...mini app. history view...mini app, etc...<p>Breaking your app down into a bunch of smaller SPAs has a lot of advantages and implicit modularization, as well as productivity gains when working on bigger projects with bigger teams.
评论 #7261331 未加载
danabramov超过 11 年前
We&#x27;re using Backbone+React so this may not be applicable.<p>However...<p><i>“You can separate your dev and production build pipelines to improve dev speed, but that’s going to bite you later on.”</i><p>In my experience, you <i>must</i> separate dev and prod pipelines. It has never bitten me because I make hundreds dev (local) and dozens kinda-prod (staging server) builds a day.<p>For dev builds, Grunt just compiles LESS but doesn&#x27;t touch the scripts so there is literally <i>no</i> delay there. In dev environment, we load scripts via RequireJS so there is no need to maintain a properly sorted list of scripts too.<p>For production, we concat them with grunt-contrib-requirejs with `almond: true` so RequireJS itself is stripped out completely. Production build takes time (10 to 15 seconds; we&#x27;re also running Closure Compiler), but it&#x27;s never a problem.<p>Even adding JSX (Facebook React) compilation didn&#x27;t cause a slowdown for dev builds because grunt-contrib-watches compiles them on change and puts into a mounted directory.
评论 #7255468 未加载
jbeja超过 11 年前
I am curious to know why you go for a full js app approach from the begining, knowing that your app would be very dependable from content that needed be indexed by search engines overall?
评论 #7255376 未加载
jaunkst超过 11 年前
I have to disagree with most of this article. 1. Bad search ranking and Twitter&#x2F;Facebook previews Don&#x27;t force your public side to strictly angular. Serve normal pages and use angular for your interactive components. Let Google index a well formed dom. Use a full angular stack for your non public facing application(a SaaS application). You don&#x27;t want to index this anyways.<p>2. Flaky stats and monitoring Use event driven metrics from your api and or client side. Track everything in the sense of user, controller, action, params. Blacklist sensitive data. Derive metrics with funnels, user did x actions, returned and subscribed. Conversion! It&#x27;s all there just understand your events.<p>3. Slow, complex build tools. Your not limited to grunt, or node. For example we use rails and use our own buildscripts and generators to build fullstack angular apps. Easy Breezy.<p>4. Slow, flaky tests There is room for improvement. But jasmine and phantom can get the job done. But let&#x27;s not forget were also testing our api. Use your goto testing framework and let jasmine phantomn do the client frontend testing.<p>5. Slowness is swept under the rug, not addressed Precompile your angular templates, only wait for api responses. Don&#x27;t fragment your page load into seperate request. Resolve all the requires data beforehand in the route provider.
评论 #7255491 未加载
Eric_WVGG超过 11 年前
I’m as big an Angular evangelist as anyone, but that bit about search rankings is an absolute killer.<p>You talk about these server-side webkit parsers as tricks that “slow things down,” which indicates that you at least ultimately got them working. I never got that far.
评论 #7255388 未加载
评论 #7255370 未加载
评论 #7255454 未加载
kirushik超过 11 年前
For sake of correctness — recent versions of Phantom.js are not dependent on Xvfb or any other variant of X, and there are grandmotherly prepared binary builds on the official website (kinda statically linked, so no dependency on WebKit as well). Not that it changes the author&#x27;s arguments that much, but just worth pointing out.
评论 #7255476 未加载
cies超过 11 年前
I&#x27;m currently playing with Fay (haskell2js compiler)... It&#x27;s awesome.<p>It type checks like haskell and allows code sharing between serverside and clientside of the app. This means i can use code to generate a complete HTML site (for SEO purposes) when the URL is hit directly and modify the DOM from there once the app is loaded... with the same code!<p>Obviously this is code sharing is mostly interesting to app written in haskell. But I&#x27;m so excited about it that i had to share... :)<p>G&#x27;luck! The &quot;javascript problem&quot; (try google for that) is a hard one.<p>[edit] i call it &quot;playing with Fay&quot;, but im certain this will end up on production for me.
colemorrison大约 11 年前
I used AngularJS + Express for a reasonably sized custom news app for a client. It does everything form payments, to security, ya know, all the shebang.<p>I agree with is the first but only if you&#x27;re still in the days of SEO trolling. Frankly it&#x27;s just not as important if you&#x27;re doing your other marketing aspects right.<p>For #2, I think there are plenty of ways to build in analytics. We use angularlytics and it works pretty well. Took me like 5 minutes to setup.<p>#3 - Yeoman. Generator Angular. Here&#x27;s how I do it:<p>1. Make a client dir, and yeoman up your project with generator angular. 2. Make a server dir and setup an express server. 3. Grunt serve your client dir 4. Make it so express watches your .tmp and app folders for local dev 5. Run your express server 6. When your ready to serve it, Grunt build to a dist folder in your server folder 7. For production, have express serve the dist folder<p>Yeah kind of dirty (since you&#x27;re running two local servers for dev), but hell, it&#x27;s fast as can be to setup and a pleasure.<p>#4 Tests? If you&#x27;re doing tests of any sort, they&#x27;re bound to slow you down to an extent.<p>#5 Isn&#x27;t this applicable to all web apps? Mistakes and mismanagement of loading resources is a problem for anything.<p>Sure it has it&#x27;s problems, but there&#x27;s just far too much productivity to be gained from using it. For example, Ajax animations are beyond time saving.<p>The real problem with angular is the terrible docs ;)
DigitalSea大约 11 年前
Really, this seems to be more of a case of the wrong tool being used for the wrong job than a tool with flaws and no real use. AngularJS positions itself as a fit-all solution for great Javascript based applications, when in reality it is meant for use only in an authenticated user setting. Look to an application like Asana (built on a similar internal Javascript framework), you only get the Javascript application version after you&#x27;ve logged in, not before.<p>It&#x27;s like creating an online store and deciding to choose MongoDB or any other NoSQL branded database and then discover it doesn&#x27;t support transactions and having to move over to a RDBMS like MySQL or PostgreSQL. The caveats listed in the article are definitely true though. As someone who&#x27;s used AngularJS enough to know its downfalls, it&#x27;s definitely not a one sized fits all solution and much like anything it comes with both its own pros and cons.<p>It&#x27;s important you spend the extra amount of time when planning your project to ensure you choose the right tools for the right job (well at least at the time). If your requirement is to be indexable via search engines, choose a solution that allows that and so on. Don&#x27;t use something just because it&#x27;s the flavour of the day on the HN front-page.
mcgwiz大约 11 年前
This is perplexing to me.<p>&gt; 1. Bad search ranking and Twitter&#x2F;Facebook previews<p>This problem is patently obvious to the most cursory examination of single-page applications. If SEO is important, and you want to do an SPA, then you must be willing to bear the cost of addressing HTML requests. For my startup, I wanted to keep things DRY, which lead me early on to the Nustache engine for ASP.NET, allowing me to use the same Mustache templates on server and client. This doesn&#x27;t have anything like the complexity described in the article.<p>&gt; 2. Flaky stats and monitoring<p>Simply not true. Using Google Analytics and Backbone, you simply listen to the Backbone.history:route event and fire off a pageview using the Google Analytics API.<p>&gt; 3. Slow, complex build tools<p>Complex, yes. Slow? Using r.js, no slower than a typical static language build.<p>&gt; 4. Slow, flaky tests<p>Slow, yes, but no more so than desktop app test automation. I&#x27;ve found PhantomJS with QUnit (unit-testing), and CasperJS for integration testing to be quite reliable. It took a few days to get everything connected (scripting IIS Express to start and end in the background being the trickiest bit), but that was it.<p>&gt; 5. Slowness is swept under the rug, not addressed<p>This is a UX challenge that is known and obvious up-front. Failing to address it is a design problem, not a technological one.<p>Overall, this seems the result of the ineptitude prevalent in inexperienced, &quot;move fast, break things&quot; teams. Rather than owning up to moving too fast and foregoing due analysis&#x2F;research, they blame technology. Or, the article is a marketing ploy.
评论 #7261466 未加载
balls187大约 11 年前
This isn&#x27;t about AngularJS in particular. This is about using a client-side JS app framework.<p>Substitute any other flavor and the same problems exist.
评论 #7257188 未加载
评论 #7256587 未加载
taude大约 11 年前
I, am&#x2F;was a big fan of Angular, but on a recent project decided we didn&#x27;t have the right team composition for a lot of the coding styles and complexities angular introduces. We went with a JQuery&#x2F;Knockout solution, too. Some of the devs still struggle to keep the viewmodels clean, but being able to integrate from knockout to existing JQuery plugins has been a big win. Writing custom angular directives, adding another layer to existing Jquery is a pain for a lot of front end developers, and likely overkill for many projects.<p>(to give scope size, we&#x27;re replacing a several hundred screen Adobe Flex app with our new KO&#x2F;JQuery app)
akbar501超过 11 年前
This is really a case of picking the wrong tool for the job. __This is in no way a slight of the author__...b&#x2F;c I have done worse on more than one occasion, so thanks for sharing.<p>To anyone reading, you really should understand your workload before picking tools. And, you need to understand the difference between Web Application vs. Web Site: Which are you building?<p>Server-side rending is the winner for content sites (as mentioned by the author). Beyond initial rendering, a server-side solution allows for more caching. Depending on the site you could even push a good amount of file delivery to a CDN. In the end the author switched to Go, but Node.js + Express, RoR, PHP, Java with Play, etc. would all work just as well.<p>Next, are you CPU bound or network bound or I&#x2F;O bound. If you&#x27;re writing an application that requires heavy calculations that utilize massive amounts of CPU, then pick the appropriate framework (i.e. not Node). If you are I&#x2F;O bound then Node may be a great solution.<p>Client-side rending (such as Angular&#x2F;Backbone&#x2F;etc) really shine when you need a web application (not web site). These frameworks are best when the application code is significant relative to the data such that many small JSON requests deliver better overall performance. Think of a traditional desktop application or native mobile app where the application code is in MB, but the amount of data required per request is in bytes. The same logic applies to web apps.<p>A few areas where problems such as what the author experienced emerged from blanked statements about technologies:<p>1. Gulp vs. Grunt: I use Grunt. I may switch to Gulp. But seriously, which one is &quot;more complex&quot;, &quot;faster&quot;, can be quantified. Lots of people pick the wrong technology because the web is littered with echo&#x27;d opinion statements. Exchange &quot;more complex&quot; for project A has a config file with X number of lines, while project B has a configuration of Y number of lines for the same task. Or project A uses JSON for its configuration while project B uses YAML.<p>2. &quot;Or we could have used a different framework) - with a link to Meteor&quot; - No please do NOT use Meteor for your site. I love Meteor and want it to succeed, but it is not the optimal choice for a content heavy site where each user views a large amount of data. As mentioned above, use a server-side rendering solution (like you did with Go), then cache, then push to a CDN. Problem solved. Meteor is awesome and is a great real-time framework. Use it when you need real-time capabilities...but not for a content heavy, static site.<p>&gt; but they just weren’t the right tools for our site.<p>This could have been the title or first sentence and would have delivered 100% of the message if the reader read no further.<p>A lot of these articles about why we changed from technology A to B could be much improved if the original decision making was documented (not just the switch). As in we picked project A because we thought it would deliver A, B and C benefits based on our applications required capabilities. However, our application really needed capabilities M, N and O, which project A was not a good fit for. So, we switched to project B and experienced the following improvements. Therefore, it can be concluded that if your application needs M, N and O then project B will be a better fit.
评论 #7257159 未加载
评论 #7256887 未加载
RRRA大约 11 年前
With all this discussion about SPA websites:<p>Is anyone aware of a solution to allow clients to validate a version of an SPA website (cryptographically), in the sense that once downloaded a signature is checked and then further visit, if they require an update, have to be validated and verified by the user?<p>I&#x27;m thinking of a way to allow user to trust their applications in the same way you would trust a dist-upgrade on Debian via the packager&#x27;s PGP signature and chain of trust.<p>This would solve the current problem that sites can change user side code at will anytime without them knowing and thus making it quite impossible to develop proper security solutions where the user actually owns and is responsible for his own security.<p>With such a solution in place, we might start seeing proper p2p&#x2F;webrtc security related apps, we could even imagine an in Browser (read js) Tor-like service...
ben336大约 11 年前
Maybe I&#x27;m missing something but I don&#x27;t get &quot;4. Slow, flaky tests&quot;. I understand that Selenium et al can be a pain, but how does server side generated code excuse you from using it? Are you only validating the html structure and not testing any of the interactive capabilities?
ChikkaChiChi大约 11 年前
Until Web Developers stop treating the end-user as a consumer of unlimited computational and bandwidth resources, issues like this will continue to crop up.<p>I love AngularJS for internal desktop tools I write, but I would never use it or any other client rendering script in the wild where my applications could be consumed by unknown form factors. Specifically, you have absolutely no idea how much memory allocation you are getting when you are dealing with mobile devices, and any assumption on the developer&#x27;s part is asinine.<p>AngularJS was not the problem in this case; and I&#x27;d wager we are going to continue to see articles like this as developers go through growing pains of learning that you should optimize for the end user first, not yourself.
m0th87超过 11 年前
Try prerender [1]. We use it in production with backbone. This combined with keeping the most content not-client-rendered has alleviated most of our issues.<p>In the long-term I&#x27;d love to see a web framework that uses react on the server-side, kind of like how rendr uses backbone on the server-side [2]. Seems to make sense because react works against a virtual DOM, so it would allow you to avoid the hacky ways of working with an actual DOM in node.<p>1: <a href="https://github.com/prerender/prerender" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;prerender&#x2F;prerender</a> 2: <a href="https://github.com/airbnb/rendr" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;airbnb&#x2F;rendr</a>
wheaties大约 11 年前
I just want to say thank you to the author for showing me backbone.anayltics. Absolutely fantastic and everything I had been looking for recently. Funny how one thing teaches about something else.
laureny超过 11 年前
Since the author hints that they migrated to Go templates, this article is more about when you should render templates client side vs&#x2F; server side than an opinion against AngularJS.
Kiro大约 11 年前
&gt; 3. Slow, complex build tools<p>I&#x27;m building a big AngularJS app and I&#x27;m not using any build tools. Apart from minifying, what would you use it for?
评论 #7260609 未加载
评论 #7257185 未加载
ilaksh超过 11 年前
Take a look at the prerender.io module. Also it is not impossible to render some types of angular pages in the server it is just a bit of a pain. Google angular on server. If you really don&#x27;t need an interactive app then I would consider generating static pages when the data changes or when called and then don&#x27;t update them more often than you actually need to.
JDDunn9大约 11 年前
These are just difficulties that need to be addressed, not deal-breakers. All new technologies have a transitional period where the rough edges need to be sanded off (Node.js, HTML5, etc.). As for people making comments that SPA should only be made for back ends and never a content site, USAToday.com is a SPA, and they rank just fine in Google.
jasdeepsingh大约 11 年前
I think you just used Angular at the wrong place. For a content based site, Angular was just not the right choice. I&#x27;ve made similar decision on a content site which I did in BackboneJS and totally feel your pain. I&#x27;ve had exactly the same problems you mentioned.<p>Server side generated stuff would&#x27;ve been just great here or on the project I did!
davesque大约 11 年前
This post&#x27;s title should really read: &quot;Why we left single-page apps.&quot; Saying that they left Angular makes it sound like it&#x27;s somehow inferior when compared with similar technologies like Ember. As the article describes, Angular was not so much the problem as was the mis-application of the single-page app architecture.
robmcm大约 11 年前
&gt; 5. Slowness is swept under the rug, not addressed<p>This is a joke right, asyc loading is somehow bad? If it&#x27;s that much of a problem hold off rendering untill you have all your data back, of heaven forbid implement item one of Nielsen&#x27;s list of heuristics, &quot;Visibility of system status&quot; and chuck in a loading gif.
blueskin_大约 11 年前
Javascript-only sites are the equally hideous 2010s equivalent of the Flash-only sites of the 2000s.
Navarajan大约 11 年前
Yes Client side rendering will not give any advantages for static contents, Its more useful for Dynamic content providing applications.<p>And if you want to deliver your content in mobile devices with there native app then Client Side Framework will be handy for you.
mavdi大约 11 年前
Yeah let&#x27;s stop the progress of the web because SEOs aren&#x27;t getting any better.
deaquino大约 11 年前
Just noticed that you can&#x27;t search on your website if you include &#x27;(&#x27; or &#x27;)&#x27;. 500 Internal Server Error.<p>i.e. <a href="https://sourcegraph.com/search?q=%28" rel="nofollow">https:&#x2F;&#x2F;sourcegraph.com&#x2F;search?q=%28</a>
fantastical超过 11 年前
Are there any good guides on how to organize JavaScript on non-SPAs? I have a weird web development background in that I&#x27;ve only ever worked on SPAs, so I haven&#x27;t ever done JavaScript work on a server-side rendered app.
seba_dos1大约 11 年前
If you describe something as &quot;a content site&quot;, then implementing it as &quot;single-page app&quot; is ridiculous by definition.<p>Content site is not app. Single-page app frameworks are for apps, not for content sites.
Illniyar大约 11 年前
All these arguments seem like lowly excuses to not do proper work and instead blame the framework you are using. If you have any kind of interactiveness the feel of a fat client is so much better then template rendering.<p>Look at the site: <a href="https://sourcegraph.com/github.com/tomchristie/django-rest-framework" rel="nofollow">https:&#x2F;&#x2F;sourcegraph.com&#x2F;github.com&#x2F;tomchristie&#x2F;django-rest-f...</a>?<p>Is that the best interface you can get? In 2014 everything I click reloads the page? a tabbed interface that doesn&#x27;t load the content in the window is noticeable by users these days. No pop ups of any kind? why do I need to reload the page to see a list of 4 contributers. You&#x27;ve gained maintainability at the cost of user experience, a lot of user experience for very little maintainability.<p>There are sites that benefit little from client-side rendering- blogs and news site for instance, but most will gain a lot.<p>1) Indexing with PhantomJs is a breeze, truely. Not only are there a ton of libraries that already do it, there are even SAASes that will do it for you for a fee. If you are really unable to come to terms with this, you can use react.js, which solve the SEO indexing issue completely.<p>2) If the only thing that you are doing on the site is measuring page loads then your site either lacks interactiveness completely or you aren&#x27;t measuring everything you should. You aren&#x27;t measuring to where a user left your site (and incredibly important metric) or any action he does (assuming there is any he can do) that isn&#x27;t navigation.<p>With Angularytics (and a thousand other libraries) adding analytics is maybe 5 lines of code, and you get declarative analytics on any link you want.<p>3) This site&#x27;s js is neither minimized nor concatenated, so I&#x27;m not sure what build tools you need for angular either then the ability to serve static content? But in any case it&#x27;s js, you are going to need to minimize and concatenate it at some point for performance, doesn&#x27;t matter if you use a fat client or some custom jQuery plugin. Even with Grunt, though I don&#x27;t like it very much, the build file is maybe 10 lines long, and the build process takes miliseconds.<p>4) And the alternative is what? using manual QA on every build? You have a website with even minimal interactivity you are going to need to use a browser based testing solution. Karma is a breeze, and with the new setup, the only thing you need to install is node and karma. Takes exactly 3 seconds, and you get one of the best isolated unit testing framework for client side code. Angular is actually built around the ability to unit test it.<p>5) So your saying that the solution to slowness is to have 43 unique resources loaded and rendered on every navigation? Page reload slowness is one of the major hassles that Ajax, and fat clients as a consequence, are trying to overcome. Your site takes, to me, about 3 seconds to load from page to page (6 seconds to finish rendering), there is obviously no wait time indicator that you can add and no tricks to minimize this. Not to mention that rendering is slow, and server-side rendering is not only extremely slow it can also cause parallel load which will make things worse. If you don&#x27;t care about your speed it doesn&#x27;t matter what framework you use.<p>For the sake of this you are losing interactiveness, speed and lower bandwidth to name just a few.
评论 #7258338 未加载
评论 #7259648 未加载
usablebytes大约 11 年前
It was a wrong choice of tool for that kind of a project, in the first place. The biggest problem that I&#x27;ve personally seen with AngularJS is the steep learning curve.
planckscnst大约 11 年前
I honestly don&#x27;t get what Sourcegraph is useful for. They primarily seem to be cluttering up my Google results, with pretty much useless entries.
ishener大约 11 年前
the crawling issue is simply a deal breaker. try searching in google for something in angular docs - and you&#x27;ll see what i mean...
scottschulthess大约 11 年前
&quot;Slow tests&quot;<p>Our javascript tests suites are always much, much faster than our server-side test suites with similar coverage.
kin超过 11 年前
Wouldn&#x27;t ng-cloak solve the partial content loading issue? Actually, there are a ton of ways to skin that cat.
Sym3tri大约 11 年前
This article unfairly picks on Angular. The issues mentioned are the same for any rich single page app.
sassyalex大约 11 年前
This is exactly the same problem with other client side javascript frameworks
miralabs大约 11 年前
just a case of using the right tools for the right job...move along
评论 #7257420 未加载
andyl超过 11 年前
We&#x27;ve transitioned from Angular to ReactJS with great success. Much smaller learning curve. Using Backbone to handle the models and React for the view is a great combination.
评论 #7255517 未加载
评论 #7258316 未加载