saravanabalagi / action-cable-react-jwt

Rails action-cable integration with JWT authentication
MIT License
38 stars 17 forks source link

How is this lib maintained? #5

Open zedtux opened 6 years ago

zedtux commented 6 years ago

As far as I can see from the source code, you're not importing the actioncable library, but you have a copy of it in your lib.

This means, tomorrow there is a new version of actioncable, you'll have to update you code with this update, isn't It?

What version of actioncable do you have right now?

mopx commented 6 years ago

you have a copy of it in your lib.

I'm worried about this too, this package is a temporarily solution.

have you found any alternatives for this? @zedtux

zedtux commented 6 years ago

Long story short @mopx, I ended implementing it using raw WebSockets.

I'm building a React Native application, using a Rails 4.x backend application which uses a very old version of ActionCable. This means, even if the version stored in the this library was up-to-date, it wouldn't work in my case.

In the context of React-Native, I found the react-native-actioncable package which is doing exactly what should be done in this package : Importing the real actioncable JavaScript package and adapts it for RN.

I wanted to check this repo forks, but as Github removed their nice fork map view, I can't anymore, so let's assume nobody did it as of now, this repo should be forked, the actioncable copy removed, and actioncable should be added to the packages.json file and imported.

I hope this gives you some good input for your @mopx, and sorry to not have an easy solution 😞.

mopx commented 6 years ago

thanks for the pointers @zedtux !

BTW you can still access the fork map by adding /network after the repo url. But there's nothing relevant added.

e.g. https://github.com/zekedran/action-cable-react-jwt/network

zedtux commented 6 years ago

Oh great, thank you @mopx. 👍

zedtux commented 1 year ago

I made a PR on the Rails project to implement adding sub protocols to ActionCable so that this library will not be needed in the future, and it has been merged ! :star_struck:

saravanabalagi commented 1 year ago

Hi @zedtux, thanks for the pull request in the rails library, this was probably long awaited by many users! I initially copied the compiled code to make quick changes for use in my app, it ended up staying that way being used by many.

Anyway, I was checking to see if I can directly use addSubProtocol from @rails/actioncable but it does not seem to be available yet, although it has been 6 months since the merge, any idea why? I also checked the code on npm and also in CDN just to be sure, but it is not there yet.

zedtux commented 1 year ago

Well, the main branch has my code, the CHANGELOG.md has a point describing tne addSubProtocol function, but there's no version number defined so I guess it hasn't been released yet.

You can use the github URL as source in your package.json file.