v1.10 and v2 umbrella
See original GitHub issueUpdate (March 17th, 2019)
As described in detail in #123, I’m seriously considering publishing the current changes under a minor version bump: 1.10
. The bulk of the preparations for this have already been done in #123.
The next step would be to implement a v2 which uses hooks for the core functionality. I expect a hooks implementation could simplify some of the internals, and would simultaneously allow us to ship a hook as part of the API.
~2.0~ 1.10
- change
query
prop toqueries
(#72) - two-pass render + migrate to
componentDidMount
(solves #81, #91, #109, PR: #96) - run tests in
<Strict>
mode (#115) - merge #123
- polish the docs (#119)
- publish a prerelease, and have some people test it out in their production apps
~2.1~ 2.0 (now available as react-media@next
)
- ~implement a hooks API, exposed as
react-media/hooks
~ - reimplement the core functionality using hooks, expose a
useMedia
hook - implement a
<Media>
component, which is compatible with v1.10, but uses said hook internally
I propose exposing Media
as the default export and exporting the hook as a named export:
import Media, { useMedia } from 'react-media';
This would allow people to seamlessly upgrade to v2, without having to change existing code. There’s also not really any use in splitting things up, since the Media component will be very small (just a wrapper around the hook), and it will use the hook under the hood. So I don’t expect us splitting up the files will result in significant bundle size savings.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:43 (9 by maintainers)
@South-Paw Hey I just prepared everything for an alpha release, but sadly the deploy process halted due to an invalid npm token. I don’t have access to the npm project, so we’ll have to wait for @mjackson to fix the token in Travis. See #120 for details.
@moflo Thanks 😄. We’re planning to add hooks as well, but we first want to get v2 published.
@South-Paw @baumzeit Good news, the deployment problems have been fixed 🎉. You should be able to install
react-media@next
. Let me know how it goes!