Coder Social home page Coder Social logo

Comments (10)

bradberger avatar bradberger commented on July 21, 2024 2

Fixed! Thanks so much!

from flagsmith-js-client.

kyle-ssg avatar kyle-ssg commented on July 21, 2024 1

Global removed in [email protected]. The es version numbers will now always be in sync with flagsmith for every release. Let me know if that's all sorted your end @bradberger ?

from flagsmith-js-client.

kyle-ssg avatar kyle-ssg commented on July 21, 2024

Hmm I see. I think it's quite common for modules to have separate bundles for es6, e.g. lodash-es.

Let me know but it seems the solution could be to have flagsmith/es and flagsmith/react-es, also these bundles could look to avoid using window.flagsmith. Does that sound suitable @bradberger ?

from flagsmith-js-client.

bradberger avatar bradberger commented on July 21, 2024

@kyle-ssg That'd be perfect!

from flagsmith-js-client.

kyle-ssg avatar kyle-ssg commented on July 21, 2024

Having said this, It's a bit strange since the nextjs/react examples import flagsmith fine https://github.com/Flagsmith/flagsmith-js-client/blob/main/examples/react/src/index.tsx. Is there a valid reason for this do you think?

from flagsmith-js-client.

bradberger avatar bradberger commented on July 21, 2024

Hmm good point. We've used it in React, too, without issue. I'm wondering if React compiles to something less than ES6 for compatibility. Maybe we need to do that too. I can check into that, it might be a possible solution. But all the same ES6 support would be great if it's possible.

from flagsmith-js-client.

kyle-ssg avatar kyle-ssg commented on July 21, 2024

Yeah I bet there's some clever webpack config for create-react-app / nextjs in general. Looking into this now 👍

from flagsmith-js-client.

kyle-ssg avatar kyle-ssg commented on July 21, 2024

Could you try npm i flagsmith-es as a replacement to flagsmith @bradberger ?

from flagsmith-js-client.

bradberger avatar bradberger commented on July 21, 2024

@kyle-ssg That did the trick! It still appears to populate the window.flagsmith variable, but importing createFlagsmithInstance() works perfectly and the global instance isn't our instance.

from flagsmith-js-client.

kyle-ssg avatar kyle-ssg commented on July 21, 2024

Ok let me just sort the global!

from flagsmith-js-client.

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.