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

Migrate away from GitBook - possibly to Docusaurus #7267

Closed
ghost opened this issue Apr 11, 2020 · 18 comments · Fixed by #7295
Closed

Migrate away from GitBook - possibly to Docusaurus #7267

ghost opened this issue Apr 11, 2020 · 18 comments · Fixed by #7295

Comments

@ghost
Copy link

ghost commented Apr 11, 2020

No description provided.

@ghost ghost added the type: documentation label Apr 11, 2020
@benmccann
Copy link
Contributor

benmccann commented Apr 11, 2020

Is there a later version of GitBook? I thought the open source version is no longer maintained and they're only maintaining a paid hosted version

We had attempted to migrate to Vuepress (#5847), but ran into an issue that we're still waiting for Vuepress to fix more than a year later :-/ I'd like to get off of GitBook because it's pulling in tons of dependencies with security issues

I would be open to migrating to Docusaurus. Any chance you'd like to take a stab at it?

Some features we have on the site right now that we'd want to try to maintain:

  • chart rendering (for pages in charts sub-directory)
  • search
  • Google Analytics

@ghost
Copy link
Author

ghost commented Apr 12, 2020

As GitBook is trying to turn commercial, migration is a must

Docusaurus 2 is a preferred option.

  • It allows us to display react components so chart rendering won't be a problem
  • For SEO, we can use react-helmet
  • For search we can use algolia

@benmccann
Copy link
Contributor

Sure that sounds fine. However, I'm not sure how much time any of the existing maintainers would have to attempt it. Is it something you'd like to try working on?

@benmccann benmccann changed the title Update GitBook to latest version Migrate away from GitBook - possibly to Docusaurus Apr 13, 2020
@benmccann
Copy link
Contributor

I gave it a try here: https://github.com/benmccann/Chart.js/tree/docusaurus

I haven't figured out yet how to put a Chart in the docs. We'll also need to figure out how to include the newly built Chart.min.js in the docs. And then how to deploy the docs

@benmccann
Copy link
Contributor

I couldn't get it to work. I tried that here: benmccann@e8e44d4

Let me know if you have any ideas. It'd be great if you could check out the code and figure out what's wrong

@benmccann
Copy link
Contributor

That's how it is in the docs currently and I just left it the same. The problem is that it fails to compile if componentWillMount is present even if that method is empty

@ghost

This comment has been minimized.

@benmccann
Copy link
Contributor

benmccann commented Apr 16, 2020

The reason I was using a class component instead of a function component is because I wanted to create the DOM element in render and then create the Chart using that element in componentWillMount. I filed an issue to see if the FB folks have any ideas

@ghost
Copy link
Author

ghost commented Apr 16, 2020

You could use useEffect for that👌

useEffect(() => {
    //Code which was inside componentWillMount
},[])

@benmccann
Copy link
Contributor

benmccann commented Apr 16, 2020

That worked! Thank you! I was not familiar with these hooks

Working code is here: https://github.com/benmccann/Chart.js/tree/docusaurus

Now I just have to figure out deployment

@benmccann
Copy link
Contributor

We have the docs on GitHub Pages: https://github.com/chartjs/chartjs.github.io

@benmccann
Copy link
Contributor

Thanks for providing that. I shared it with the other maintainers and it was helpful so that they could play around with it. They found a bug when viewed on mobile. The Docusaurus team fixed the bug for us, but now I am waiting for a new release of Docusaurus

@ghost
Copy link
Author

ghost commented Apr 24, 2020

Also in dark mode, some chart legends are black not white

@benmccann
Copy link
Contributor

Yeah, I pushed a change to disable dark mode on my branch

@ghost
Copy link
Author

ghost commented Apr 24, 2020

Why disable? just fix the text color in dark mode

@benmccann
Copy link
Contributor

A PR for that would be welcome :-) I'm too lazy

@benmccann
Copy link
Contributor

Ok, we got it deployed and hooked into our release process: https://www.chartjs.org/docs/next/

@nainardev do you mind taking down the one at https://chartjs.nainar.now.sh/ now so Google doesn't accidentally find it and penalize us for duplicate content or send people to the wrong place? Thanks for the suggestion on Docusaurus and the help!

@ghost
Copy link
Author

ghost commented May 6, 2020

Deleted

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

Successfully merging a pull request may close this issue.

1 participant