Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for IE11 #211

Closed
OriR opened this issue Oct 15, 2017 · 14 comments
Closed

Support for IE11 #211

OriR opened this issue Oct 15, 2017 · 14 comments
Assignees

Comments

@OriR
Copy link

OriR commented Oct 15, 2017

This currently the latest version of stringify-object unfortunately it isn't published with an ES5 compiled version.
I opened an issue there to publish an ES5 compliant version.
In case this won't get approved, I'm willing to make a PR to make the required changes to support IE11 😃

@armandabric
Copy link
Collaborator

armandabric commented Oct 16, 2017

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! 😃

@OriR
Copy link
Author

OriR commented Oct 28, 2017

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 :)

@lahmatiy
Copy link
Contributor

lahmatiy commented Oct 28, 2017

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.

@armandabric
Copy link
Collaborator

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

@armandabric armandabric self-assigned this Nov 1, 2017
@OriR
Copy link
Author

OriR commented Nov 3, 2017

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 😞

@armandabric
Copy link
Collaborator

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 👍

@OriR
Copy link
Author

OriR commented Nov 7, 2017

@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 👍

@armandabric
Copy link
Collaborator

Here it is: #242

@briandipalma
Copy link

Is the browser PR OK to merge/release?

@armandabric
Copy link
Collaborator

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

@ramonakira
Copy link

Is there any update on this?

@briandipalma
Copy link

Any update?

@vvo vvo closed this as completed in #242 May 15, 2018
@danoc
Copy link
Contributor

danoc commented May 25, 2018

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

https://unpkg.com/react-element-to-jsx-string@14.0.0/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

@vvo
Copy link
Contributor

vvo commented May 26, 2018

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

armandabric pushed a commit that referenced this issue Jun 4, 2018
This adds IE 11 support as well as support for older versions of Uglify.

It does so by transpiling `stringify-object` with babel.

Closes #211, #285
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants