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

Rails 7 page transitions #3

Closed
ryw opened this issue May 23, 2022 · 8 comments · Fixed by #4 or #5
Closed

Rails 7 page transitions #3

ryw opened this issue May 23, 2022 · 8 comments · Fixed by #4 or #5
Assignees

Comments

@ryw
Copy link

ryw commented May 23, 2022

I just added charts to https://www.ossrank.com today, and the charts load on first page, but then when clicking into a project, the chart doesn't load. Refresh loads it on that page, but going back to index, those charts don't load.

Something with Rails 7 I don't understand for sure -- any ideas?

I added via:

  1. Adding gem "peity_vanilla_rails" to Gemfile
  2. Added import "peity-vanilla-rails" to app/javascript/application.js
@ryw
Copy link
Author

ryw commented May 23, 2022

Happy to create an example repo to reproduce the problem, if you'd like me to...

@manastyretskyi manastyretskyi self-assigned this May 24, 2022
@manastyretskyi
Copy link
Contributor

manastyretskyi commented May 24, 2022

Hi, while navigating your website I was able to reproduce the problem, but it looks like it is not the problem with the library itself, if you open browser console, you will see errors like this.
image
So it appears that there is the problem with your JavaScript, I would suggest you to try to fix it, and if the problem still remains, please create the sample repo where it reproduces.

@igorkasyanchuk
Copy link
Contributor

Also, I suggest adding pagination or lazy loading on the home page, because the page is just too big and have negative impact on it

@manastyretskyi
Copy link
Contributor

I believe I found out what the problem is after looking a little more closely at what happens on your website.
It appears that JavaScript was executed before DOM was ready, because of it mutation observer was not working.
I released version 0.2.1, now charts should work properly.
I would still suggest to fix your JavaScript through ;-)

@ryw
Copy link
Author

ryw commented May 24, 2022

Thanks - will look at my JS, and pagination is near the top of the todo list :)

@ryw
Copy link
Author

ryw commented May 24, 2022

Fixed JS error on my site, upgraded to 0.2.1, didn't resolve this issue.

I reproduced issue within a minimal Rails 7.0.3 app here:
https://github.com/ryw/peity_rails_7_test

Tested w/ latest Chrome + Safari to ensure it wasn't a browser issue too.

@manastyretskyi manastyretskyi linked a pull request May 25, 2022 that will close this issue
@manastyretskyi
Copy link
Contributor

Thank you for this example,
I've released new version 0.2.2, not this issue should be fixed for good.

@ryw
Copy link
Author

ryw commented May 25, 2022

Bumped repro repo to 0.2.2, works - thanks!

@ryw ryw closed this as completed May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants