Ruck release v4.0.0

Published .

Major

  • The navigate function powering Ruck app route navigation on the client that’s populated in the React context NavigateContext by the React component ClientProvider now converts a relative URL used for option url to an absolute URL using document.baseURI as the base instead of location.origin. This is consistent with how a native a element with a href attribute relative to a document base element navigates.

Minor

  • The function serve option clientImportMap now also accepts an import map object.

Patch

  • Updated dependencies.
  • Use development versions of React related dependencies in the development import map.
  • Function documentHasStyleSheet fixes and improvements:
    • A relative URL used for argument 1 href now converts to an absolute URL using document.baseURI as the base instead of location.origin.
    • Added runtime argument type checks.
    • Added tests.
  • React hook useOnClickRouteLink fixes and improvements:
    • Now the click event handler doesn’t do anything if the event default action is already prevented, if a non main mouse button was pressed, or if any of the following keys were pressed during the click:
      • Alt (in Safari, downloads the link)
      • Control (in Safari, displays the link context menu)
      • Meta (in Safari, opens the link in a new tab)
      • Shift (in Safari, adds the link to Reading List)
    • Added tests.
  • Added tests for the React component Effect.
  • Added tests for the function hydrate.
  • Moved code into try blocks in tests.
  • Tidied order of imports in tests.
  • Tweaked whitespace in scripts/test.sh.
  • Added to the readme “Examples” section.