Skip to content

Latest commit

 

History

History
275 lines (150 loc) · 9.41 KB

CHANGELOG.md

File metadata and controls

275 lines (150 loc) · 9.41 KB

Changelog

3.3.0 (2017-7-19)

Added:

  • Pass object of key value query parameters to Switch props (params), onChange callback, and renderSwitch function. 797be1b

3.2.1 (2017-6-29)

Fixed:

  • Fix a bug that prevented Switcher event listeners from being removed when nested in SwitcherProvider. e4ef9c6

3.2.0 (2017-5-17)

Added:

  • Added SwitcherProvider component. This can be wrapped at the top level such that browser events (load, pushState, hashChange) are registered only once for the entire tree rather than for each Switcher within the app.

Changed:

  • The dist directory is no longer checked into git. These files are only included in the npm package or using unpkg.

3.1.5 (2017-5-3)

Fixed:

  • Make prop-types a peer dependency to help switcheroo users get rid of warnings. b286b6c

3.1.4 (2017-4-26)

Fixed:

  • Prevent prettier from running on built files in dist. This one will actually update dist correctly f8bb603

3.1.3 (2017-4-26)

Fixed:

  • Update build in dist

3.1.2 (2017-4-26)

Fixed:

  • Correctly configure rollup for production to strip out development code. 506fc6c

3.1.1 (2017-4-20)

Fixed:

  • Move away from deprecated React.PropTypes and use prop-types package. 4ad51a5

3.1.0 (2016-8-26)

