-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
RMIZ's future: React 16 & beyond RFC #143
Comments
I’m in favor of exporting multiple components from the same package, rather than splitting into two packages. It’s likely a user will start with the stateful component and then grow into needing the lower level controlled component. My thinking is that it’s lower friction and more discoverable to change the import at the top of the file rather than package.json. |
@cbothner thank you for the feedback! |
Update: I've now broken ground on this. Here we go... Working from the |
Update: This has been paused as I've been having hand+wrist+forearm pain and need to deal with that before doing this outside normal working hours. Good news is that we'll be using latest & greatest React & hooks! |
@spencerfdavis is going to be giving me a hand with this. Welcome to the project, @spencerfdavis, and I look forward to getting some things rolling together over the coming months! |
Update: I've been putting a bit of work into the rewrite and am having a meeting with @spencerfdavis on Monday to figure out what path we want to go down with regard to some things. We're going to
The ultimate goals are:
There are also a few other folks who have expressed interest in contributing (thanks, Hacktoberfest!), so more to come on that, as well. |
The prototype for the rewrite is out on the master branch (master is dev for now), and it needs a lot of work. We'll be tracking its progress in https://github.com/rpearce/react-medium-image-zoom/projects/1, so I'm going to close this issue. |
Intro
With the latest React version and React's future as a whole, some things have come to light that need changing, and this has me thinking that it's time for an overhaul on this project.
Current State
While the project works fine as it is right now, here are some observations:
The Future?
Split Controlled & Uncontrolled Components
For this, I'm thinking either 1 of 2 things:
I could use some feedback on this.
All the "business logic" around what makes these components tick would naturally be extracted, shared and tested. Unlike
input
components, which can be controlled or uncontrolled (given you provide avalue
or not), developers know from the get-go how they're going to use this component, so I'm of a mind to have them choose from the start.Updates for future React
componentWillMount
,componentWillRecieveProps
,componentWillUpdate
are all about to be deprecated, so those need to either be updated to something else or find a way around them. Here's a blog post from Dan Abramov about what, why and what's coming: https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html. It's also listed as erroring as part of the newStrictMode
component: https://reactjs.org/docs/strict-mode.html#identifying-unsafe-lifecycles.ref
s to use the newReact.createRef()
API: https://reactjs.org/docs/refs-and-the-dom.html. Here's theStrictMode
section on it: https://reactjs.org/docs/strict-mode.html#warning-about-legacy-string-ref-api-usage.Testing
I've gotten a lot better about testing React components since this was initially published and updates made. I might as well use this as an opportunity to test all the things instead of relying on Storybook.
Keyboard a11y
Not much to say here other than it seems a bit wonky across browsers. Can address more fully if it's baked in from the get-go.
General Cleanliness
Parts of this library are quite difficult to follow and are hacky because it's what I had to do to make the library work. That said, I think this could improve the quality of the code (and dependability with tests) and make it easier for others to contribute.
Portability Across Frameworks / Languages
I'd love to identify patterns and code blocks that can be used as inspiration for porting this to
if I or someone else would like to.
Docs
Small point, but I'm going to move the documentation to separate markdown files and keep the README clean and to the point:
API.md
CONTRIBUTING.md
Thoughts? I'm asking all of you because you have contributed in this project in some way and should have a say:
cc @cbothner @jeremybini @ismay @rajit @rsaccon @wtfdaemon @aswinckr @alexshelkov @Snowsoul @kendagriff @hippodippo @oyeanuj @ludwigfrank @serfgy @babyPrince
The text was updated successfully, but these errors were encountered: