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

[WIP] Gatsby migration #1025

Merged
merged 46 commits into from
Mar 17, 2020
Merged

[WIP] Gatsby migration #1025

merged 46 commits into from
Mar 17, 2020

Conversation

iAdramelk
Copy link
Contributor

@iAdramelk iAdramelk commented Feb 26, 2020

ToDo:

  • Install Gatsby.
  • Remove Next.js.
  • Move _document.js content to html.js and SEO files.
  • Rewrite LocalLink to use gatsby-link.
  • Update GA to work with new setup.
  • Move sentry from _app.js to gatsby plugin.
  • Set up styled-components SSR in gatsby.
  • Move static pages to gatsby (index, features, support, community).
  • Replace CDN urls for css and js assets in head with normal imports.
  • Docs page
    • Basic render
    • Sidebar
      • Make standard pages work
      • Make source: false menu items work (update logic for normalizedSidebar generation)
    • Right menu
      • Headers with ids
      • Custom ids in headers
      • Move headings extraction to backend
    • External link icons
    • Prism syntaxes
      • Port custom syntax for dvc from blog
      • Convert custom syntax for usage
      • Find existing syntax for vim
    • Convert dvc commands to links
    • Custom React components for details and abbr
  • Set up redirects.
  • Set up API endpoints.

@shcheklein shcheklein temporarily deployed to dvc-landing-gatsby-migr-abefpq February 26, 2020 19:18 Inactive
@shcheklein
Copy link
Member

@fabiosantoscode could start reviewing this? )

Copy link
Contributor

@fabiosantoscode fabiosantoscode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lookin' good! Just a few comments. Also for the API/redirects to work locally and in production, have a look at: https://github.com/iterative/blog/pull/122/files. You just have to make the API and the redirects into express middleware, then mount it into an express server for production, and in the gatsby development server using gatsby-config.

src/components/LocalLink/index.js Outdated Show resolved Hide resolved
src/components/TrySection/index.js Show resolved Hide resolved
src/html.js Show resolved Hide resolved
hitType: 'exception',
exDescription,
exFatal
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside: We can probably use something like sentry or crashlytics here. If we end up implementing it in another iterative property we can plop it here as well at no additional cost.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This, or maybe switch to GTM and send it from there.

@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq February 28, 2020 17:30 Inactive
src/components/Documentation/NewMarkdown/index.js Outdated Show resolved Hide resolved
src/html.js Show resolved Hide resolved
@fabiosantoscode
Copy link
Contributor

This is a gargantuan amount of work, good luck @iAdramelk :)

@iAdramelk iAdramelk had a problem deploying to dvc-landing-gatsby-migr-abefpq March 2, 2020 17:29 Failure
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 2, 2020 17:35 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 2, 2020 17:39 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 2, 2020 17:54 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 2, 2020 18:41 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 3, 2020 18:11 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 3, 2020 18:20 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 3, 2020 18:32 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 5, 2020 20:05 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 6, 2020 06:17 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 6, 2020 18:16 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 6, 2020 18:21 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 6, 2020 18:32 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 6, 2020 18:39 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 6, 2020 18:40 Inactive
@iAdramelk
Copy link
Contributor Author

@fabiosantoscode I added AIP and reedirects middlewares + simple express server, can you please review them and advice on additional headers and other stuff that I maybe should add here?

@shcheklein
Copy link
Member

@iAdramelk please rebase/merge, and let's check why CI is failing

@shcheklein shcheklein requested a review from jorgeorpinel March 6, 2020 19:31
Copy link
Member

@shcheklein shcheklein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

server.js Outdated Show resolved Hide resolved
gatsby-node.js Show resolved Hide resolved
jest.config.js Outdated Show resolved Hide resolved
middlewares/api/index.js Outdated Show resolved Hide resolved
middlewares/redirects/index.js Outdated Show resolved Hide resolved
src/components/Community/Section/index.js Outdated Show resolved Hide resolved
src/components/Documentation/index.js Outdated Show resolved Hide resolved
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 10, 2020 22:34 Inactive
@iAdramelk iAdramelk temporarily deployed to dvc-landing-gatsby-migr-abefpq March 10, 2020 22:45 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-gatsby-migr-abefpq March 17, 2020 13:23 Inactive
…sby's API to not make full rerender of page on navigation. It fixes transition in doc's sidebar
@shcheklein shcheklein temporarily deployed to dvc-landing-gatsby-migr-abefpq March 17, 2020 13:26 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-gatsby-migr-abefpq March 17, 2020 14:57 Inactive
Copy link
Contributor

@jorgeorpinel jorgeorpinel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow up on my previews review on #1025 (comment)

  • The DOC link still seems to be hardcoded to /doc/get-started. What if we change the first doc in the future, e.g. to /doc/install, will the link change automatically?
  • /doc path redirects to /doc/get-started. Again, what if we want to change the first doc to something else? Would we have to change the redirects file every time? Moving to nav: fix problem with non-existing pages in sidebar #1060
  • And if we have to do this (instead of just loading the first doc and keeping the /doc path) maybe change the /docs and /documentation redirects that currently go to /doc, so they go directly to the first doc? (Also keeping /doc -> /doc/get-started some time for legacy 301 support)
  • How can we test the subdomain redirects? (www, man, error, code/data/remote)
  • URL path redirects e.g. /documentation/command-reference do not add the required trailing slash e.g. -> /doc/command-reference, which causes a 2nd redirect to the final location: /doc/command-reference/

@shcheklein
Copy link
Member

/doc path redirects to /doc/get-started ... The DOC link still seems to be hardcoded to /doc/get-started

@jorgeorpinel there is a ticket to handle all of this after the merge - #1060 - please chime in here.

How can we test the subdomain redirects? (www, man, error, code/data/remote)

we will deploy and test them

which causes a 2nd redirect to the final location: /doc/command-reference/

will be handled when we merge dvc.org with blog the way I understand this cc @fabiosantoscode @iAdramelk @pavelgrinchenko

@iAdramelk
Copy link
Contributor Author

@jorgeorpinel

/doc path redirects to /doc/get-started. Again, what if we want to change the first doc to something else? Would we have to change the redirects file every time?

It's actually not hardcoded now. It resolves to the first item with the source in the sidebar.json.

@shcheklein shcheklein temporarily deployed to dvc-landing-gatsby-migr-abefpq March 17, 2020 21:50 Inactive
@shcheklein shcheklein merged commit 7fafc0b into master Mar 17, 2020
@casperdcl casperdcl mentioned this pull request Mar 18, 2020
3 tasks
@jorgeorpinel
Copy link
Contributor

It's actually not hardcoded now

I'm seeing it hardcoded in redirects-list.json @iAdramelk

@iAdramelk
Copy link
Contributor Author

I'm seeing it hardcoded in redirects-list.json

It's hardcoded in redirects for now (to redirect users who hit urls from search engines or bookmarks), but actual links in html and site header/footer are not hardcoded. They are rosolved using sidebar.json.

But you are right, it's not an ideal situation and it can break if we change root sidebar.json right now without changing redirects.

@shcheklein shcheklein deleted the gatsby-migration branch March 27, 2020 20:07
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.

6 participants