Skip to content

fix(JS): unmount components during for Turbolinks 5 #517

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

Closed
wants to merge 2 commits into from
Closed

fix(JS): unmount components during for Turbolinks 5 #517

wants to merge 2 commits into from

Conversation

dobrite
Copy link
Contributor

@dobrite dobrite commented Apr 20, 2016

fixes #516

Specs passed locally. I didn't find any related specs, but feel free to point me in the right direction if I need to add one!

Thanks for the amazing job maintaining react-rails! 😍

@rmosolgo
Copy link
Member

Derp, looks like build troubles:

The command "wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2" failed and exited with 8 during 

I'll take a look...

@dobrite
Copy link
Contributor Author

dobrite commented Apr 20, 2016

Seems like 2.1.1 gets a 403. 1.9.8 works 🤔

[system][~][::] $ wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
--2016-04-20 15:34:18--  https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
Resolving bitbucket.org... 104.192.143.1, 104.192.143.2, 104.192.143.3
Connecting to bitbucket.org|104.192.143.1|:443... connected.
HTTP request sent, awaiting response... 302 FOUND
Location: https://bbuseruploads.s3.amazonaws.com/fd96ed93-2b32-46a7-9d2b-ecbc0988516a/downloads/396e7977-71fd-4592-8723-495ca4cfa7cc/phantomjs-2.1.1-linux-x86_64.tar.bz2?Signature=7Nug22RLNIMy73WArztZPy3C3CY%3D&Expires=1461191426&AWSAccessKeyId=AKIAIWY5XSVPZPDQYRQQ&versionId=null&response-content-disposition=attachment%3B%20filename%3D%22phantomjs-2.1.1-linux-x86_64.tar.bz2%22 [following]
--2016-04-20 15:34:18--  https://bbuseruploads.s3.amazonaws.com/fd96ed93-2b32-46a7-9d2b-ecbc0988516a/downloads/396e7977-71fd-4592-8723-495ca4cfa7cc/phantomjs-2.1.1-linux-x86_64.tar.bz2?Signature=7Nug22RLNIMy73WArztZPy3C3CY%3D&Expires=1461191426&AWSAccessKeyId=AKIAIWY5XSVPZPDQYRQQ&versionId=null&response-content-disposition=attachment%3B%20filename%3D%22phantomjs-2.1.1-linux-x86_64.tar.bz2%22
Resolving bbuseruploads.s3.amazonaws.com... 54.231.114.122
Connecting to bbuseruploads.s3.amazonaws.com|54.231.114.122|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2016-04-20 15:34:19 ERROR 403: Forbidden.

@dobrite
Copy link
Contributor Author

dobrite commented Apr 20, 2016

Here is an issue. Seems intermittent due to throttling?

@dobrite
Copy link
Contributor Author

dobrite commented Apr 20, 2016

It seems like TravisCI has it already installed and available on the PATH.

@dobrite
Copy link
Contributor Author

dobrite commented Apr 20, 2016

TravisCI version failed here 😞 Turbolinks.supported returned nil.

@dobrite
Copy link
Contributor Author

dobrite commented Apr 21, 2016

Rails 5 fails due to a JS error on this line . React emits a Warning, but in red text so imagine it uses console.error to do so:

Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:
(client) <div data-reactid="
(server) <div data-reactid="

I spun up a Rails 5 server locally and went through the test manually in chrome and it does not throw that error, however the Poltergeist debugger does throw that error.

At this point I'm stumped. Any ideas with how to debug this? @rmosolgo

@rmosolgo
Copy link
Member

I remember fighting with PhantomJS before. Turbolinks needs ... something ... from 2.1 to work properly, but TravisCI comes with 1.9.8 installed.

In the end, I cherry-picked your commits into separate PRs to address them separately:

Thanks for these fixes!

@rmosolgo rmosolgo closed this Apr 28, 2016
@dobrite
Copy link
Contributor Author

dobrite commented Jun 23, 2016

Huge thanks for following through on this! 😍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Turbolinks 5 not showing react components when cache is shown
2 participants