Giter VIP home page Giter VIP logo

Comments (7)

balanceiskey avatar balanceiskey commented on August 23, 2024

Does it makes sense to remove the "use strict' requirement there? Is that the issue?

from flux.

gaearon avatar gaearon commented on August 23, 2024

I'm working around this by using jsx?harmony Webpack loader and original ES6 Dispatcher.js file with my own 'use strict' added at the very top.

from flux.

KyleAMathews avatar KyleAMathews commented on August 23, 2024

Just ran into this as well...

from flux.

fisherwebdev avatar fisherwebdev commented on August 23, 2024

The dispatcher does work in Chrome. But it does not work while you're using source maps, correct? I believe the issue is the "use strict" declaration that is getting inserted by gulp-react during the transformation from ES6 with the harmony: true option.
https://github.com/facebook/flux/blob/master/Gulpfile.js#L19

Fastclick was dealing with a similar issue:
ftlabs/fastclick#270
ftlabs/fastclick#288

This might be an issue for Chrome devtools, or maybe for gulp-react? Not sure Flux is the correct place to correct it, but I'm totally open to suggestions on what band-aid we should provide in the mean time.

from flux.

gaearon avatar gaearon commented on August 23, 2024

@fisherwebdev For me, putting 'use strict' at the top of Dispatcher.js helps: it no longer generates 'use strict' inside functions, and thus doesn't break eval in Chrome.

from flux.

zpao avatar zpao commented on August 23, 2024

We're not going to be changing the class transforms which is adding the inner 'use strict's (in jstransform via react-tools) so I think doing what @gaearon says and putting 'use strict' at the top of the file is the right move.

from flux.

gaearon avatar gaearon commented on August 23, 2024

👍 Thanks!

from flux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.