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

[Feature Request] webpack2 import actioncable #28366

Closed
limichange opened this issue Mar 10, 2017 · 10 comments
Closed

[Feature Request] webpack2 import actioncable #28366

limichange opened this issue Mar 10, 2017 · 10 comments

Comments

@limichange
Copy link

actioncable@5.0.2 not support webpack2 now.

import ActionCable from 'actioncable'

console.log(ActionCable) // undefined

please support it, thx.
just like this.

...
  "main": "dist/vue.runtime.common.js",
  "module": "dist/vue.runtime.esm.js",
  "unpkg": "dist/vue.js",
  "typings": "types/index.d.ts",
...
@limichange
Copy link
Author

I just publish actionscable-esm.
Look at https://github.com/yuki-torii/actioncable-esm

@rafaelfranca
Copy link
Member

Feel free to open a PR.

@rafaelfranca
Copy link
Member

BTW, does actioncable@5.1.0-beta1 work?

@smarquez1
Copy link

@rafaelfranca it was working on actionvable@5.0.1, it does not work on actioncable@5.1.0-beta1

@rafaelfranca
Copy link
Member

Weird. The way it was released was the same and the code seems to be the same. I'm not a webpack user, could you investigate why those version doesn't work?

@limichange
Copy link
Author

Thanks reply 😃 .

@rafaelfranca In fact, it's not same :D
https://github.com/yuki-torii/actioncable-esm/blob/master/index.esm.js#L591

@smarquez1 @rafaelfranca actionvable@5.0.1 actioncable@5.1.0-beta1 not work, just get undefinded.

I think you should improve js module build way. Because more and more people use webpack2 to build app.

About javascript module

@rafaelfranca
Copy link
Member

Yeah. What I could get is that sprockets-export doesn't Es modules yet. https://github.com/javan/sprockets-export/blob/master/lib/sprockets/export/template.js.erb

@javan is that correct?

@javan
Copy link
Contributor

javan commented Mar 11, 2017

Found the issue. Fix in progress here #28385

@javan
Copy link
Contributor

javan commented Mar 11, 2017

FWIW, I tested actioncable@5.0.1 and actioncable@5.0.2, and both work fine with webpack using require or import statements. actioncable@5.1.0-beta1 does not.

@limichange
Copy link
Author

@javan Thx. You are a great help.

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

5 participants