reflux / reflux-core

A simple core library for uni-directional dataflow application architecture inspired by ReactJS Flux
BSD 3-Clause "New" or "Revised" License
48 stars 19 forks source link

workaround for ie8 and uglified compilations of the code. #20

Closed evilfer closed 7 years ago

evilfer commented 8 years ago

By giving a name to a previously anonymous function, /lib/createAction.js can be minifized safely for ie8.

More info: https://github.com/reflux/reflux-core/issues/16

markokocic commented 8 years ago

I can confirm that after applying this patch I was able to revert back to { mangle: true } in my uglify step and have it working correctly in IE8. However, still resisting to use unreleased non-upstream version of refluxjs in production.

devinivy commented 8 years ago

My concern is that this will set a precedent that we will write code in a way that supports IE8. My gut check says that we should be able to use anonymous functions without thinking about IE8 and uglification.

evilfer commented 8 years ago

Hi devinivy,

I share your concern, as I mentioned I do think this is an ugly workaround. The only argument in favor for it is that this is rather special case. This is the only case I've seen an anonymous function causing problems with IE8, and it must be related to the fact that it's a functor using itself...

I haven't been able to find any alternative :S. Perhaps

var functor = function F () {

is a bit more elegant and, to some extend, useful not only for IE8 to emphasize that it's not just an anonymous function.

BryanGrezeszak commented 7 years ago

reflux-core is not stated to support IE8.