Giter Site home page Giter Site logo

Comments (4)

onyxfish avatar onyxfish commented on August 29, 2024

Hi David, thanks for the suggestion. The reason we aren't passing JSON is that using JSON over postMessage is not supported by older browsers, including IE9. So in order to pass JSON and maintain browser compatibility we would have to a) stringify it and b) add a dependency on json2.js or some other cross-browser JSON parsing library.

This didn't seem worth the trouble, though I'm not surprised to here other libraries aren't being careful about what messages they receive. Happy to hear other suggestions for how me might prevent those sorts of issues!

from pym.js.

al-the-x avatar al-the-x commented on August 29, 2024

Ah, I understand that rationale. I didn't know about the restriction on
JSON via postMessage in IE<=9, either, so that's valuable...! I wonder
how my other vendor is handling that. -_-

Thanks for the insight!

close #43

from pym.js.

onyxfish avatar onyxfish commented on August 29, 2024

You're very welcome. Thanks for the PM offer.

from pym.js.

hampelm avatar hampelm commented on August 29, 2024

At this point, this may be better handled by the message producers and consumers. However, I did want to ask about point (b) adding a json parser since this came up in some debugging today. Would the built-in JSON.parse not be sufficient? caniuse suggests it's supported in IE 9.

In any case, a warning in the readme that only strings are supported might be in order (happy to open that PR)

from pym.js.

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.