-
Notifications
You must be signed in to change notification settings - Fork 31
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
[Feature/typescript] Moved Api,Domain,helpers,logic from flow to ts #330
[Feature/typescript] Moved Api,Domain,helpers,logic from flow to ts #330
Conversation
…moira-alert#327) * AddingButton converted, added ts supporting to webpack added ts supporting to eslint * Updated less-module import
…eature/typescript � Conflicts: � .eslintrc.json � package.json
b093fe8
to
1e87615
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Больше всего из замечаний меня напрягает ренейм через удаление/добавление. В будущем, с компонентами, нужно этого избежать
package.json
Outdated
@@ -22,7 +22,7 @@ | |||
}, | |||
"dependencies": { | |||
"@skbkontur/react-icons": "4.1.0", | |||
"@skbkontur/react-stack-layout": "1.0.3", | |||
"@skbkontur/react-stack-layout": "^1.0.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Версии старайся ставить --save-exact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему? Таким способом не будет автоматического обновления, которое притянет мажорные изменения, зато все мелкие багфиксы будут актуальны в проекте
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Потому что мажорные изменения, увы, бывают breaking-change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вы скорее про patch изменения говорите, мажорные изменения это первая цифра из трех, и если она меняется, то это 99.99% breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sashasushko, @sorovlad Это понятно) но при такой записи "@skbkontur/react-stack-layout": "^1.0.3" не притянется версия с первой цифрой 2. Ее все равно нужно будет вручную править. А вот вторую и третью будет обновлять сам. Насколько я понимаю, это багфиксы и они не могут быть breaking change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В идеально мире да, не могут. Но бывало, что ломают.
В yarn при вызове "install" обновляются пакеты. Здесь мне нравится подход npm, версии обновляются только при установке или редактировании версии пакетов. И есть команда "ci", которая ставит только что нужно.
@@ -0,0 +1,3 @@ | |||
export const purifyConfig = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему-то файл GIT посчитал новым. В таких случаях пропадает история. Старайся делать переименовая через git mv
. Конкретно для этого файла сейчас не важно, но для каких-то компонентов - очень.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это происходит автоматически. Я делаю npx @khanacademy/flow-to-ts --write --delete-source src
--write write output to disk instead of STDOUT
--delete-source delete the source file
следом сразу коммит чтобы было проще прослеживать изменения. То есть тут конкретно создаются новые файлы, а не обновляются старые. Почему-то гит иногда понимает что это js -> ts, но я не понял почему
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это правильно, что git ренеймит. Нужно всё так делать. Чтобы git история сохранялась
@@ -0,0 +1,13 @@ | |||
export interface ContactConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Аналогично про ренейм
|
||
export const StatusesInOrder: Status[] = [ | ||
export const StatusesInOrder: string[] = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кажется, здесь потеряли точность. Были определенные строки, а стали любые
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Раньше там работало с Flow, сейчас я вписал константные строки вместо таких же
Statuses.EXCEPTION,
Statuses.NODATA,
Statuses.ERROR,
Statuses.WARN,
Statuses.OK,
Statuses.DEL,
но получил ошибку линта
Type 'string' is not assignable to type '"DEL" | "EXCEPTION" | "NODATA" | "ERROR" | "WARN" | "OK"
tsconfig.json
Outdated
|
||
/* Basic Options */ | ||
// "incremental": true, /* Enable incremental compilation */ | ||
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо будет потом подумать и поднять до 2015 или даже выше
…330) * Typescript and eslint settings and transpilled AddingButton component (#327) * AddingButton converted, added ts supporting to webpack added ts supporting to eslint * Updated less-module import * Moved Api,Domain,helpers,logic from flow to ts * Moved Api,Domain,helpers,logic from flow to ts * Implemented review: renamed interface, removed autoupdate on dependencies * Added todo, es2015
No description provided.