redux-async-connect icon indicating copy to clipboard operation
redux-async-connect copied to clipboard

Add transforms for legacy IE https://github.com/Rezonans/redux-async-…

Open badtant opened this issue 8 years ago • 27 comments

Lib failed in IE10 and these babel plugins were needed.

badtant avatar Mar 14 '16 09:03 badtant

Looking forward to this being released ;)

pmark avatar Mar 17 '16 19:03 pmark

Me too, seems like development on v1 has stopped :(

badtant avatar Mar 18 '16 07:03 badtant

@sars Is what @badtant said is true?

ratson avatar Mar 30 '16 09:03 ratson

When will be release?

Iuriy-Budnikov avatar Apr 15 '16 15:04 Iuriy-Budnikov

Really need this fix for a production project.

dawidvdh avatar Apr 15 '16 15:04 dawidvdh

@sars

Iuriy-Budnikov avatar Apr 15 '16 15:04 Iuriy-Budnikov

Just pull all the code into your project until it's released.

On Friday, April 15, 2016, Dawid van der Hoven [email protected] wrote:

Really need this fix for a production project.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/Rezonans/redux-async-connect/pull/64#issuecomment-210499654

pmark avatar Apr 15 '16 15:04 pmark

Pulled. It doesn't work :)

Iuriy-Budnikov avatar Apr 15 '16 16:04 Iuriy-Budnikov

This works for me:

  1. Clone the repo
  2. Build it (npm run build)
  3. Copy lib/ into my project as a subfolder named redux-async-connect
  4. Import redux-async-connect with a relative path

Works in IE9+ and other real browsers.

pmark avatar Apr 15 '16 16:04 pmark

screen shot 2016-04-15 at 8 14 27 pm

Yeah, I made monkey patching. But got an error.

Iuriy-Budnikov avatar Apr 15 '16 17:04 Iuriy-Budnikov

screen shot 2016-04-15 at 8 13 29 pm

Iuriy-Budnikov avatar Apr 15 '16 17:04 Iuriy-Budnikov

Can you confirm that you ran "npm run build" from the redux-async-connect folder itself? Running your project's build script will not honor the .babelrc file in the redux-async-connect folder.

pmark avatar Apr 15 '16 17:04 pmark

Can you confirm that you ran "npm run build" from the redux-async-connect folder itself? Running your project's build script will not honor the .babelrc file in the redux-async-connect folder.

Sure :)

Iuriy-Budnikov avatar Apr 15 '16 17:04 Iuriy-Budnikov

I did npm run build in new folder redux-async-connect

Iuriy-Budnikov avatar Apr 15 '16 17:04 Iuriy-Budnikov

OK now I see what's going on:

  • The proto error will appear when using hot module reload (for development only) in IE because of how react-proxy is implemented.
  • Try testing IE in with the production environment, which is what ultimately matters.
  • Forget what I said about building redux-async-connect separately from your project. You can add the transform-class-properties and transform-es2015-classes plugins to your main project's .babelrc file.

pmark avatar Apr 15 '16 17:04 pmark

Here my config

{
  "presets": ["react", "es2015", "stage-0"],

  "plugins": [
    "transform-runtime",
    "add-module-exports",
    "transform-decorators-legacy",
    "transform-react-display-name",
    "transform-class-properties",
    "transform-es2015-classes"
  ],

  "env": {
    "development": {
      "plugins": [
        "typecheck",
        ["react-transform", {
            "transforms": [{
                "transform": "react-transform-catch-errors",
                "imports": ["react", "redbox-react"]
              }
            ]
        }]
      ]
    }
  }
}

I tested with production. The same error.

Iuriy-Budnikov avatar Apr 15 '16 17:04 Iuriy-Budnikov

with ["transform-es2015-classes", {"loose": true}] the same.

Iuriy-Budnikov avatar Apr 15 '16 18:04 Iuriy-Budnikov

Do you think that something else is using react-proxy?

pmark avatar Apr 15 '16 18:04 pmark

Did you start with react-redux-universal-hot-example?

pmark avatar Apr 15 '16 18:04 pmark

Did you start with react-redux-universal-hot-example?

Exactly.

Iuriy-Budnikov avatar Apr 15 '16 18:04 Iuriy-Budnikov

I wish I could help more, but I can confirm that the problem was resolved for me when I added those transforms and tested IE without HMR.

pmark avatar Apr 15 '16 18:04 pmark

@pmark thanks, for your help. Could you check the same with react-redux-universal-hot-example?

Iuriy-Budnikov avatar Apr 16 '16 09:04 Iuriy-Budnikov

I can share my repo

Iuriy-Budnikov avatar Apr 16 '16 09:04 Iuriy-Budnikov

I really need this PR for a project, too. :cry:

hanzhao avatar Apr 29 '16 08:04 hanzhao

:_( Is this pushed to the latest release ? I really need this for prod

dtuyenle avatar Jul 07 '16 18:07 dtuyenle

need this for prod too

snowcxt avatar Aug 29 '16 23:08 snowcxt

@snowcxt Hi. I switch to makeomatic/redux-connect now to make my code work for prod. Maybe it helps.

hanzhao avatar Aug 30 '16 01:08 hanzhao