-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix a bug and add a feature #4
Conversation
- publish to personal npm scope - remove webpack build and dev deps - use index.js in package.json as main - relocate src/* to lib/* - expose `ConnectState` component so it can be subclassed - update docs
by applying a useCallback memoization
Hey, thanks for this PR. Will take a look over it now - would also be great if you could reproduce the bug too. In the meantime could we keep changes to what is necessary only please |
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.
Thanks again for the PR 👍 left some reviews for you to take a look at
@@ -1,7 +1,6 @@ | |||
yarn.lock | |||
yarn-error.log | |||
uss-logo.png | |||
src/ |
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.
Why rename this folder?
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.
It's more common to use the lib
folder name than src
, if it bothers you I can rename that again.
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.
Yep - necessary changes only please, not personal preference.
@@ -1,3 +1,8 @@ | |||
# this is a fork of [Jahans3/use-simple-state](https://github.com/Jahans3/use-simple-state) |
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.
Could we remove before merging please
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.
yup!
class ConnectState extends Component { | ||
state = {}; | ||
export class ConnectState extends Component { | ||
constructor(props) { |
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.
Can we remove this constructor please
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'm calling super() in the ctor, so I don't think it can be removed (or will it be called automagically somehow?)
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.
It's just not necessary in this instance. What you've written is functionally identical to state = {}
"peerDependencies": { | ||
"react": "^16.7.0" | ||
}, | ||
"devDependencies": { |
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.
Can we get the dev deps back please
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.
Can you elaborate why it's needed? I was trying to reduce dependencies and files in the code
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.
Because they're necessary to develop the library. Dev dependencies have zero bearing on the final artefact. I would strongly recommend reading up on dev, peer and normal dependencies
@@ -1,37 +0,0 @@ | |||
const path = require('path'); |
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.
Can we get this back please
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.
Same as above, can you elaborate why it's needed? I was trying to reduce dependencies and files in the code
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.
A webpack config is required to use webpack and build the project...
@@ -1,2747 +0,0 @@ | |||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
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.
Can you regenerate this lock file please
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.
lock files are not recommended for libraries, see my comment below about package-lock.json and maybe it applies to yarn as well, I don't actually know much about yarn tbh
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.
The lockfile is still useful for anyone developing on this project.
@@ -0,0 +1 @@ | |||
package-lock=false |
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.
Could we delete this file please - using yarn on this project and prefer to have lock files in place
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.
npm will ignore lock files in dependencies:
One key detail about package-lock.json is that it cannot be published, and it will be ignored if found in any place other than the toplevel package.
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 simply disables the lockfile entirely - meaning npm will not generate one. That is not behaviour we want nor do we want to use npm either - this project uses yarn.
Also need to see a repro of the bug |
I'm going to close this as I don't have the time right now to perform all the changes / create a test case for the bug. |
@kessler No problem. Will try and recreate the bug in the meantime. Thanks again for contributing! |
=>
Do you want me to rebase this or something?
Do you need me to provide a code that recreates the bug?