Releases: jaydenseric/ruck
Version 9.0.0
Major
- Updated the required Deno version to v2+.
- Updated the Deno standard library dependencies.
-
They are now https://jsr.io/@std packages, instead of the package https://deno.land/[email protected].
To migrate, in your server import maps (i.e.
importMap.server.dev.jsonandimportMap.server.json):- "std/": "https://deno.land/[email protected]/", + "@std/http/": "jsr:/@std/http@^1.0.12/", + "@std/media-types/": "jsr:/@std/media-types@^1.1.0/", + "@std/path/": "jsr:/@std/path@^1.0.8/",
-
Ruck now serves JavaScript files with the content type
text/javascriptinstead ofapplication/javascript.
-
- Updated the function
servethat creates the Ruck app HTTP server:-
Migrated from the deprecated Deno standard library function to
Deno.serve. -
The option
portis now optional and defaults to0. Set0to listen on any available port (later get the listening port via the resolved HTTP server propertyaddr.port). -
It now resolves the created Deno HTTP server instance, of type
Deno.HttpServer<Deno.NetAddr>.To migrate:
const abortController = new AbortController(); - const { close } = await serve({ + const ruckAppHttpServer = await serve({ clientImportMap, port, signal: abortController.signal, });
Later, when you need to abort the server and await it closing…
abortController.abort(); - await close; + await ruckAppHttpServer.finished;
-
- Migrated from the deprecated Deno standard library function
readableStreamFromReaderto the new Deno APIDeno.FsFile.readable. - Migrated from the deprecated Deno APIs
Deno.FsFile.rid,Deno.resources, andDeno.closeto manually calling the modernDeno.FsFilemethodSymbol.dispose. - Ruck app pages no longer include an ES Module Shims script in the server side rendered HTML, as now all modern browsers support import maps.
- Removed the function
serveoptionesModuleShimsSrc. - Removed the React component
HtmlpropesModuleShimsScript.
- Removed the function
- Use the TypeScript JSDoc tag
@importto import types in modules and readme example code.
Patch
- Updated the GitHub Actions CI config:
- No longer run the workflow on pull request.
- Enable manual workflow dispatching.
- Run checks in separate jobs.
- For the test job on Linux, disable the modern security feature “AppArmor” so the Chromium developer build installed by Astral can be used (see crbug.com/373753919).
- Removed custom step names.
- Use Deno v2.
- Updated actions/checkout to v4.
- Updated actions/setup-deno to v2.
- Updated the project and readme import maps for the latest React v18.3.1 URLs.
- Configured Deno to not auto-generate a lockfile.
- Fixed formatting issues caused by updating Deno.
- Added in project and readme scripts the CLI
denoflag--allow-import, as required by Deno v2. - Modernized the project find min compatible Deno version script.
- Modernized the project type check script.
- Modernized the test helper function
serveProjectFiles. - Implemented Deno test steps now that denoland/deno#15425 is no longer an issue.
- Migrated from
deno-puppeteerto@astral/astralin tests.
Version 8.0.1
Patch
- Fixed a bug in the function
createPseudoNodewhere click events could sometimes cause React rendering errors in the head app.
Version 8.0.0
Major
- Updated dependencies.
- React v18 is now supported; dropping support for earlier versions.
- Project client import maps must now have a
react-dom/cliententry, instead ofreact-dom. - Ruck now uses in
hydrate.mjsthe new functionhydrateRootfromreact-dom/clientinstead of the old functionhydratefromreact-dom.
- Project client import maps must now have a
Patch
- Updated dependencies.
- Different approach to esm.sh dependency URLs:
- Updated the readme:
- Added heading links to the intro.
- Added a “Features” heading.
- Mention optimal JavaScript module design.
- Document how client import map esm.sh URLs are updated.
- No longer using the Deno
--unstableflag for the install and test scripts. - Made it easier to run the script for finding the minimum compatible Deno version by making it executable and adding a shebang.
- Added a new script to type check every JavaScript module in the project, and configured GitHub Actions CI to use it.
- Updated Puppeteer for tests and modernized related test helper code.
- Improved console logging of Puppeteer browser console output in tests.
- Refactored function
createPseudoNodetests to better isolate each test. - Refactored function
hydratetests to better isolate each test and avoid Puppeteer browser errors relating to modifying HTML and import maps. - Changed some test assertions to be less noisy if they fail.
- Updated GitHub Actions CI config.
Version 7.0.0
Major
- Updated dependencies.
Patch
- Fixed SSR cache data not being HTML escaped within the HTML inline script for client side hydration.
- In the readme “Installation” section, recommend using the Deno
runcommand--no-checkflag when serving the Ruck app in production.
Version 6.0.0
Major
- Updated the required Deno version to v1.21.2+.
- Updated dependencies.
Patch
- Replaced the
media_typesdependency with new DenostdAPIs, fixing #5. - Fixed the test script not exiting with an error status when tests fail.
- Fixed the React hook
useOnClickRouteLinktests failing in Linux environments due to the different macOS Chrome browser behavior when a “meta” key is pressed while clicking a link. - Added a script for finding Ruck’s minimum compatible Deno version.
- Use a more specific Deno version for the setup Deno step in the GitHub Actions CI config.
Version 5.0.0
Major
-
Removed TypeScript triple slash reference comments from Ruck modules that were originally intended to enable DOM types. Ruck projects now must have a Deno config file (
deno.jsonordeno.jsonc), containing:{ "compilerOptions": { "lib": [ "dom", "dom.iterable", "dom.asynciterable", "deno.ns", "deno.unstable" ] } }
Patch
- Updated dependencies.
- Updated GitHub Actions CI config:
- Updated
actions/checkoutto v3.
- Updated
- Implemented a
deno.jsonDeno config file.
Version 4.0.0
Major
- The
navigatefunction powering Ruck app route navigation on the client that’s populated in the React contextNavigateContextby the React componentClientProvidernow converts a relative URL used for optionurlto an absolute URL usingdocument.baseURIas the base instead oflocation.origin. This is consistent with how a nativeaelement with ahrefattribute relative to a documentbaseelement navigates.
Minor
- The function
serveoptionclientImportMapnow also accepts an import map object.
Patch
- Updated dependencies.
- Use development versions of React related dependencies in the development import map.
- Function
documentHasStyleSheetfixes and improvements:- A relative URL used for argument 1
hrefnow converts to an absolute URL usingdocument.baseURIas the base instead oflocation.origin. - Added runtime argument type checks.
- Added tests.
- A relative URL used for argument 1
- React hook
useOnClickRouteLinkfixes 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.
- 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:
- Added tests for the React component
Effect. - Added tests for the function
hydrate. - Moved code into
tryblocks in tests. - Tidied order of imports in tests.
- Tweaked whitespace in
scripts/test.sh. - Added to the readme “Examples” section.
Version 3.0.0
Major
- Updated the required Deno version to v1.20.1+.
- Removed a
@ts-ignorecomment within tests that’s redundant for TypeScript v4.6+.
Patch
- Updated dependencies.
- Updated
publicFileResponse.mjs:- Prevent directories within a Ruck project public directory from being served as if they are files.
- Close the open file if there’s an error when preparing a public file response.
Version 2.0.0
Major
- Route related function/module names and types have been improved to clarify in which situations route content may be a promise. When a route is being prepared and may have a promise for content it’s called a “route plan”, and when the resolved content renders it’s just called a “route”. The word “plan” was chosen because sometimes navigation to a route doesn’t go according to plan; the content promise (typically from a dynamic import) could reject or the navigation could be aborted before the content promise resolves and is ready to render.
- Renamed the function/module
routeDetailsForContentWithCss.mjstoroutePlanForContentWithCss.mjs. - The
Routertype (fromserve.mjs) intended for the default export of a projectpublic/router.mjsmodule now returns a newRoutePlantype (also fromserve.mjs) instead ofRouteDetails, which has been removed. - The
Routetype (fromserve.mjs) for theRouteContextReact context value that theuseRouteReact hook returns no longer suggests thecontentproperty could be a promise. This type was previously used for both when a route was planned and rendering, and while it’s ok to plan a route without using a promise for the content, it created the false impression that the content for a rendered route might be a promise. - Reworded several error messages within
serve.mjs.
- Renamed the function/module
Patch
- Updated dependencies.
- Fixed a readme code example comment typo.
- Improved the readme code example for a Ruck app component.
Version 1.1.0
Minor
- The Ruck app server request handler created by the
servefunction fromserve.mjsnow reads the request headersx-forwarded-protoandx-forwarded-hostwhen determining the route URL, which should be what the client originally used to start the request. Reverse proxy servers (load balancers, CDNs, etc.) may forward client requests to the Ruck app server using a different protocol or host. E.g. Fly.io forwardshttps:requests to the deployed server usinghttp:.
Patch
- Fixed relative URLs to project files in the readme.
- Corrected an example shell script in the readme.
- Tweaked example code in the readme.
- Removed a redundant image from the
.githubdirectory.