-
Notifications
You must be signed in to change notification settings - Fork 405
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
Version 2.0 #73
Merged
Version 2.0 #73
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Feb 19, 2017
Closed
Closed
Closed
This was referenced Feb 25, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If you'd like to test version 2 ahead of it's release, run
npm install react-infinite-calendar@next
This version focuses on initial render performance, extensibility through composition, bundle size and fixing bugs related to outdated dependencies.
Composition
The codebase has been heavily refactored to make way for composable Higher Order Components that will help add opt-in layers of functionality. Out of the box,
react-infinite-calendar
2.0 will come with the following HOCs:withDateSelection
,withDateRangeSelection
,withMultipleDateSelection
andwithKeyboardSupport
.The idea here is that users will also be able to write their own HOCs to enhance
react-infinite-calendar
to suit their needs if their use-case doesn't fit in the scope of the project.Here's a simplified example implementing multiple date selection:
Moment.js-->date-fns
Dependency on Moment.js and moment-range has been dropped in favor of date-fns. This results in a much smaller bundle, as
date-fns
allows cherry-picking the methods we need and only comes bundled with theen
locale by default.The project has also been converted to use the nwb tooling for development and to manage the creation of the ES6, ES5 and UMD builds.
Bug fixes and improvements:
The following issues will be addressed with version 2.0:
Backwards-breaking changes
Moment.js replaced with
date-fns
If you were using a custom locale with version
1.0
, you'll need to take a look at the new default locale and update your locale configuration. If you're planning on using a locale other thanen
, you'll also need to import that locale (refer to date-fns I18n documentation for more details) and pass it as a property of the locale prop. For example, if you wanted to add support for thefr
locale:Supported React Versions
Supported React versions have changed. Previously all React 14 and 15 releases were supported. Going forward only React 15.3 and newer will be supported. This was done in order to drop a peer dependency on react-addons-shallow-compare and replace it with React.PureComponent, as the docs suggest.
Display Options
Finally, display options have also been consolidated under the
displayOptions
prop:'portrait'
or'landscape'
Today
helperyears
view on select.Example usage of display options:
For more details, check out the defaultDisplayOptions file.
Storybook
And finally,
react-storybook
has been added and all of the examples from the demo site have been added. Clone the repo locally and runnpm run storybook
to check it out.