Skip to content

Update typescript definitions, remove old definitions fix tests #312

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

Merged
merged 8 commits into from
Apr 25, 2017

Conversation

LKay
Copy link
Contributor

@LKay LKay commented Apr 18, 2017

Description

  • Updated typescript definitions
  • Fixed broken tests

Motivation and Context

  • Typings now follow the recommended structure for Typescript 2.0+.
  • Two tests were broke due to incorrect expected value and omitting timezone so had to fix them.

Checklist

  • I have added tests covering my changes
  • All new and existing tests pass
  • My changes required the documentation to be updated
    • I have updated the documentation accordingly
    • I have updated the TypeScript 1.8 type definitions accordingly
    • I have updated the TypeScript 2.0+ type definitions accordingly

package.json Outdated
"pre-commit": "^1.1.3",
"react": ">=0.13",
"react-addons-test-utils": ">=0.13",
"react": ">=15 <16",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you think these versions should be bumped?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically previous version still matches that but since react versioning has been change I just updated it. I can reverse that but still it would be good to add upper limit <16 in case there are changes that would break the library.

package.json Outdated
@@ -76,6 +73,8 @@
"webpack-stream": "^3.2.0"
},
"dependencies": {
"@types/react": ">=15 <16",
"moment": "2.16.x",
Copy link
Collaborator

Choose a reason for hiding this comment

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

We're aware moment is not a dependency of this project, and we would like it to stay that way :)

Copy link
Contributor Author

@LKay LKay Apr 22, 2017

Choose a reason for hiding this comment

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

Actually it is dependency as it is used all over the place. When you use only version compiled by webpack/gulp/grunt/whatever then you don't really need anything as output will be just single file. However if you add this to your project dependencies in node-like environment you need to be sure the library is there and it's resolvable. So the moment should be at least in peerDependencies if not dependencies.

I just noticed that it has been changed and react along with moment have been mover to peerDependencies where they should be. I'll merge with master and this should be good to go.

@simeg
Copy link
Collaborator

simeg commented Apr 21, 2017

Hi @LKay and thanks for your contribution! Your changes seem to be removing the TS typings for version 1.8. I am not using TS and therefore I don't know much about what's going on in that world, but why do you want to remove support for 1.8? Has everyone started using TS 2.0+?

@LKay
Copy link
Contributor Author

LKay commented Apr 22, 2017

It's not like nobody is using 1.8 but they are mostly legacy projects that haven't moved to 2.0+ yet. Since biggest repository for definitions, Definitely Typed moved to supporting only TS2.0+ natively for resolving typing and publishing them most of people already migrated. I could bring back the file but I'm sure it will be rarely used anyway.

package.json Outdated
@@ -39,11 +38,10 @@
"license": "MIT",
"peerDependencies": {
"moment": ">=2.16.0",
"react": ">=0.13",
"react-dom": ">=0.13"
"react": ">=0.13 <16",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you think we should cap the version support?

package.json Outdated
"react-addons-test-utils": ">=0.13",
"react-dom": ">=0.13",
"react": ">=0.13 <16",
"react-addons-test-utils": ">=15",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why are you bumping this version?

@simeg
Copy link
Collaborator

simeg commented Apr 24, 2017

There's a lot of things going on in this PR, and some changes are not motivated. I like that you want to upgrade to the recommended standard of TS 2.0+, but I don't see why we need to mess with the dependencies.

@LKay
Copy link
Contributor Author

LKay commented Apr 25, 2017

@simeg I brought back the versions without caps to package.json. Verison cap was basically to prevent code from breaking when React updates to version 16 and introduce breaking changes which might affect this library. Now it works with version 15.x.x but you're never sure what happens in the future. I'd recommend to set dependencies versions more strict.

@simeg
Copy link
Collaborator

simeg commented Apr 25, 2017

@LKay Thanks for updating, and thanks for making us stick to the standards. Out of curiosity - where can I find the documentation for the recommended TS 2.0 structure? Is it coming from Microsoft or DefinitelyTyped?

Also, you have to rebase for this to get merged.

@LKay
Copy link
Contributor Author

LKay commented Apr 25, 2017

You can get some basic guidelines here, here (templates), and also you can reference multiple issues and PR on DefinitelyTyped.

Against which branch should I rebase? I'ts not conflicting with anything on master branch.

@simeg
Copy link
Collaborator

simeg commented Apr 25, 2017

@LKay Great, thanks. Oops I had the wrong option selected here on GitHub. Merging now.

@simeg simeg merged commit 752fa8b into arqex:master Apr 25, 2017
@LKay
Copy link
Contributor Author

LKay commented May 8, 2017

@simeg Is there anything pending yet for this being released as 2.8.11?

danfo pushed a commit to danfo/react-datetime that referenced this pull request Jul 27, 2017
…feature-render-input

* 'master' of github.com:YouCanBookMe/react-datetime:
  Version 2.8.11
  Remove React.DOM references
  Remove maintainer wanted ad from README
  Add maintainer wanted ad to README
  Remove npm download counter from README
  Use correct @types-react version
  Remove moment as dependency (clean up after PR)
  Update typescript definitions (arqex#312)
  Bump version to 2.8.10
  Increase click area of arrows for changing day/month/year
  Update the dist files with new modules
  Update examples to create-react-class
  Use PropTypes from module instead of React
  Use create-react-class, drop React.createClass
  Fix broken reference to LICENSE in README
  Bump version to 2.8.9
  Reference correct file in build task
  fixed test that was used to document existing bug
  check date.month() for current active month
@cwmacdon
Copy link
Contributor

@LKay Why were the @types/react moved from devDependencies to dependencies? This doesn't seem right.

@simeg
Copy link
Collaborator

simeg commented Aug 28, 2017

@LKay Sorry for the delay but this change is included in the latest version. An answer to @cwmacdon's question would also be much appreciated :) Thanks.

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.

3 participants