-
Notifications
You must be signed in to change notification settings - Fork 41
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
refactor: moved to compatible with React 17 #48
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import raf, { cancel as caf } from 'raf'; | ||
import { filter } from 'lodash'; | ||
import { | ||
getIntersectionKeys, | ||
mapObject, | ||
|
@@ -65,7 +64,8 @@ export default (from, to, easing, duration, render) => { | |
let update = () => null; | ||
|
||
const getCurrStyle = () => mapObject((key, val) => val.from, stepperStyle); | ||
const shouldStopAnimation = () => !filter(stepperStyle, needContinue).length; | ||
console.log(needContinue); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✂️ |
||
const shouldStopAnimation = () => !Object.values(stepperStyle).filter(needContinue).length; | ||
|
||
// stepper timing function like spring | ||
const stepperUpdate = (now) => { | ||
|
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 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
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.
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.
Unused?
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.
What's unused? Corejs is required by presetenv
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 gather it has to be explicitly enabled, and is disabled by default:
https://babeljs.io/docs/en/babel-preset-env#usebuiltins
(Which is good. Polyfill = application responsibility, not library)
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.
That's not 100% right, on recharts we've been shipping library compiled with env to be compatible with at least ie11 and last 2 versions.
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 noticed, and I think it's a bit unusual. The use of
Webpack
itself here is a bit unusual. It's a tool for bundling client js for applications. The underlyingbabel
can/should be used by itself when we are creating libraries. Under the covers, webpack is just calling uponbabel
to do the transpile.axios is another famous project for promulgating this approach, which has sharp edges.
How do large projects end up committing seemingly obvious errors?
Consider the timeline: in 2016 and earlier, we had very limited choices for putting together demos/docs. Naturally,
webpack
can do this for us, but some project(s) end up using webpack for the build too, which is really better left forbabel
alone to do.Seen from an application developers' perspective: "Oh, guess I picked up another
Promise
implementation." or "Here goes another way to doObject.assign
." The developer now needs to a) address bloat if there is a lot of polyfill cruft, b) worry about conflicts of interest in competing polyfill solutions.The application developer needs to be in charge of their target environment(s). If they need a polyfill, they should add it... we cannot possibly imagine all the possible environments the code could be running in. And it's simple enough for the consumer to just add what they need.
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.
To get back on topic: @semoal
For this PR: I think it's fine if you need to add
core-js
(it was in recharts main repo at some point), but prefer to leave it out if possible. The creator is finally out of jail, which is good I guess.I will write a more detailed post about this problem soon, as I haven't seen this problem described in any detail on the web. Sorry for the rant.