Git Product home page Git Product logo

Comments (14)

armandabric avatar armandabric commented on August 15, 2024 2

I just need to update the PR with the last change in the upstream and we could merge it ;)

from react-element-to-jsx-string.

armandabric avatar armandabric commented on August 15, 2024

For now we do not officially target the browser.

We are open to find a solution for the stringify-object browser incompatibility. It could also be a replacement of this lib. Feel free to help if you have idea! 😃

from react-element-to-jsx-string.

OriR avatar OriR commented on August 15, 2024

I tried to experiment with replacing stringify-object and instead use Object.keys but I realized that it's a bit more complicated since stringify-object is recursive.

It would be helpful if you could tell me what's the expected result needed here.
I'll try my best matching it :)

from react-element-to-jsx-string.

lahmatiy avatar lahmatiy commented on August 15, 2024

We had the same problem. I think the better solution is to ship react-element-to-jsx-string as a single file library together with current set of modules. That's will be useful to use in browsers.
I'm working on it right now in my fork. I can PR a solution when done if your interesting to merge it.

from react-element-to-jsx-string.

armandabric avatar armandabric commented on August 15, 2024

I'm not sure we should rewrite stringify-object. Lots of work for a complex problem.

I think @lahmatiy have a point, the solution could be at build time. I will give a try to https://github.com/SamVerschueren/babel-engine-plugin It could allow us to compile stringify-object to target the browser

from react-element-to-jsx-string.

OriR avatar OriR commented on August 15, 2024

it would work if react-element-to-jsx-string would ship with all of its dependencies already compiled but that would mean a possible duplication of dependencies in the consuming packages.

I tried using https://github.com/SamVerschueren/babel-engine-plugin in my app but that didn't work for me 😞

from react-element-to-jsx-string.

armandabric avatar armandabric commented on August 15, 2024

After thinking to this, I guess the only real solution is to introduce a bundler (webpack? rollup.js?) to build a dedicated version of the library for the web.

This bundled version will became the default one exposed in the main package field.
We will continue to produce the same bundle for node and expose it in the module package field (or whatever it is nowadays).

This will a lots of build/maintenance overlay in our side but I think this could worth it 👍

from react-element-to-jsx-string.

OriR avatar OriR commented on August 15, 2024

@Spy-Seth It's worth keeping in mind to try and make the dist as small as possible (to prevent package duplication)

I definitely think this would be worth it! this could be made simple with an npm script and hooking into prepublish to do just that 👍

from react-element-to-jsx-string.

armandabric avatar armandabric commented on August 15, 2024

Here it is: #242

from react-element-to-jsx-string.

briandipalma avatar briandipalma commented on August 15, 2024

Is the browser PR OK to merge/release?

from react-element-to-jsx-string.

ramonakira avatar ramonakira commented on August 15, 2024

Is there any update on this?

from react-element-to-jsx-string.

briandipalma avatar briandipalma commented on August 15, 2024

Any update?

from react-element-to-jsx-string.

danoc avatar danoc commented on August 15, 2024

Hi! 👋 I think this may not have been fixed in 14.0.0.

https://unpkg.com/[email protected]/dist/cjs/index.js

stringifyObject contains a number of arrow functions in the dist. Happy to submit a PR to make babel process it:

https://github.com/algolia/react-element-to-jsx-string/blob/master/rollup.config.js#L28

from react-element-to-jsx-string.

vvo avatar vvo commented on August 15, 2024

@danoc If you have a way to solve this in a nice way then yes submit it, up for it!

from react-element-to-jsx-string.

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.