-
Notifications
You must be signed in to change notification settings - Fork 290
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
Remove hasteResolver in favor of standard esm relative imports [Fix #513] #519
Conversation
Thanks for putting this PR up! It looks like the tests are failing on travis-ci, have you had a chance to look into the cause of that yet? |
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.
Looks good to me once travis is fixed and the formatting nits are addressed.
Thank you for the formatting fixes, they're much appreciated and needed. In future PRs could you separate the formatting changes to a different PR from the content so it's easier to review?
@@ -73,7 +73,7 @@ class DOMMouseMoveTracker { | |||
} | |||
|
|||
if (this._isTouchEnabled && !this._eventTouchStartToken && | |||
!this._eventTouchMoveToken && !this._eventTouchEndToken) { |
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.
nit: add this spacing back. We don't want the if conditional and the block statement content to be at the same indent
@@ -118,7 +118,7 @@ class DOMMouseMoveTracker { | |||
} | |||
|
|||
if (this._isTouchEnabled && this._eventTouchStartToken && | |||
this._eventTouchMoveToken && this._eventTouchEndToken) { |
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.
nit: same spacing comment as above
@@ -25,18 +25,18 @@ var EventListener = { | |||
* @param {function} callback Callback function. | |||
* @return {object} Object with a `remove` method. | |||
*/ | |||
listen: function(target, eventType, callback) { | |||
listen: function (target, eventType, callback) { |
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.
nit: don't add this space between the function keyword and the parameters. Here and throughout the files.
@wcjordan thanks for the review! I believe all addressed
This was caused by unrelated changes pulled in from #507 that I hadn't noticed. Now fixed.
I can totally do in the future. In this case, they weren't planned, just a side-effect of my IDE auto-formatting files as I worked on them. (The various nits were also disagreements between my IDE's defaults and the standards in this repo). Makes me wonder if it would be worth defining |
@pradeepnschrodinger I'm ready to merge this given the formatting concerns are addressed by #520. Do you have any concerns? Should we wait until after v1.1 is released? |
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 looks very good, thanks.
I see some troubles with the build process, but don't feel like we should block the merge.
But unless the build is fixed, we can't release right? So either we can merge right away, and hold of v1.1 release for some time until we figure out the build changes, or we just merge this after the release.
Let's hold off merging and get 1.1 released while we work the issues out w/ our NPM package. Niranjan & I are discussing the NPM issues and will follow up here soon. |
Sounds good. LMK if there's something I missed or can fix to get the build back online. |
Will do. A lot of the issue has to do with how this buildNPMInternals.sh script flattens the directory structure when preparing to upload to NPM. We're discussing what we want the outcome to be, and will reach out once we know that (or in general details of why this old build system is how it is). |
Hey @boxfoot sorry for our delays here. We had some other priorities come up and haven't been able to investigate fixing buildNPMInternals.sh yet. I just wanted to know we haven't forgotten about this, but it may be another month before we have a good answer. |
Hey @boxfoot sorry again for all our delays here. We've been heads down on some other projects, and are just now getting back to this. We should be making progress over the coming few weeks. |
@boxfoot , hey really sorry for the delay. So could you merge squash the commit 8cff569 to this branch? The commit will update the build script to be compatible with relative imports, and then this PR would be good to go. Also, there seems there's a few merge conflicts with latest master. Could you also take care of that? |
@pradeepnschrodinger Thanks for the update! |
Description
Fixes #513 by removing the old "hasteResolvers" and using standard relative imports instead.
Motivation and Context
The hasteResolvers is a legacy from when FB managed this package. While it makes imports a little bit more concise, it obscures the architecture of the overall package and makes it harder for new contributors to understand how things fit together. It's also a bit of magic that is only understand by webpack, making the code harder to maintain and reuse. In contrast, relative imports are an old standard way of locating files on a file system and is totally supported by node.
Some notes/questions:
vendor_upstream
, some of which are probably not needed anymore (likerequestAnimationFrame
, others that are duplicative (we sometimes usevendor_upstream/core/clamp
and sometimeslodash/clamp
and they both do the same thing) and others that could be easily provided by small npm packages. I'm leaving making any of those changes out of scope for now, but we may want to address later. For now, I've grouped imports into three groups in each file: (1) raw package imports, (2)vendor_upstream
imports, (3) local relative imports.@types/
to the devDependencies for this purposeHow Has This Been Tested?
Ran all tests, tried out examples.
Screenshots (if appropriate):
Types of changes
Checklist:
My change requires a change to the documentation.I have updated the documentation accordingly.