Skip to content

Releases: tj/react-enroute

4.1.2

03 Sep 17:00
Compare
Choose a tag to compare
  • up path-to-regexp to 6.2.1
  • up deps

4.1.1

24 Dec 19:13
Compare
Choose a tag to compare
  • fix routes count in debug

4.1.0

16 Oct 12:21
Compare
Choose a tag to compare
  • named capturing groups (up path-to-regexp to 6.2.0)

4.0.4

05 May 12:45
Compare
Choose a tag to compare
  • ignore leading '/' for better UX

4.0.3

28 Apr 17:46
Compare
Choose a tag to compare
  • remove trailing '/' from paths for better UX
  • empty location renders root index (actual for name-based routes), not defined
    location renders null (as before)
  • warn route not found in debug mode with checked path list
  • simplify example

4.0.2

27 Apr 21:56
Compare
Choose a tag to compare
  • return null for empty and not defined location to prevent show catch-all
    route

4.0.1

27 Apr 20:20
Compare
Choose a tag to compare
  • sideEffects: false

4.0.0

20 Apr 21:23
Compare
Choose a tag to compare

Major changes:

  • new syntax to make route structure more clean and simple
<Router location='/users/42'>
  <Index>
    <Users path='users'>
      <User path=':id'/>
    </Users>
  </Index>
<Router/>

If you have a good use case when the new syntax is inconvenient please let me know. It's not hard to add old behaviour as option, but it will make the code less simple and increase the size of the library.

  • router props will not be passed to components anymore
  • path params are direct properties now
    They were in params object before. In most cases things like id preferably to be direct properties. This is more expected, less error prone and makes code a bit cleaner. Sometimes it can help in optimization pure and memo components too. Please be care with possible property conflicts while updating to 4.0.0.
  • path-to-regexp upgraded to 6.1.0
    Check releases page to know major changes in a path regexp's. Tree shaking should work better with this lib now!
  • location and params will not be automatically URI-decoded anymore
    You can use decode and encode in options (see path-to-regexp readme)

Others

  • TypeScript definitions
  • genLocation (alias: loc), isPath, findPath, findPathValue utils
  • matching options
  • @babel/runtime removed from dependencies, lib deps on path-to-regexp only now
  • simplify, reduce generated code size
  • router components can be changed between renders
  • fix bug router used old component properties during next renders
  • undefined location will not throw error anymore
  • react-native package field
  • add source files to package
  • control library size with Size Limit

3.0.2

02 Jul 23:14
Compare
Choose a tag to compare
  • pass location property to component

3.0.1

02 Jul 12:46
Compare
Choose a tag to compare
  • back to old behaviour with static routes to prevent reinitialization at any router render
  • fix old router props passed to render
  • example update