Cross-Origin Stack Traces


Cross-Origin Stack Traces

Based on some reading, I've been lead to understand the following:

  • Javascript files loaded from a CDN will produced sanitized stack traces in error.stack which contain simply "Script Error"
  • Actual traces can be obtained if BOTH the script file includes crossorigin="anonymous" and the CDN sends Access-Control-Allow-Origin: *

I have a number of questions about this that I'm hoping someone can answer:

  • If I programmatically append a script to the DOM and call script.crossorigin="anonymous" on it first, does that "count"? Will it cause issues on any older browsers?
  • Any advice on getting Access-Control headers working with S3 => CloudFlare? It honestly seems impossible. Despite being configured, S3 only sends the headers if the REQUEST includes Origin, which never seems to happen. And even if it did, if the first request came from a browser that doesn't support CORS/Origin headers, the invalid version would be the one that gets cached.
  • Is it actually true that I even need these headers? I feel like I've seen stack traces in Chrome without the headers being there. Was the restriction removed from Chrome because it was unrealistic? Or does it not apply to javascript files added programatically? What browser versions actually sanitizes the traces?

Submitted January 28, 2016 at 11:11PM by doctorlongghost
via reddit http://ift.tt/1RP9zi7

Help deciding on a new JS framework.


Help deciding on a new JS framework.

We are a small development shop. We use c# MVC with Telerik's Kendo MVVM framework for the client side. We have had great success with this however the license cost per developer seem a little steep. We are in the early stages of looking into a javascript framework to help us move away from Kendo as well as create more fluid applications. What javascript framework should we look into and which one would be the easiest to switch to.

AngularJS (2.x??)

Knockout (probably most similar to kendo MVVM but is this dying?)

ReactJS

Backbone

Aurelia (I am intrigued by this but we would like to easily find support on forums worried about the amount of information out there)

embersjs?

What others exist?

Our criteria is:

  1. Simple to learn

  2. Clean architecture to it is easy to maintain

  3. Clear integration with .net MVC

  4. Easy to implement with javascript controls ( grids, listviews, etc.)

Submitted January 28, 2016 at 11:17PM by CaptPickleback
via reddit http://ift.tt/1SdRsTz

[Discussion] Javascript preprocessors


[Discussion] Javascript preprocessors

Recently I have been experimenting with preprocessors, such as stylus/sass/less for css, jade/mustache for html, but I find myself confused when javascript preprocessors come up, I don't see a huge difference between javascript, livescript, coffeescript, typescript, or dart, as I find them almost syntactically identical except maybe for the whitespace-dependant hierarchy in coffee.

So, what are the main differences, advantages and disadvantages, and why would I pick one over the other between normal ES6, Dart, Coffeescript, Typescript, and Livescript?

Submitted January 28, 2016 at 11:09PM by Zunon
via reddit http://ift.tt/20v6SUg