Releases respect semantic versioning.
Published .
They are now https://jsr.io/@std packages, instead of the package https://deno.land/std@0.154.0.
To migrate, in your server import maps (i.e. importMap.server.dev.json and importMap.server.json):
- "std/": "https://deno.land/std@0.154.0/",
+ "@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/javascript instead of application/javascript.
serve that creates the Ruck app HTTP server:
Migrated from the deprecated Deno standard library function to Deno.serve.
The option port is now optional and defaults to 0. Set 0 to listen on any available port (later get the listening port via the resolved HTTP server property addr.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;readableStreamFromReader to the new Deno API Deno.FsFile.readable.Deno.FsFile.rid, Deno.resources, and Deno.close to manually calling the modern Deno.FsFile method Symbol.dispose.serve option esModuleShimsSrc.Html prop esModuleShimsScript.@import to import types in modules and readme example code.deno flag --allow-import, as required by Deno v2.serveProjectFiles.deno-puppeteer to @astral/astral in tests.Published .
createPseudoNode where click events could sometimes cause React rendering errors in the head app.Published .
react-dom/client entry, instead of react-dom.hydrate.mjs the new function hydrateRoot from react-dom/client instead of the old function hydrate from react-dom.--unstable flag for the install and test scripts.createPseudoNode tests to better isolate each test.hydrate tests to better isolate each test and avoid Puppeteer browser errors relating to modifying HTML and import maps.Published .
run command --no-check flag when serving the Ruck app in production.Published .
media_types dependency with new Deno std APIs, fixing #5.useOnClickRouteLink tests failing in Linux environments due to the different macOS Chrome browser behavior when a “meta” key is pressed while clicking a link.Published .
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.json or deno.jsonc), containing:
{
"compilerOptions": {
"lib": [
"dom",
"dom.iterable",
"dom.asynciterable",
"deno.ns",
"deno.unstable"
]
}
}actions/checkout to v3.deno.json Deno config file.Published .
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.serve option clientImportMap now also accepts an import map object.documentHasStyleSheet fixes and improvements:
href now converts to an absolute URL using document.baseURI as the base instead of location.origin.useOnClickRouteLink fixes and improvements:
Effect.hydrate.try blocks in tests.scripts/test.sh.Published .
@ts-ignore comment within tests that’s redundant for TypeScript v4.6+.publicFileResponse.mjs:
Published .
routeDetailsForContentWithCss.mjs to routePlanForContentWithCss.mjs.Router type (from serve.mjs) intended for the default export of a project public/router.mjs module now returns a new RoutePlan type (also from serve.mjs) instead of RouteDetails, which has been removed.Route type (from serve.mjs) for the RouteContext React context value that the useRoute React hook returns no longer suggests the content property 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.serve.mjs.Published .
serve function from serve.mjs now reads the request headers x-forwarded-proto and x-forwarded-host when 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 forwards https: requests to the deployed server using http:..github directory.