-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Potential Refactor #227
Comments
Hey @brianreavis, good to have you here! Would be really happy to have your help addressing these. I agree with most of what you've listed, and have been meaning to do a fairly large refactor for a while (especially the "values must be strings" limitation). Specifics:
And finally - I'm really interested in allowing options and values to be provided as any kind of object. The original use-case for this was a "drop-in" replacement for something like Selectize, in a React app. Which works great if you're dealing with forms, but in a more sophisticated SPA this really holds it back. We should also make it easier (without hacks) to replace any child component (menu items, value renderer, etc) with a custom component that would take the value / option data and render it however it likes. Let's clean up the current PRs as much as we can then start prepping for a new refactored version. If we can get these issues (particularly configurable components and complex values) in place that's probably a good target for releasing v1.0.0 which would be fine to include breaking changes as necessary. |
As a solution for Bower distr:
|
@JedWatson I concur with @AlexKVal with making a separate repository just for the dist mess that is Bower. @brianreavis these suggestions are awesome. |
@brianreavis any ideas on how we could avoid a I understand that would just mean we push the transpilation steps higher up the dependency chain, which is fine, but experience has told me that can be a real bugger for those using web pack; so that is why the current solution is holding its own. |
@dcousens Hmm, I'm not sure we can drop it altogether. In webpack guides it's common for the I think the best plan of attack is:
What do you think? |
"files": [
"LICENSE",
"README.md",
"CHANGELOG.md",
"lib",
"dist",
"... whatever ... "
] |
👍 Works for me |
Additionally, when you create a release on GitHub, you can upload binaries if you want, so you can include the already compiled css and js in a zip or tar for each release, and keep it out of the Git repo. |
Closing in favour of #568 |
Just for fun I've ticked off the concerns that are addressed in the rewrite. Those that aren't:
|
First, react-select is slick! It's been awesome to work with. I've been wanting to make some bugfixes, but have ended up with my hands tied because of a few things that are hard to reason about. This list also contains some other notes:
componentWillMount
? It's triggered on the server, so callingautoloadAsyncOptions
and such here seems strange. Also, I'm not surethis._bindCloseMenuIfClickedOutside = ...
etc are assigned in this way here?"options"
prop to be immutable. Whenever a prop changes, there's twoJSON.stringify
calls incomponentWillReceiveProps
that are expensive for large datasets. It'd be more efficient if there could just be a strict equality check here.setState
calls? React will batch these so I think's a bit moot and leading to more problems than it's solving? It's tough to track down where events are bound/unbound....spread
in cases like these.this
context matter on callbacks? E.g.callback.call(this, {});
All React element methods are auto-bound already.onChange
events. It feels very weird to cast an ID to a string for<Select>
then cast it back to a number.@JedWatson @dcousens What are your thoughts on these? I almost started on a lot of these today, but it'll create a lot of merge conflicts on existing PRs and be a little risky w/o tests.
The text was updated successfully, but these errors were encountered: