Releases: bloczjs/react-responsive
Releases · bloczjs/react-responsive
v4.0.0-beta.1
v4.0.0-beta.0
What's Changed
- update node in the CI by @Ayc0 in #81
- Remove
<Match>
by @Ayc0 in #67 BREAKING CHANGE - update tooling by @Ayc0 in #82
- update react to v19 by @Ayc0 in #83
Other small updates
- Bump word-wrap from 1.2.3 to 1.2.4 by @dependabot in #66
- Bump semver from 5.7.1 to 5.7.2 by @dependabot in #65
- Bump tough-cookie from 4.0.0 to 4.1.3 by @dependabot in #64
- Bump postcss from 8.4.14 to 8.4.31 by @dependabot in #68
- Bump @babel/traverse from 7.18.2 to 7.23.2 by @dependabot in #69
- Bump msgpackr from 1.6.1 to 1.10.1 by @dependabot in #70
- Bump follow-redirects from 1.15.1 to 1.15.4 by @dependabot in #71
- Bump ip from 1.1.8 to 1.1.9 by @dependabot in #72
- Bump follow-redirects from 1.15.4 to 1.15.6 by @dependabot in #73
- Bump ejs from 3.1.8 to 3.1.10 by @dependabot in #75
- Bump tar from 6.1.11 to 6.2.1 by @dependabot in #74
- Bump braces from 3.0.2 to 3.0.3 by @dependabot in #76
- Bump loader-utils from 3.2.0 to 3.3.1 by @dependabot in #77
- Bump micromatch from 4.0.5 to 4.0.8 by @dependabot in #78
- Bump rollup from 2.75.5 to 2.79.2 by @dependabot in #79
- Bump cross-spawn from 7.0.3 to 7.0.6 by @dependabot in #80
Full Changelog: v3.0.3...v4.0.0-beta.0
v3.0.3
What's Changed
Exposed changes:
- Add types in exports by @Ayc0 in #60
- [react 18] mark as available by @Ayc0 in #44
- [react][types] update to v18 by @Ayc0 in #49
Internal changes:
- Bump hosted-git-info from 2.8.4 to 2.8.9 by @dependabot in #41
- Bump url-parse from 1.4.7 to 1.5.1 by @dependabot in #40
- Bump dns-packet from 1.3.1 to 1.3.4 by @dependabot in #42
- Bump ws from 6.2.1 to 6.2.2 by @dependabot in #43
- Upgrade to Yarn 3 by @Ayc0 in #47
- update mock match media by @Ayc0 in #48
- [gh action] run on node 14 16 18 by @Ayc0 in #50
- [gh action] drop node 14 and use new JSON import syntax by @Ayc0 in #51
- [parcel] use parcel instead of CRA by @Ayc0 in #52
- update actions/checkout & actions/setup-node by @Ayc0 in #53
- [packages] update all by @Ayc0 in #54
- update more packages by @Ayc0 in #55
- Bump json5 from 1.0.1 to 1.0.2 by @dependabot in #57
Full Changelog: v3.0.2...v3.0.3
v3.0.2
- Better fix
only
andmatchMedia
props on DOM elements for theMatch
component- With the implementation of the v3.0.0, we were polluting the global scope, injecting the variable
React
everywhere. This version ships a better fix for both of them.
- With the implementation of the v3.0.0, we were polluting the global scope, injecting the variable
- Add support for node 15 and 16
v3.0.1
v3.0.0
- The package was renamed
@blocz/react-responsive
instead ofreact-only
- rename
useOnly
touseBreakpoint
anduseQuery
touseMediaQuery
BREAKING CHANGE- Those were renamed for 2 reasons:
useOnly
isn’t really explicituseQuery
can be confused with react-query’s or apollo’s useQuery hooks
- Those were renamed for 2 reasons:
useBreakpoint
anduseMediaQuery
stop returningundefined
during the initialization and if the media query is invalid. Instead it will directly use the correct value, and if the media query is invalid, it’ll returnfalse
. BREAKING CHANGE- Bump peerDependencies to allow for react 17
- Drop support for node 10
- Remove prop
strict
BREAKING CHANGE:- This feature was initially introduced to avoid collision between
mdUp
andsmDown
for instance. But since we avoid the overlapping of breakpoints in the v1.0.1 and as this is customizable, this prop doesn't make sense anymore. - This prop relied on
calc(% + 1px)
andcalc(% - 1px)
which has 2 issues:- difficult to be compatible with SSR as for instance css-mediaquery crashes when we use
calc()
(see issue), 1px
is really arbitrary and not customizable so anyway if someone wanted to change that, they had to use custom breakpoints.
- difficult to be compatible with SSR as for instance css-mediaquery crashes when we use
- This feature was initially introduced to avoid collision between
- Fix
only
andmatchMedia
props on DOM elements for theMatch
component- Inject
MatchChildProps
inHTMLAttributes
from the global namespaceReact
- Inject
v2.3.3
v2.3.2
v2.3.1
- Use Node 13 conditional exports: https://nodejs.org/api/esm.html#esm_conditional_exports
v2.3.0
- remove polyfill for matchMedia (it should be define by the users) minor breaking change
- add new hook
useQuery
and use it internally inOnly
for the propmatchMedia
- drop
query
inuseOnly
BREAKING CHANGE- as there is a new hook
useQuery
that deals with media queries, the 2nd argument ofuseOnly
was redundant - new signature:
- before:
useOnly = (on?: string, media?: string, strict?: boolean) => boolean | undefined
- after:
useOnly = (on?: string, strict?: boolean) => boolean | undefined
- before:
- as
on
andmedia
were join with aor
, you can still mimic the previous behavior by doing:- before:
const isVisible = useOnly(on, media, strict);
- after:
const a = useOnly(on, strict); const b = useQuery(media); const isVisible = a || b;
- before:
- as there is a new hook