Skip to content

Releases: Ayc0/mock-match-media

v1.0.3

01 Oct 09:28

Choose a tag to compare

What's Changed

Full Changelog: v1.0.2...v1.0.3

v1.0.2

31 Aug 07:36

Choose a tag to compare

What's Changed

  • Remove optionalDeps & dependencies by @Ayc0 in #61
  • Switch to pnpm by @Ayc0 in #62

Full Changelog: v1.0.1...v1.0.2

v1.0.1

31 Aug 07:11

Choose a tag to compare

What's Changed

  • add TextEncoder is Jest setup by @Ayc0 in #60

Removes the necessity to add this for JSDOM (see bloczjs/react-responsive@8856834 for example):

import { TextEncoder } from "node:util";
Object.assign(globalThis, { TextEncoder });

Full Changelog: v1.0.0...v1.0.1

v1.0.0

31 Aug 06:39

Choose a tag to compare

What's Changed

Breaking changes

  • Update node versions to 20, 22, 23, 24,
  • Update internal library from css-mediaquery to media-query-fns to support CSS media queries level 5 (queries like @media (width < 150px)).
    • Update height, width, deviceHeight and deviceWidth in setMedia to be numbers instead of strings (see #41)
    • Change to setMedia feature from kebab-case to camelCase (see #35)
    • Minor breaking change: the default value of height, width, deviceHeight and deviceWidth is now 0 instead of undefined,
    • aspectRatio can‘t be set anymore, instead it’s now derived from height & width (same for deviceAspectRatio),

Before in v0:

setMedia({
  "prefers-color-scheme": "dark",
   "width": "15px",
   "aspect-ratio": "1",
});

After in v1:

setMedia({
  prefersColorScheme: "dark",
  width: 15,
  height: 15,
});

For JSDOM environments (like for Jest), you may also need to add this:

import { TextEncoder } from "node:util";
Object.assign(globalThis, { TextEncoder });

Other changes

  • Fully build dependency to dual ship CJS & ESM (see #58),
  • Add a polyfill.d.ts & jest-setup.d.ts in the exports field (see #57),

Internal changes

  • Use npm instead of yarn (see #55),
  • Use node:test instead of ava (see #54),

Full Changelog: v0.4.3...v1.0.0

v1.0.0-alpha.5

30 Aug 14:06

Choose a tag to compare

v1.0.0-alpha.5 Pre-release
Pre-release

What's Changed

Full Changelog: v1.0.0-alpha.4...v1.0.0-alpha.5

v1.0.0-alpha.4

30 Aug 14:03

Choose a tag to compare

v1.0.0-alpha.4 Pre-release
Pre-release

What's Changed

  • Add polyfill.d.ts by @Ayc0 in #57
  • Prebuild dependency to be able to ship CJS by @Ayc0 in #58

Full Changelog: v1.0.0-alpha.3...v1.0.0-alpha.4

v1.0.0-alpha.3

23 Aug 18:33

Choose a tag to compare

v1.0.0-alpha.3 Pre-release
Pre-release

What's Changed

  • [Fix] Handle aspect-ratio with NaN values by @Ayc0 in #56

Internal changes

  • [chore] remove ava and use node:test instead by @Ayc0 in #54
  • [chore] use npm instead of yarn by @Ayc0 in #55

Full Changelog: v1.0.0-alpha.2...v1.0.0-alpha.3

v1.0.0-alpha.2

12 Jun 07:50

Choose a tag to compare

v1.0.0-alpha.2 Pre-release
Pre-release

What's Changed

  • [Fix] Superior or equals (>=) doesn't work with equal values by @Ayc0 in #50

Internal changes:

Full Changelog: v1.0.0-alpha.1...v1.0.0-alpha.2

v1.0.0-alpha.1

25 May 10:13

Choose a tag to compare

v1.0.0-alpha.1 Pre-release
Pre-release

What's Changed

  • [BREAKING CHANGE] update supported node versions to 18, 20, 22, 23, and 24 by @Ayc0 in #40
  • [BREAKING CHANGE] Update height, width, deviceHeight and deviceWidth in setMedia to be numbers instead of strings by @Ayc0 in #41
  • [BREAKING CHANGES] drop node 18.x to support ESM by @Ayc0 in #42
  • [BREAKING CHANGES] Supports CSS media queries level 5 + change to setMedia feature from kebab-case to camelCase by @Ayc0 in #35
  • [BREAKING CHANGE] Make device-width & device-height respond to width & height * dppx by @Ayc0 in #48

Internal changes:

  • add tests for media-type by @Ayc0 in #44
  • add tests for prefers-color-scheme by @Ayc0 in #45
  • Update all deps by @Ayc0 in #49

Full Changelog: v0.4.3...v1.0.0-alpha.1

v0.4.3

29 Jun 12:57

Choose a tag to compare

What's Changed

  • [types] fix path to types and add types in exports field in #38

Full Changelog: v0.4.2...v0.4.3