Skip to content

Latest commit

 

History

History
executable file
·
205 lines (125 loc) · 8.58 KB

CHANGELOG.md

File metadata and controls

executable file
·
205 lines (125 loc) · 8.58 KB

Changelog

All notable changes to this project are documented in this file. This project adheres to Semantic Versioning.

Fixed

  • Fixes SSR.

Fixed

  • Fixes performance issue with not re-instantiating render-prop callbacks on each re-render.

Fixed

  • Fixes issue with spacebar scrolling the page (see PR#99)
  • Fixes IE compatibility by replacing uses of Array.prototype.find.

Changed

  • Removes invalid test
  • Minor change to package.json to remove some redundant Jest config.
  • Upgrade one forgotten devDependency.

Fixed

  • Emergency bug fix to remove asyc/await from the code (see PR#95)

This release brings support for React 16.3+ by way of some minor refactoring to remove deprecated lifecycle methods.

Changed

  • Replace deprecated lifecycle methods 'componentWillReceiveProps', 'componentWillUpdate' and 'componentWillMount'.
  • Updated unstated (internal dependency) to latest major release.
  • Updated all devDependencies.

Added

  • Possibility to have custom uuid on AccordionItem - suggested by springload#70

Fixed

Fixed

  • Add dist folder to list of Flow ignores, so Flow doesn’t error after a build.
  • Issue with babel helpers. Just reverted commit 6f9f2c324a6fad4a35a84307241f4f710407f242 for now.

Changed

  • Removed a couple of old npm scripts from the days before we introduced rollup to the build pipeline.
  • Upgraded a bunch of devDependencies, including Webpack which required a bit of a config refactor.

Changed

  • Refactored to use unstated for state-management instead of mobx + mobx-react, cutting the size of the bundle by approximately 60% 🎉.

Changed

  • Fixes mixed up filenames in the README

Added

  • Demo styles added to the bundle as two optional files:
    • minimal-example.css: 'Minimal' theme - hide/show the AccordionBody component
    • fancy-example.css: 'Fancy' theme - boilerplate styles for all components, as seen on our demo

Added

  • Publish flow types.

Changed

  • Update all React components to accept arbitrary HTMLDivElement props (eg. 'lang', 'role' etc).
  • Upgrade all dev-dependencies except the eslint configs.
  • Replace snapshot tests with explicit assertions in AccordionItemBody and AccordionItemTitle.
  • Add specific assertions to tests in accordionStore.
  • Minor syntax change in AccordionItemBody

Version 2.0 represents a total refactor, with a new context-based approach which should make this library more flexible, more maintainable and more comprehensively testable.

As this is a major release, users should expect some breaking changes - though they should be limited to the removal of the activeItems prop (read more below).

Added

Fixed

  • Defect where controlled components' props were overridden by React.Children.map (springload#33).
  • Defect where accordion crashed with unexpected children types (springload#45).
  • Defect where React Accessible Accordion's components could not be extended.
  • Defect where the children of Accordion or AccordionItem could not be arbitrary.
  • Defect where AccordionItem had to be a child of Accordion (as opposed to to an arbitrary-level descendant).
  • Defect where AccordionItemBody and AccordionItemTitle had to be children of AccordionItem (as opposed to arbitrary-level descendants).

Removed:

  • 🚨 Breaking change 🚨 activeItems property is no longer supported.

Control at the Accordion level (via the activeItems prop) and AccordionItem level (via the expanded prop) fought against one another, and choosing which control mechanism to give preference to would have been an arbitrary decision - and whichever way we went, we would have had test cases which demonstrated unusual/unpredictable behaviour. The activeItems mechanism was the obvious one to remove - it was arguably the "less React-y way", and we considered it more of a convenience than a feature. Crucially though, it fought too hard against the new architecture of the library, and keeping it would have prevented us enabling lots of other new features or resolving some of the issues that our users had raised.

If you're currently using activeItems, you're upgrade path might look like this:

const items = ['Foo', 'Bar'];
const activeItems = [0];

return (
-    <Accordion activeItems={activeItems} />
+    <Accordion />
        {activeItems.forEach((item, i) => (
-            <AccordionItem key={item}>{item}</AccordionItem>
+            <AccordionItem key={item} expanded={activeItems.includes(i)}>{item}</AccordionItem>
        )}
    </Accordion>
);

Please don't hesitate to reach out to one of the maintainers (or raise an issue) if you're having trouble upgrading - we're happy to help!

  • Replace prop-types implementation with flow-types (springload#22) Thanks @ryami333 for the great contribution

NB: This version is backward compatible. It's just bumping to 1.0 to represent maturity rather than API changes.

  • Improved accessibility support (Following springload#19)
  • Adds possibility to programmatically open items(springload#13) Thanks @epotockiy for the contribution
  • Improved accessibility status on demo page
  • Documentation about accessibility for this component
  • Possibility to add a CSS class to hidden blocks (Following springload#16)
  • Githooks are executable (springload#15)
  • Bump to Node 8 / NPM 5
  • Supports React 15.5+
  • No warnings when you have only one item in the accordion
  • Possibility to have extra blocks in AccordionItem
  • Accordion mode / Collapse mode
  • Possibility to pre expand items
  • 100% coverage with unit tests
  • Possibility to customise CSS.
  • Clean CSS for the demo/github page.

Added

  • Something was added to the API / a new feature was introduced.

Changed

Fixed

Removed