-
Notifications
You must be signed in to change notification settings - Fork 6
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 code into Typescript #411
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov Report
@@ Coverage Diff @@
## master #411 +/- ##
==========================================
- Coverage 96.09% 90.93% -5.17%
==========================================
Files 13 13
Lines 282 309 +27
Branches 0 92 +92
==========================================
+ Hits 271 281 +10
- Misses 11 17 +6
- Partials 0 11 +11
Continue to review full report at Codecov.
|
Hi @Jianrong-Yu |
Just published this as |
I've checked so far
What I haven't checked:
|
I am not sure about replacing Vite with |
"prettier.semi": false, | ||
"prettier.singleQuote": true, | ||
"prettier.trailingComma": "es5" | ||
"editor.formatOnSave": true, |
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.
This one, ideally, too
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.
You mean editor.formatOnSave
one? Or prettier
config moved to eslint
?
We can remove formatOnSave
if you don't like it. The format will be fixed by lint-staged
when the code is committing anyway.
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.
Sorry, I should provide more context here.
All the editor settings that you're adding will change the developer's IDE normal behavior and I usually tend to avoid doing this as everyone has their preferences.
What we can do and we already are doing — add some pre-commit hooks to ensure code passes eslint and prettier.
And it's not fair to add settings for vscode, and completely ignore WebStorm, for example. Having settings for all IDE will just pollute the project.
What do you think?
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.
Sorry, I should provide more context here.
All the editor settings that you're adding will change the developer's IDE normal behavior and I usually tend to avoid doing this as everyone has their preferences.
What we can do and we already are doing — add some pre-commit hooks to ensure code passes eslint and prettier.
And it's not fair to add settings for vscode, and completely ignore WebStorm, for example. Having settings for all IDE will just pollute the project.
What do you think?
@crecotun I agree it's not fair to have settings for vscode only, but since vscode is almost the de facto editor in front-end community, I think it's good to have the vscode only settings. The Typescript is also opinionated, but it's also the de facto javascript static typing solution now: the developers are still able to use react-stick
in Javascript, but they will get better support if they are using Typescript; just like users of VSCode will get more support, but the users of other editor will still get the formatting by Husky and Lint-staged in committing.
BTW, the vscode settings.json
is already there before this PR, I just added a few new items in it.
Hi @tzimmermann Yes the type is guaranteed by
Hi @crecotun The API didn't change, so from the aspect of users there is no breaking change for
|
@@ -0,0 +1,13 @@ | |||
{ |
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.
I believe this shouldn't end up in the codebase
"prettier.semi": false, | ||
"prettier.singleQuote": true, | ||
"prettier.trailingComma": "es5" | ||
"editor.formatOnSave": true, |
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.
Sorry, I should provide more context here.
All the editor settings that you're adding will change the developer's IDE normal behavior and I usually tend to avoid doing this as everyone has their preferences.
What we can do and we already are doing — add some pre-commit hooks to ensure code passes eslint and prettier.
And it's not fair to add settings for vscode, and completely ignore WebStorm, for example. Having settings for all IDE will just pollute the project.
What do you think?
@Jianrong-Yu I wouldn't agree that for users there was no change, you replaced Flow with TypeScript, so end-user is affected and this is a major change. I might be wrong here. Regarding the webpack. Testing. |
@crecotun Yes, I agree there are some breaking changes. The
It's a good idea to move the cases from Karma to Cypress (I'm not sure if Cypress is able to work with jest), Since it may changes the testing cases a lot, I didn't try it in this PR, we should try it later. |
38db034
to
74de17f
Compare
BREAKING CHANGE: FlowJS typing files changed to .d.ts files for TypeScript, flowjs is no supported from this commit
74de17f
to
8c6533d
Compare
@crecotun @tzimmermann BTW should I merge this PR once it's approved? The version number will be jump to 5.0 since it's a breaking change on typing. |
@Jianrong-Yu Could you explain why you added commitlint to the circleci? |
@crecotun I found all my old commits did't meet the requirements of |
@Jianrong-Yu I'd rather keep this pr about TS only and if you don't mind, create another PR with commit lint improvements. |
8c6533d
to
3695495
Compare
@crecotun I agree we should avoid introducing new things into this PR. I've reset it to the commit before |
🎉 This PR is included in version 5.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Similar to #169, I tried to migrate everything to TypeScript in this PR.
Some changes:
Vite
is replaced totsc
to generate both ESM and CommonJS package