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 codebase to Typescript and CSS Modules #1106

Merged
merged 51 commits into from
Apr 8, 2020
Merged

Conversation

pavelgrinchenko
Copy link
Contributor

@pavelgrinchenko pavelgrinchenko commented Apr 1, 2020

@pavelgrinchenko pavelgrinchenko self-assigned this Apr 1, 2020
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-q78qb3 April 1, 2020 16:45 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-q78qb3 April 2, 2020 18:09 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-q78qb3 April 3, 2020 08:00 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-q78qb3 April 3, 2020 15:21 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-q78qb3 April 6, 2020 18:35 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-lrfc1h April 6, 2020 19:00 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-bbtxq8 April 7, 2020 07:38 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-bbtxq8 April 7, 2020 12:22 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-bbtxq8 April 8, 2020 09:37 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-bbtxq8 April 8, 2020 11:45 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-bbtxq8 April 8, 2020 11:52 Inactive
@pavelgrinchenko
Copy link
Contributor Author

pavelgrinchenko commented Apr 8, 2020

@shcheklein

Main page - fonts, styles are different

Could you clarify it, point by point? In this case I can review it step by step too. I already fixed some of them, and some styles was changed after getting rid of duplication.
For example Download and Watch Video buttons now have more balanced paddings
image

We don't render sag anymore (the same in prod) - https://dvc.org/blog/a-public-reddit-dataset

I’m not sure what do you mean when saying sag. Could you clarify?

Tooltip (abbr) in docs are not styled properly

Previous version was heavily dependent on interpolations from styles-components so I fully refactored it. Styles a little bit another, right. But here we can only improve them. What should I change?

Docs: page animation is broken

Could you clarify what animation do you mean?

@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-bbtxq8 April 8, 2020 12:28 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-bbtxq8 April 8, 2020 17:03 Inactive
@shcheklein shcheklein temporarily deployed to dvc-landing-ts-migratio-bbtxq8 April 8, 2020 17:45 Inactive
"isomorphic-fetch": "^2.2.1",
"lodash.fill": "^3.4.0",
"lodash.includes": "^4.3.0",
"lodash.kebabcase": "^4.1.1",
"lodash.startcase": "^4.4.0",
"lodash.throttle": "^4.1.1",
"lodash.topairs": "^4.3.0",
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 have tree-shaking so we can simply do:

import { get } from 'lodash'

Knowing only get is included in the bundle. So we don't have to install lodash bit by bit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately not =( Tree shaking usually works like a 💩
There are a lot articles which describe this problem, like this one https://www.azavea.com/blog/2019/03/07/lessons-on-tree-shaking-lodash/
But we can replace it via import get from lodash/get and it should work, but maybe it can be done in another PR (or tomorrow if it still won't be merged)

const logPR = (): void => logEvent('community', 'contribute-pr')
const logBlogpost = (): void => logEvent('community', 'contribute-blogpost')
const logTalk = (): void => logEvent('community', 'contribute-talk')
const logAmbassador = (): void => logEvent('community', 'contribute-ambassador')
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC there's an option to not have to mark up every return type, if you get bored of doing that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, but we intentionally enabled this rule to have more strict type checking

href="mailto:[email protected]?subject=I want to give a talk!"
target="_blank"
rel="noreferrer noopener"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's now automatically handled by Link component


// eslint-disable-next-line @typescript-eslint/interface-name-prefix
interface Window {
ga: (command: 'send', data: IGaEvent | IGaException) => void
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be ga?. Ad blockers and privacy extensions cause ga to not load.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

window.ga is set by gatsby-plugin-google-analytics. I only described its interface

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.

4 participants