Added:

  • Added activePath as an argument to onChange and renderSwitch callbacks. It also gets set as a prop on the component being rendered. activePath is the RegExp string path (as defined on the Switch's prop) that was matched. It essentially provides information about why a component was rendered (by which matching path), which is mostly useful when an array of paths are passed in as props.

Fixed:

  • No longer assumes props.children is an array. 3ec6428

3.0.1 (2016-8-25)

Added:

  • Moved build to rollup and added new build targets (amd, ES2015, commonjs, umd). The build still defaults to the minified umd build so there will be no noticeable differences except that the build is slightly smaller. e807a30

3.0.0 (2016-7-15)

Changed:

  • Switcher no longer passes all its props to wrapper components. It now only passes through additional props (ones that are not Switcher props).

2.1.0 (2016-4-1)

Added:

  • Introduce renderSwitch prop, that can accepts a render function to provide more fine-grained control that the wrapper prop cannot provide. 2a7b65d

2.0.3 (2016-4-1)

Added:

  • Support React ^15.0.0 as a peerDependency. ab95e2e

2.0.2 (2016-4-1)

Fixed:

  • Fix bug where dynamic segments were not set on initial mount or subsequent mounts. 19a58c2

2.0.1 (2016-3-24)

Fixed:

  • Fix bug where multiple paths ending in the same pattern would cause wrong nodes to render. 0398f56

2.0.0 (2016-3-18)

Added:

  • Allow paths to contain dynamic segments. These dynamic segments are passed to the component as props. 2aaa657 95be79d
  • Add mapDynamicSegments prop to enable transforming dynamic segment data before it is passed as props. 2aaa657 95be79d

1.1.1 (2016-3-16)

Fixed:

  • Allow Switcher to render a null child. 2b51da2

1.1.0 (2016-3-15)

Added:

  • Added preventUpdate optional function prop to Switcher. When the function returns true, it prevents rendering changes. 562fa59

1.0.3 (2016-1-22)

Fixed:

  • Switch now correctly receives new props passed in. Previously rendering would be stale in certain situations. dc94afc

1.0.2 (2015-12-29)

Fixed:

  • Loosen wrapper PropType constraints on Switcher component. Allow nodes, React elements, and strings representing DOM nodes as well. 612e6c0

1.0.1 (2015-12-26)

Fixed:

  • Fix accidentally commented out build config so the build is minified and optimized for production again. cd445b0

1.0.0 (2015-12-23)

Changed:

  • Made Switcher the default export instead of a named export from the library. 9d97f19 Wherever using Switcher change as follows:
// old
import {Switcher} from 'switcheroo';
// new
import Switcher from 'switcheroo';

0.13.1 (2015-10-30)

Fixed:

  • Fixed bug that prevented the Switch path, /.*, from matching /. 0b2448e

0.13.0 (2015-10-20)

Changed:

  • Removed optional defaultHandler and defaultHandlerProps properties. These are no longer necessary since regular expressions are now used for the path prop, meaning that the default component can be the last Switch with a path regular expression that matches everything. 38e843e

Since this is a breaking change see how to migrate existing code that uses these props below:

<Switcher defaultHandler={MyComponent} defaultHandlerProps={myComponentProps}>
  <Component1 path="/path1" />
  <Component2 path="/path2" />
</Switcher>

becomes

<Switcher>
  <Component1 path="/path1" />
  <Component2 path="/path2" />
  <MyComponent path="/.*" {...myComponentProps} />
</Switcher>

0.12.0 (2015-10-18)

Changed:

  • Removed external window from webpack build configuration. This requires less configuration from end users and the external was not providing any meaningful value. fe53f76

0.11.0 (2015-10-08)

Changed:

  • Upgraded to React 0.14.0. 81b5603

0.10.0 (2015-10-04)

Fixed:

  • Google Closure Compiler seems to break some things and gives this error when Switcheroo is used with webpack: Super expression must either be null or a function, not undefined. 52a3b4d

0.9.1 (2015-10-04)

Changed:

  • Reduced build size with Google Closure Compiler. b72049b

0.9.0 (2015-10-04)

Added:

  • Allow Switch path property to take a string representing a regular expression or an array of them. a55a73e

0.8.0 (2015-09-25)

Breaking Changes:

  • Removed route-recognizer dependency. path prop now expects regular expression strings. eg: <Component path="/myPath/valueA|valueB/.+" />. This means that paths with route-recognizer specific features like dynamic segments (/path/:dynamic/more) or star segments (/path/*theRest`) will no longer work and should be updated. Most other paths should work without changes. 76df023

0.7.0 (2015-07-22)

Fixed:

  • Remove setState being called before component was mounted (removes warnings) 20c60de

0.6.0 (2015-07-22)

Fixed:

  • When a Switch's props change ensure that the component is rendered with the correct data. This was previously using stale props from initialization as the Switches are set to the handlers for route-recognizer route matches, so these references need to be updated on the React lifecycle, componentWillReceiveProps. 2f8316a

0.5.1 (2015-04-29)

Added:

  • route-recognizer dependency added to handle matching paths. This allows for dynamic segments and star segments which are covered in the docs. 3d5da48

0.5.0 (2015-04-25)

Added:

  • Switcher accepts optional wrapper prop. This specifies a component to wrap the rendered component with. 10dd2de
  • Switcher now accepts load and hashChange. These both default to true and control the event listeners that Switcher checks for path changes on. These work in conjunction with the existing pushState prop. 1003c14
  • Switcher accepts location prop, that defaults to hash. This is used for path comparison (window.location[this.props.location]). a91e604
  • Switcher accepts basePath prop that defaults to ''. This is prepended to all component path props in Switcher. 862f5fd

0.4.0 (2015-04-15)

Changed:

  • Switch path now ignores query params. This means a Switch with a path /abc renders for /abc and /abc?a=1&b=2. 575bfb0

0.3.1 (2015-04-03)

Changed:

  • onChange method is called right before Switcher renders new component. 0bbf93b

0.3.0 (2015-04-03)

Added:

  • Switcher accepts optional onChange prop. This is a function that gets called when the route changes. 2f0c5d0
  • Switch accepts optional onShow/onHide props. These are functions that get called when the Switch is rendered/removed from the view. 14aafea
  • Switcher accepts optional defaultHandler/defaultHandlerProps props. This is the default component that is rendered when there is not a matching Switch path. If one is not specified, nothing is rendered (a render function returning false). 97f956
  • Switch accepts optional handlerProps prop. If defined this object is passed as props to the handler. b9b7efc

Fixed:

  • Switcher component can now have less than two Switchs in it without erroring. afe4e90

0.2.0 (2015-04-02)

  • First working release!