diff --git a/.changesets/10064.md b/.changesets/10064.md deleted file mode 100644 index 286624f3e066..000000000000 --- a/.changesets/10064.md +++ /dev/null @@ -1,8 +0,0 @@ -- Add Storybook (Vite) framework package (#10064) by @arimendelow - -Adds: - -- Storybook framework package for using Storybook with Vite. -- CLI package (command: `yarn rw sbv`) for running Storybook using Vite. CLI package additionally creates Mock Service Worker, and, on first run, the project-side Storybook config files. - -Current Storybook (Webpack) users will need to manually migrate any additional Storybook config (mocks, etc.). The primary user-facing difference between the old and new Storybook integrations is that the config used by the old one lives in the `@redwoodjs/testing` package, and the config used by this new one lives in the user's `web/.storybook` directory. diff --git a/.changesets/10179.md b/.changesets/10179.md deleted file mode 100644 index ffd8f9b7aaa7..000000000000 --- a/.changesets/10179.md +++ /dev/null @@ -1,34 +0,0 @@ -- feat(prettier) upgrade to prettier v3 (#10179) by @jtoar - -This PR upgrades Redwood internally to Prettier v3. We believe this won't have any downstream effect for users. - -If you have Tailwind CSS configured, can upgrade `prettier-plugin-tailwindcss` to a version later than `0.4.1` if you make a few changes: - -- Change `prettier.config.js` to `prettier.config.mjs` (js -> mjs) -- `export default` instead of `module.exports` -- `await import('...')` any plugins instead of `require('...')` - -Here's an example of an updated `prettier.config.mjs` to work with `prettier-plugin-tailwindcss@^0.5.12`: - -```js -// prettier.config.mjs - -export default { - trailingComma: 'es5', - bracketSpacing: true, - tabWidth: 2, - semi: false, - singleQuote: true, - arrowParens: 'always', - overrides: [ - { - files: 'Routes.*', - options: { - printWidth: 999, - }, - }, - ], - tailwindConfig: './web/config/tailwind.config.js', - plugins: [await import('prettier-plugin-tailwindcss')], -} -``` diff --git a/.changesets/10183.md b/.changesets/10183.md deleted file mode 100644 index 429c68fc4ba7..000000000000 --- a/.changesets/10183.md +++ /dev/null @@ -1,6 +0,0 @@ -- fix(cli): avoid `require` in prettier config during tailwind setup (#10183) by @Josh-Walker-GM - -With the recent switch to prettier v3 we are no longer able to use `require` within the `prettier.config.js` -config file. This change prevents the tailwind setup CLI command from adding a require statement when it adds -the `'prettier-plugin-tailwindcss'` plugin and instead it simply inserts the plugin name as a string. This -fixes commands such as `yarn rw lint` which would have failed in the presence of such a `require` statement. diff --git a/.changesets/10213.md b/.changesets/10213.md deleted file mode 100644 index 20c48cc64aea..000000000000 --- a/.changesets/10213.md +++ /dev/null @@ -1,5 +0,0 @@ -- PR feat: Send RSC Flight Payload to Studio (10213) by @dthyresson - -This PR sends the rendered RSC payload (aka "flight") to Studio to be ingested, persisted, and fetched. - -Performance and metadata enrichments are performed in order to visualize in Studio diff --git a/.changesets/10266.md b/.changesets/10266.md deleted file mode 100644 index 5556caf2e2f6..000000000000 --- a/.changesets/10266.md +++ /dev/null @@ -1,5 +0,0 @@ -- chore(linting): Update versions and avoid `{}` (#10266) by @Josh-Walker-GM - -This PR updates the versions of the `eslint` and the `@typescript-eslint` packages from v5 to v7. - -This is a major upgrade of the `@typescript-eslint` package and although we think it is unlikely to introduce a breaking change for you we would recommend that you read the associated documentation. The v6 upgrade can be found [here](https://typescript-eslint.io/blog/announcing-typescript-eslint-v6/) and the v7 one [here](https://typescript-eslint.io/blog/announcing-typescript-eslint-v7/). diff --git a/.changesets/10271.md b/.changesets/10271.md deleted file mode 100644 index 224acf6e2ccc..000000000000 --- a/.changesets/10271.md +++ /dev/null @@ -1,4 +0,0 @@ -- PR bug: Always evaluate the `` component on the client by @cannikin - -One of ``s dependencies (probably Helmet) uses `createContext()`. -This throws an uncaught error in the RSC engine and crashes the server. diff --git a/.changesets/10275.md b/.changesets/10275.md deleted file mode 100644 index 7a90f8e05dc8..000000000000 --- a/.changesets/10275.md +++ /dev/null @@ -1,3 +0,0 @@ -- chore(cli): Don't require `web` argument to `yarn rw serve` for RSC apps (#10265) by @cannikin - -Since RSC apps have no api side, just running `yarn rw serve` should serve just the web side automatically, no need to explicitly include the additional `web` argument. diff --git a/.changesets/10342.md b/.changesets/10342.md deleted file mode 100644 index 5179cd5e797e..000000000000 --- a/.changesets/10342.md +++ /dev/null @@ -1,51 +0,0 @@ -- fix(navlink): Replace (don't merge) className of active link (#10342) by @Tobbe - -We should be replacing className with `activeClassName` for the active link. Currently we try to merge them, but that makes it very difficult for end users to have full control over exactly what classes are applied to active links - -Fixes https://github.com/redwoodjs/redwood/issues/10296 - -## Before - -```tsx - - Air - -``` - -The `` above would get the following classes if it was the active link -`inline-block rounded-t-lg border-b-2 border-transparent p-4 hover:border-gray-300 hover:text-gray-600 dark:hover:text-gray-300 active inline-block rounded-t-lg border-b-2 border-blue-600 p-4 text-blue-600 dark:border-blue-500 dark:text-blue-500` - -## After - -That same `` now only gets the `activeClassName` classes `active inline-block rounded-t-lg border-b-2 border-blue-600 p-4 text-blue-600 dark:border-blue-500 dark:text-blue-500` - -## Breaking - -If you were relying on the merging behavior you will now have to copy all classes from `className` and also include them in `activeClassName`. -So if you had this: - -```tsx - - Air - -``` - -you will now have to change it to: - -```tsx - - Air - -``` diff --git a/.changesets/10344.md b/.changesets/10344.md deleted file mode 100644 index 277035ccfdb0..000000000000 --- a/.changesets/10344.md +++ /dev/null @@ -1,13 +0,0 @@ -- feat(tw): Add IntelliSense settings for Tailwind CSS VS Code plugin (#10344) by @Tobbe - -Add intellisense and color support for not only `className` (which is enabled by default), but also for `activeClassName` and `errorClassName`, which are two css class name props we use in Redwood - -## Manual Instructions - -If you already have TW set up and want to enable this, open `.vscode/settings.json` and add this: - -```json -"tailwindCSS": { - "classAttributes": ["class", "className", "activeClassName", "errorClassName"] -} -``` diff --git a/.changesets/10395.md b/.changesets/10395.md deleted file mode 100644 index fbb0c98be5a3..000000000000 --- a/.changesets/10395.md +++ /dev/null @@ -1,38 +0,0 @@ -- Middleware Routing & `registerMiddleware` (#10395) by @dac09 - -Implements the new syntax of using Middleware after discussion. This sets us up for doing Auth better, but also for implementations like OG Image generation. - -```js -export const registerMiddleware = async () => { - return [ - dbAuthMiddleware(), - [new OgMiddleware({ rootFilename: 'index' }), ['/:route.:extension']], - ] -} -``` - -**Features** - -- [x] Registering middleware with above syntax -- [x] Chaining multiple middleware by passing array of middleware, or tuples -- [x] Defining the route patterns to match in the find-my-way syntax - ---- - -**What syntax are you using for the route patterns?** -After discussion that Regexes are slow and unwieldy, I did some research and comparisons here: https://www.notion.so/redwoodjs/Middleware-Route-patterns-0f1c5587b4134073adfae896a782b5ea?pvs= - -This implementation uses https://github.com/delvedor/find-my-way - which is the Fastify version - but still keeps us decoupled from Fastify (see implementation, or document for why). - -**Important for understanding** -Quoting from find-my-way docs: - -> The nodes are matched in the following order: - - static - parametric node with static ending - parametric(regex)/multi-parametric - parametric - wildcard - -Which means, if you have a more specific one - example you have `[mw1, `\*`]` and `[mw2, '/refresh_auth']` - then a request to /refresh_auth will ONLY trigger mw2. This is sort of counter intuitive, but them are the rules with fmw. diff --git a/.changesets/10404.md b/.changesets/10404.md deleted file mode 100644 index 680ed2fb6ed7..000000000000 --- a/.changesets/10404.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(rw-eslint): Implement more specific checking on Routes (#10404) by @dac09 - -Fixes: If you use any other elements outside the Route tree it should not throw a linting error or warning diff --git a/.changesets/10412.md b/.changesets/10412.md deleted file mode 100644 index e04ce57e939d..000000000000 --- a/.changesets/10412.md +++ /dev/null @@ -1,3 +0,0 @@ -- SSR: Better ServerEntry types (#10412) by @Tobbe - -When enabling SSR the setup command will generate an `entry.server.tsx` file in the user's app. This file exports a `ServerEntry` component that takes `css` and ` meta` as props. The `meta` props used to be typed as `any`, making it difficult to use with confidence. This PR makes the type be `TagDescriptor[]` which is more correct. diff --git a/.changesets/10413.md b/.changesets/10413.md deleted file mode 100644 index 7c542a81abc2..000000000000 --- a/.changesets/10413.md +++ /dev/null @@ -1 +0,0 @@ -- fix(middeware): Allow registration with async functions (#10413) by @dac09 diff --git a/.changesets/10418.md b/.changesets/10418.md deleted file mode 100644 index 67e279473290..000000000000 --- a/.changesets/10418.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(middleware): Handle POST requests in middleware router too (#10418) by @dac09 - -Fixes issue with middleware router not accepted POST requests. diff --git a/.changesets/10420.md b/.changesets/10420.md deleted file mode 100644 index 75481c745124..000000000000 --- a/.changesets/10420.md +++ /dev/null @@ -1,8 +0,0 @@ -- feat: [Auth] Common AuthProvider & use\* changes for middleware auth #10420 by @dac09 and @dthyresson - -* First step of supporting Auth using middleware -* Ensure backwards compatibility with non-SSR auth - -### Breaking Change - -Removes `skipFetchCurrentUser` which was used by the no longer existing nHost auth provider, but could potentially have been used by custom auth. diff --git a/.changesets/10439.md b/.changesets/10439.md deleted file mode 100644 index 1c8628166a24..000000000000 --- a/.changesets/10439.md +++ /dev/null @@ -1 +0,0 @@ -- feat(og-gen): Adds package and vite plugin for dynamic og generation (#10439) by @dac09 diff --git a/.changesets/10441.md b/.changesets/10441.md deleted file mode 100644 index 66869280a58c..000000000000 --- a/.changesets/10441.md +++ /dev/null @@ -1,10 +0,0 @@ -- feat(og-gen): Update implementation of useLocation | Update App template (#10441) by @dac09 - **Updated App.tsx template** - We modified the `App.tsx` template to accept possible children, and render them if present. This lets the og:image handler inject your component into the Document tree, without including the entire Router, but still style your og:image component using whatever you used to style the rest of your app (Tailwind, perhaps?) - -**Updated useLocation implementation** -We also modified the `useLocation()` hook to now return everything that the [URL API](https://developer.mozilla.org/en-US/docs/Web/API/URL) returns. Previously it only returned three attributes of the url (pathname, search, hash), now it returns everything available to a call to `new URL()` (origin, href, searchParams, etc.). - -The reason for this is now that we have SSR, we can get access to more details in the hook - in this case we needed origin - -Both changes should be non-breaking! diff --git a/.changesets/10444.md b/.changesets/10444.md deleted file mode 100644 index 0e13368a17c0..000000000000 --- a/.changesets/10444.md +++ /dev/null @@ -1,5 +0,0 @@ -- feat(server-auth): Part 1/3: dbAuth middleware support (web side changes) (#10444) by @dac09 - Adds ability to `createMiddlewareAuth` in dbAuth client which: - -1. Updates the dbAuth web client to speak to middleware instead of graphql -2. Implements fetching current user from middleware diff --git a/.changesets/10447.md b/.changesets/10447.md deleted file mode 100644 index a459e0f059b1..000000000000 --- a/.changesets/10447.md +++ /dev/null @@ -1,4 +0,0 @@ -- feat(auth): redwoodjs/auth-dbauth-middleware - Auth Middleware for dbAuth to authenticate users via cookie - -* Implements createDbAuthMiddleware in @redwoodjs/auth-dbauth-middleware:build -* Used to register middleware for dbAuth in RedwoodJS projects diff --git a/.changesets/10453.md b/.changesets/10453.md deleted file mode 100644 index 54ff985037dc..000000000000 --- a/.changesets/10453.md +++ /dev/null @@ -1,5 +0,0 @@ -- feat: Remove `--performance` option from `yarn rw build` (#10453) by @Josh-Walker-GM - -This change removes the `--performance` flag from the `yarn rw build` command. It will no longer be available to use and the CLI will no longer accept this flag being passed in. - -Additionally, the associated webpack config (`@redwoodjs/core/config/webpack.perf.js`) has been removed so it can no longer be imported if you were doing so. diff --git a/.changesets/10457.md b/.changesets/10457.md deleted file mode 100644 index 4cbf40a10c3a..000000000000 --- a/.changesets/10457.md +++ /dev/null @@ -1,30 +0,0 @@ -- feat(server-auth): dbAuth 3/3 - handle login, logout, signup, etc. requests if forwarded from middleware (#10457) by @dac09 - -This PR updates the DbAuthHandler class to handle requests forwarded from middleware, so it can generate responses for login, logout, signup, etc. These are POST requests - it used to be to the `/auth` function, but now they will be captured by dbAuth middleware and forwarded onto DbAuthHandler. - -**High level changes:** - -- use the `Headers` class in each of the "method" responses. This allows us to set multi-value headers like Set-Cookie. A simple object would not. See type `AuthMethodOutput` -- extracts `buildResponse` into a testable function and adds test. For `Set-Cookie` headers we return an array of strings. - -In the middleware here's the code I had for the final conversion: - -```ts -if (AUTHHANDLER_REQUEST) { - const output = await dbAuthHandler(req) - - const finalHeaders = new Headers() - Object.entries(output.headers).forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach((v) => finalHeaders.append(key, v)) - } else { - finalHeaders.append(key, value) - } - }) - - return new MiddlewareResponse(output.body, { - headers: finalHeaders, - status: output.statusCode, - }) -} -``` diff --git a/.changesets/10460.md b/.changesets/10460.md deleted file mode 100644 index de8debaa45e3..000000000000 --- a/.changesets/10460.md +++ /dev/null @@ -1,41 +0,0 @@ -- chore(dbauth-mw): Refactor web side dbAuth creation (#10460) by @dac09 - -This PR changes how the webside auth is initialised, by removing the `createMiddlewareAuth` function, instead it just detects it internally. - -For dbAuth this is what it will looks like: - -```js:web/src/auth.ts -import { - createDbAuthClient, - createAuth, -} from '@redwoodjs/auth-dbauth-web' - -const dbAuthClient = createDbAuthClient({ - middleware: true, -}) - -// Internally we know to use the middleware version of the client -// because middleware is set to true above! -export const { AuthProvider, useAuth } = createAuth(dbAuthClient) - -``` - -For other auth providers we are going to export a similar looking function: - -```js -import { - createAuth, - createSupabaseAuthClient, -} from '@redwoodjs/auth-supabase-web' - -// This function is new, and just wraps creating supabaseπŸ‘‡ -const supabaseClient = createSupabaseAuthClient({ - supabaseUrl: process.env.SUPABASE_URL || '', - supabaseKey: process.env.SUPABASE_KEY || '', - middleware: true, -}) - -export const { AuthProvider, useAuth } = createAuth(supabaseClient) -``` - -This also means our users won't need to change where supabase client is imported from, for example. diff --git a/.changesets/10464.md b/.changesets/10464.md deleted file mode 100644 index 5e4985ea77a8..000000000000 --- a/.changesets/10464.md +++ /dev/null @@ -1,10 +0,0 @@ -- fix(router): Remove barrel exports from router.tsx (#10464) by @Tobbe - -We were using both `index.ts` and `router.tsx` as barrel export files. We should move away from barrel exports at some point, and we definitely don't need two files doing it in the same package. Everything that was exported from `router.tsx` is already exported by other files (except `Router` itself). So I updated the code to import from there directly instead. - -This is a breaking change for anyone who does `import ... from '@redwoodjs/router/dist/router'` in their project. Which hopefully isn't very many. - -- The quick fix is to find the original export and pull from there instead -- The real fix is to talk to us on the core team and see if we can provide an - official way of solving it instead of relying on internal implementation - details πŸ™‚ diff --git a/.changesets/10465.md b/.changesets/10465.md deleted file mode 100644 index c5a10d3b5ba2..000000000000 --- a/.changesets/10465.md +++ /dev/null @@ -1,13 +0,0 @@ -- feat(server-auth): Update getAuthenticationContext to support cookies and tokens both (#10465) by @dac09 - -**1. Updates `getAuthenticationContext` to parse the cookie header and pass it to authDecoder.** - -Note that the authentication context itself does not pull out the token from cookies, because with some providers (e.g. supabase) - we don't know the name of the cookie. This is left to the authDecoder implementation. - -The return type from this function is actually just a deserialized cookie header i.e. -`cookie: auth-provider=one; session=xx/yy/zz; somethingElse=bsbs` => `{ 'auth-provider': 'one', session: 'xx/yy/zz', somethingElse: 'bsbs'` - -**2. Retains support for header/token based auth** -See test on line 259 of `packages/api/src/auth/__tests__/getAuthenticationContext.test.ts`. If a the `authorization` and `auth-provider` headers are passed in the request (as we do for SPA based auth) - then cookies will take precedence. - -The end result is that graphql requests will now work with middleware-based auth providers! diff --git a/.changesets/10469.md b/.changesets/10469.md deleted file mode 100644 index 8bbb2e124e5d..000000000000 --- a/.changesets/10469.md +++ /dev/null @@ -1,49 +0,0 @@ -- feat(og-gen): Implement middleware and hooks (#10469) by @dac09 - -The OG Gen saga continues with @cannikin and @dac09 βš”οΈ - -This PR: - -- adds OgImageMiddleware and Hooks to `@redwoodjs/og-gen`, complete with tests - -⚠️ Template changes: - -- updates entry.client template to pass in Routes to App -- updates App to take children (i.e. Routes) - -This is so that we can pass the OG component to be rendered _with_ your App's CSS setup. - -**How to use this?** - -1. **Registering the middleware:** - - ```ts - import OgImageMiddleware from '@redwoodjs/ogimage-gen/middleware' - - export const registerMiddleware = () => { - const ogMw = new OgImageMiddleware({ - App, - Document, - }) - - return [ogMw] - } - ``` - -2. Configure your `vite.config.ts` - - ```ts - import vitePluginOgImageGen from '@redwoodjs/ogimage-gen/plugin' - - const viteConfig: UserConfig = { - // πŸ‘‡ so it builds your OG components - plugins: [redwood(), vitePluginOgImageGen()], - } - - export default defineConfig(viteConfig) - ``` - -3. Add your OG Image component next to the page it's for - e.g. web/src/pages/AboutPage/AboutPage.png.tsx - -4. Use hooks on AboutPage to generate the ogURL diff --git a/.changesets/10493.md b/.changesets/10493.md deleted file mode 100644 index 15861211dbae..000000000000 --- a/.changesets/10493.md +++ /dev/null @@ -1,18 +0,0 @@ -- feat(cookieJar): Change cookie.get to directly return value (#10493) by @dac09 - -**Motivation** -My original design of the `CookeiJar.get` would return the full cookie object we store, including cookie options. This is not ideal because you need to access the cookie like this: - -```js -const myCookie = mwRequest.cookies.get('myCookie') - -// πŸ‘‡ -const actualValue = myCookie.value -``` - -This is unwieldy, and feels unergonomic for the 98% of cases where `get` will be used to just see the value. - -**How do I still see the options of the cookie?** -You can still access all the details of the cookie by doing `cookie.entries`. I don't really have a case for this yet, so let's not optimise for this case, but we know it's possible! - -This is me just stabilizing the API for Middleware stuff, before we ship it out of experimental diff --git a/.changesets/10498.md b/.changesets/10498.md deleted file mode 100644 index 6543f393acda..000000000000 --- a/.changesets/10498.md +++ /dev/null @@ -1,8 +0,0 @@ -- feat(server-auth): WebAuthN support during SSR (#10498) by @dac09 - -**This PR changes the following:** -**1. Moves webAuthN imports to be dynamic imports** -This is because the dbauth-provider-web packages are still CJS only. When importing in an ESM environment (such as SSR/RSC server) - it complains that about ESM imports - -**2. Updates the default auth provider state for middleware auth** -Middleware auth default state is _almost_ the same as SPA default auth state. Except that loading is always false! Otherwise you can get stuck in a loading state forever. diff --git a/.changesets/10499.md b/.changesets/10499.md deleted file mode 100644 index f80f8fef394c..000000000000 --- a/.changesets/10499.md +++ /dev/null @@ -1,10 +0,0 @@ -- feat(auth): Implement Supabase Auth Middleware (#10499) by @dthyresson, @dac09 - -Implement Supabase Auth Middleware to authenticate server-side requests. - -- Adds middleware to the Supabase auth-providers package. -- createSupabaseAuthMiddleware is responsible for authenticating Supabase requests -- It does so by checking if the request has a supabase auth-provider header, and then uses the authDecoder to verify the session cookie using the Supabase ServerAuthClient and returning a decoded access token -- or throwing an exception if the session cookie is invalid -- Once the middleware has the decoded JWT, it hands that to the provided getCurrentUser from he user's project to return the information about authenticated user -- Lastly, it sets serverAuthState with user and metadata info to know the request isAuthenticated -- If the session is invalid or the cookie tampered with such that the access token cannot be verified, serverAuthState is cleared as are the auth provider and Supabase cookies diff --git a/.changesets/10502.md b/.changesets/10502.md deleted file mode 100644 index 5d2452434ca6..000000000000 --- a/.changesets/10502.md +++ /dev/null @@ -1,2 +0,0 @@ -- fix(dbauth-mw): Unset cookie instead of clearing (#10502) by @dac09 - Updates dbAuth middleware implementation to _unset_ the cookies, instead of clearing them. diff --git a/.changesets/10516.md b/.changesets/10516.md deleted file mode 100644 index b3666328b36d..000000000000 --- a/.changesets/10516.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(dbauth-mw): Use response passed in to middleware (#10516) by @dac09 - -Middleware can be chained - which means if auth middleware is not the first one on the list of middleware being registered, we need to use the `MiddlewareResponse` that gets passed to the middleware, instead of creating a new one. diff --git a/.changesets/10520.md b/.changesets/10520.md deleted file mode 100644 index d926d379c501..000000000000 --- a/.changesets/10520.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(eslint): Disable restricted $api imports for entryserver (#10520) by @dac09 - -With the introduction of middleware, it's pretty common to import things from the $api side. This is a non-issue as entry.server.{jsx,tsx} is not part of the client bundle we generate. diff --git a/.changesets/10522.md b/.changesets/10522.md deleted file mode 100644 index 84953f30fb31..000000000000 --- a/.changesets/10522.md +++ /dev/null @@ -1,21 +0,0 @@ -- feat(server-auth): Supabase web client implementation with middleware support (#10522) by @dac09 - -**Updates supabase auth client implementation to support middleware auth** - -In `web/src/auth.ts`: - -``` -// πŸ‘‡ notice where this is imported from! -import { createBrowserClient } from '@supabase/ssr' - -import { createAuth } from '@redwoodjs/auth-supabase-web' - -const supabaseClient = createBrowserClient( - process.env.SUPABASE_URL || '', - process.env.SUPABASE_KEY || '' -) - -export const { AuthProvider, useAuth } = createAuth(supabaseClient) -``` - -- moves some types, and getCurrentUserFromMiddleware function to a common place so it can be shared with multiple auth implementations diff --git a/.changesets/10529.md b/.changesets/10529.md deleted file mode 100644 index 3f7e9bdaca1f..000000000000 --- a/.changesets/10529.md +++ /dev/null @@ -1,5 +0,0 @@ -- chore(server-auth): Automagic middleware auth on supported providers (dbAuth so far) (#10529) by @dac09 - -This change means that we will automatically configure the dbAuth client in middleware mode, based on the redwood.toml flag. - -Also renames `useMiddlewareAuth` -> `middlewareAuthEnabled` diff --git a/.changesets/10531.md b/.changesets/10531.md deleted file mode 100644 index 2ff3328474f2..000000000000 --- a/.changesets/10531.md +++ /dev/null @@ -1,7 +0,0 @@ -- feat(server-auth): Refactor useReauthenticate to prevent double currentUser calls (#10531) by @dac09 - -…by calling getCurrentUser to determine if youre logged in. - -We achieve this by swapping the order in which getUserMetadata and getCurrentUser is called in reauthenticate. - -Previously getUserMetadata was a short-hand for checking if the auth SDK think its logged in, however in middleware auth this is an issue because you _need_ to getCurrentUser before getting user metadata in the case of purely cookie based auth like dbAuth (and potentially future ones like firebase, etc.) - since the cookie/token cannot be read on the browser. diff --git a/.changesets/10538.md b/.changesets/10538.md deleted file mode 100644 index 1991248970db..000000000000 --- a/.changesets/10538.md +++ /dev/null @@ -1,11 +0,0 @@ -- fix(serverauth): Export dbAuthMiddleware as default export to match supabase (#10538) by @dac09 - -An example: - -```js -//before -import { createDbAuthMiddleware } from '@redwoodjs/auth-dbauth-middleware' - -// after -import createDbAuthMiddleware from '@redwoodjs/auth-dbauth-middleware' -``` diff --git a/.changesets/10542.md b/.changesets/10542.md deleted file mode 100644 index 229f41e551e3..000000000000 --- a/.changesets/10542.md +++ /dev/null @@ -1,5 +0,0 @@ -- Rename og component assets from _.png.jsx to just_.og.jsx (#10542) by @cannikin - -We ran into a conflict where you could name your component file something like `AboutPage.png.jsx` (where the returned content-type would be image/png). But, when you invoke `useOgImage()` to actually create the URL for a `` tag, you could instead use a different extension, like `.jpg`. Which one should win? - -After discussion with @dac09 and @mojombo we decided that the extension returned by `useOgImage()` would be the correct one, and that the filename of the component itself should become generic and not imply any specific file format. diff --git a/.changesets/10550.md b/.changesets/10550.md deleted file mode 100644 index 133349b9d944..000000000000 --- a/.changesets/10550.md +++ /dev/null @@ -1 +0,0 @@ -- Adds a generator for creating og:image components (#10550) by @cannikin diff --git a/.changesets/10570.md b/.changesets/10570.md deleted file mode 100644 index 4226df248500..000000000000 --- a/.changesets/10570.md +++ /dev/null @@ -1,5 +0,0 @@ -- fix(functions-test): Fix mockHttpEvent for null bodies (#10570) by @Tobbe - -With an empty/null payload (which it is by default) the body should be empty, not the string `'null'` - -This is a breaking change for anyone who was depending on the current "null" behavior in their api function tests. More specifically, if you're **NOT** passing `body` or `payload` to `mockHttpEvent({ ... })` or if you're trying to explicitly set `payload` to `null` you might have to update your tests. diff --git a/.changesets/10572.md b/.changesets/10572.md deleted file mode 100644 index 6fbc3b7f2b84..000000000000 --- a/.changesets/10572.md +++ /dev/null @@ -1,15 +0,0 @@ -- feat: feat: Reworks RSC server entries and route manifest building to derive from routes and include if route info related to authentication (#10572) by @dthyresson - -This PR is in furtherance of authentication support in RSC. - -It refactors: - -- How server entries are built -- not from "processing the pages dir" (which is a deprecated function) but rather the routes ... and the page info for that route. Note here that a page can be used in multiple routes, so the auth info cannot really be determined here. - -- The route manifest building to include per route: - -* isPrivate - is the route private, i.e, is it wrapped in a PrivateSet -* unauthenticated - what route to navigate to if the user in not authenticated -* roles - the roles to check to see if user has the require RBAC permission to navigate to the route - -Now if some page, route request is being handled by RSC we might be able to check if it "isPrivate" and enforce auth with the roles and even where tp redirect to if not authenticated. diff --git a/.changesets/10573.md b/.changesets/10573.md deleted file mode 100644 index 694ddd83fa31..000000000000 --- a/.changesets/10573.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat: add customize content type parsers for api plugin (#10573) by @Josh-Walker-GM - -This change adds a new `configureApiServer` option to the `createServer` function used within the server file. This fixes an issue where it was not possible to configure the API server - such as adding custom content parsers or adding compression. Updated docs on how to use this new functionality can currently be found [here](https://redwoodjs.com/docs/canary/docker#using-the-server-file). diff --git a/.changesets/10585.md b/.changesets/10585.md deleted file mode 100644 index 22640b7ba67e..000000000000 --- a/.changesets/10585.md +++ /dev/null @@ -1,15 +0,0 @@ -- feat(rsc-auth): Implement serverStore to hold and pass req info to RSC (#10585) by @dac09 - -First pass at implementing a per-request store that allows: - -- access to headers and cookies from requests in server components -- access to serverAuthState from server components -- maps serverAuthState updated from middleware to the the per request store - -This PR also implements execution of middleware in the RSC handler. Note that this is done in a "good enough" way currently, because the RSC handler doesn't use Fetch requests (but everything else does) - -Important things to note: - -- the store is initialised _again_ in the RSC worker, with the same values on each invocation of renderRsc -- we have _not_ tested or tried in Dev because `rw dev` does not work in RSC yet -- we have _not_ tested behaviour on initial SSR - because this is not implemented yet in RSC diff --git a/.changesets/10586.md b/.changesets/10586.md deleted file mode 100644 index c2317e8fd1f5..000000000000 --- a/.changesets/10586.md +++ /dev/null @@ -1,28 +0,0 @@ -- feat(middleware): Add .shortCircuit to MiddlewareResponse (#10586) by @dac09 - -Adds a helper to generate a intercept/short-circuit response, that will interrupt execution of _all_ middleware and react rendering, and immediately return the response. - -There's a few different ways you can use this, see examples below: - -```ts -const shortCircuitMw: Middleware = (req, res) => { - // A) You can short circuit after building the response (or use the res param) - // This allows you to use all the convenience helpers like cookies of MW Response - if (req.url.includes('create-new-response')) { - const shortCircuitResponse = new MiddlewareResponse('Short-circuiting') - shortCircuitResponse.headers.set('shortCircuit', 'yes') - shortCircuitResponse.cookies.set('shortCircuitCookie', 'do-not-allow', { - expires: new Date(Date.now() + 1000 * 60 * 60), - }) - shortCircuitResponse.shortCircuit() - } - - // B) You can directly construct a new short-circuit response - // (discarding whatever response was built before) - if (req.url.includes('using-existing-res')) { - res.shortCircuit('Short-circuiting directly', { - headers: { shortCircuitDirect: 'yes' }, - }) - } -} -``` diff --git a/.changesets/10642.md b/.changesets/10642.md deleted file mode 100644 index 3d24d123a8b2..000000000000 --- a/.changesets/10642.md +++ /dev/null @@ -1,4 +0,0 @@ -- feat(auth-middleware): Return a Tuple with Route pattern configuration when creating dbAuth middleware (#10642) by @dac09 - -- This PR renames createDbAuthMiddleware -> initDbAuthMiddleware -- Returns a tuple of `[dbAuthMw, '*']` from the init function to make it harder to accidentally misconfigure the auth middleware diff --git a/.changesets/10643.md b/.changesets/10643.md deleted file mode 100644 index c29123616073..000000000000 --- a/.changesets/10643.md +++ /dev/null @@ -1,9 +0,0 @@ -- chore(serverAuth): Rename serverAuthContext to serverAuthState where relevant (#10643) by @dac09 - -**Why?** -As we make auth available on RSC, we want to avoid the use of the word "context" - -1. Because context is over used -2. It's confusing because RSCs don't support React.context - -This PR renames `serverAuthContext` -> `serverAuthState`. The only case it doesn't change it is the _actual_ ServerAuthContext which is a React context we use for SSR/Streaming diff --git a/.changesets/10656.md b/.changesets/10656.md deleted file mode 100644 index 89780e1a68cf..000000000000 --- a/.changesets/10656.md +++ /dev/null @@ -1,24 +0,0 @@ -- feat(rsc-auth): Implement getRoles function in auth mw & update default ServerAuthState (#10656) by @dac09 - -- Implement getRoles function in supabase and dbAuth middleware -- Updates default serverAuthState to contain roles -- Make cookieHeader a required attribute -- Introduces new `clear()` function to remove auth state - just syntax sugar - -## Example usage - -```tsx -// In entry.server.tsx -export const registerMiddleware = () => { - // This actually returns [dbAuthMiddleware, '*'] - const authMw = initDbAuthMiddleware({ - dbAuthHandler, - getCurrentUser, - getRoles: (decoded) => { - return decoded.currentUser.roles || [] - }, - }) - - return [authMw] -} -``` diff --git a/.changesets/10668.md b/.changesets/10668.md deleted file mode 100644 index 187acaad387f..000000000000 --- a/.changesets/10668.md +++ /dev/null @@ -1,12 +0,0 @@ -- fix(dbAuthMw): Update and fix logic related to dbAuth "verbs" and decryptionErrors (#10668) by @dac09 - -This PR does the following: - -- updates the dbauth mw to correctly handle the cookieName option (it should always have been optional) -- throws an error when the `dbAuthSession` returns an empty decoded token so that it clears the authState -- we had a check for only "POST" requests to be passed to the dbAuthHandler. This was incorrect because some of the dbAuth "verbs" or actions - like `webAuthnRegOptions` - uses a GET request. - -As a result, the tests started showing failures, so I: - -- added a mock for `dbAuthSession`, so we can check both happy path and unhappy paths for session decryption -- updated the tests where relevant diff --git a/.changesets/10677.md b/.changesets/10677.md deleted file mode 100644 index a62f180d5450..000000000000 --- a/.changesets/10677.md +++ /dev/null @@ -1,8 +0,0 @@ -- Adds `searchParams` option to `useOgImage()` hook for adding arbitrary query string vars to generated URL (#10677) by @cannikin - -This can be used like so: - -``` -const { url } = useOgImage({ searchParams: { foo: 'bar' }) -console.log(url) // => http://localhost:8910/photo.png?foo=bar -``` diff --git a/.changesets/10680.md b/.changesets/10680.md deleted file mode 100644 index 34aad4ebc011..000000000000 --- a/.changesets/10680.md +++ /dev/null @@ -1,85 +0,0 @@ -- chore: Adds pageIdentifier to route manifest (#10680) by @dthyresson - -This PR adds the `page_identifier_str` of `pageIdentifier` to the Route Manifest. - -Known what page belongs to the route can be useful to : - -- ensure if rendering a page/component that it belongs to the route and its auth permissions -- for visualizing routes -- general completeness in the manifest with the Routes jsx in manifest form - -## Example - -### Routes - -```jsx -const Routes = () => { - return ( - - - - - - - - - -``` - -### Manifest - -```json -{ - "/": { - "name": "home", - "bundle": null, - "matchRegexString": "^/$", - "pathDefinition": "/", - "hasParams": false, - "routeHooks": null, - "redirect": null, - "relativeFilePath": "pages/HomePage/HomePage.tsx", - "isPrivate": false, - "pageIdentifier": "HomePage" - }, - "/about": { - "name": "about", - "bundle": null, - "matchRegexString": "^/about$", - "pathDefinition": "/about", - "hasParams": false, - "routeHooks": null, - "redirect": null, - "relativeFilePath": "pages/AboutPage/AboutPage.tsx", - "isPrivate": false, - "pageIdentifier": "AboutPage" - }, - "/info": { - "name": "info", - "bundle": null, - "matchRegexString": "^/info$", - "pathDefinition": "/info", - "hasParams": false, - "routeHooks": null, - "redirect": null, - "relativeFilePath": "pages/AboutPage/AboutPage.tsx", - "isPrivate": true, - "unauthenticated": "home", - "roles": [ - "admin" - ], - "pageIdentifier": "AboutPage" - }, - "/multi-cell": { - "name": "multiCell", - "bundle": null, - "matchRegexString": "^/multi-cell$", - "pathDefinition": "/multi-cell", - "hasParams": false, - "routeHooks": null, - "redirect": null, - "relativeFilePath": "pages/MultiCellPage/MultiCellPage.tsx", - "isPrivate": false, - "pageIdentifier": "MultiCellPage" - }, -``` diff --git a/.changesets/10697.md b/.changesets/10697.md deleted file mode 100644 index 559b35e5c3c3..000000000000 --- a/.changesets/10697.md +++ /dev/null @@ -1,25 +0,0 @@ -- feat(serverStore): Add location to serverStore for RSCs to access location (#10697) by @dac09 - -1. Adds fullUrl property to serverStore -2. Adds two utility functions: - a) `getFullUrl` - to construct the absolute url from an express request - b) `getFullUrlFromFlightRequest` - this is used when we get a request to render RSCs in the rscRequestHandler. This one is different because the location we want is for the actual page, not of the request (which goes to to the RSC endpoint). -3. Adds `getLocation` function to retrieve the Location (URL object) from server store - -Short video demonstrating location coming through in two cases: -a) Soft renders (makes a request to the RSC endpoint) -b) Hard render - -https://s.tape.sh/4g7LFsYP - -**Usage example:** - -```tsx -import { getLocation } from '@redwoodjs/vite/serverStore' - -const NavigationLayout = ({ children, rnd }: NavigationLayoutProps) => { - const location = getLocation() - console.log(`πŸ‘‰ \n ~ location:`, location) -``` - -Longer term, we may want to change how the endpoint for flight requests so that the location doesn't have to be constructed specially. diff --git a/.changesets/10702.md b/.changesets/10702.md deleted file mode 100644 index e543463368b8..000000000000 --- a/.changesets/10702.md +++ /dev/null @@ -1,15 +0,0 @@ -- docs(docker): Clarify how to setup Docker with custom Server File (#10702) by @dthyresson - -Clarify how to setup Docker with custom Server File. - -While the Docker documentation does instruct how to user Docker with the custom server file, the instructions could be easily missed. - -In the follow support issue https://community.redwoodjs.com/t/unknown-directive-live-in-docker/7150/7 redwoodJS was setup to use Docker and also GraphQL with Realtime. - -Realtime (and live queries) worked with rw dev, api set and also Docker dev -- but not production Docker. - -In production Docker, the server file was never run and therefore the plugin to setup GraphQL with the useRedwoodRealtime plugin never happened ... and thus the live directive wasn't understood nor were GraphQL subscripts added to the schema. - -Here api server, simply ran the GraphQL function as expected, but the plugin was never invoked so Realtime was never configured or added to the schema. - -This happened because by default, production Docker launch the plain vanilla api server -- it didn't launch server file that uses `createServer` to setup a separate GraphQL server and also add in the realtime plugin. diff --git a/.changesets/10734.md b/.changesets/10734.md deleted file mode 100644 index c949c9d17ff7..000000000000 --- a/.changesets/10734.md +++ /dev/null @@ -1,5 +0,0 @@ -- chore(auth): add password validation to dbAuth resetPassword handler (#10734) by @irg1008 - -Related to #10724. This pull request adds password validation on resetPassword handler using the one from the signup handler. - -This could affect some users that "expect" no validation from this handler and some new errors and failed tests may be raised for them, but I think this feature is primary concerning security and to mantain validation logic between handlers diff --git a/.changesets/10739.md b/.changesets/10739.md deleted file mode 100644 index aebc770448f0..000000000000 --- a/.changesets/10739.md +++ /dev/null @@ -1,3 +0,0 @@ -- Updates seeds script to be more generic, no more errors throw on first run (#10739) by @cannikin - -Updated the template seed script to not contain any actual seed data, just comments about how to use it when the time comes. The first time you migrate the console message will point you to the file, and the file will point you to a new docs page which goes into much more detail on usage. diff --git a/.changesets/10761.md b/.changesets/10761.md deleted file mode 100644 index b04a7717c4f7..000000000000 --- a/.changesets/10761.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(cli): react compiler lint only setting (#10761) by @Josh-Walker-GM - -You can now add `lintOnly = true` within your `[experimental.reactCompiler]` TOML settings to enable the react compiler linting rules without the compiler itself enabled during code compilation. See [here](https://community.redwoodjs.com/t/react-compiler-setup-experimental/7128) for more details. diff --git a/.changesets/10768.md b/.changesets/10768.md deleted file mode 100644 index 294985a45d0b..000000000000 --- a/.changesets/10768.md +++ /dev/null @@ -1,5 +0,0 @@ -- Add Storybook Vite smoke tests (#10768) by @arimendelow - -Adds: - -- Unit tests for storybook-vite CLI (based on those from the dataMigrate CLI) diff --git a/.changesets/10788.md b/.changesets/10788.md deleted file mode 100644 index f4bf753f7a83..000000000000 --- a/.changesets/10788.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(dbauth): Combine react imports (#10788) by @Tobbe - -Clean up imports in `g dbAuth` templates diff --git a/.changesets/10791.md b/.changesets/10791.md deleted file mode 100644 index e7bc5589f119..000000000000 --- a/.changesets/10791.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(dbauth): Don't duplicate authDecoder creation (#10791) by @Tobbe - -Make it possible to run the dbAuth setup command more than once without getting invalid code diff --git a/.changesets/10793.md b/.changesets/10793.md deleted file mode 100644 index d4fc2a6e9f9d..000000000000 --- a/.changesets/10793.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(dbAuth): Only suggest dbAuth setup if needed (#10793) by @Tobbe - -Detect if dbAuth is already setup, and don't suggest setting it up if it is. diff --git a/.changesets/10811.md b/.changesets/10811.md deleted file mode 100644 index dd22acbb74cb..000000000000 --- a/.changesets/10811.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(dbauth): Fix spacing issue in task titles (#10811) by @Tobbe - -Fix double space issue in `yarn rw generate dbAuth` output diff --git a/.changesets/10813.md b/.changesets/10813.md deleted file mode 100644 index 03ac396f8c0b..000000000000 --- a/.changesets/10813.md +++ /dev/null @@ -1,5 +0,0 @@ -- fix(dbAuth): Print the correct "post message" after setup (#10813) by @Tobbe - -After running `yarn rw generate dbAuth` the correct message describing the -needed manual steps is now printed if the user choses to enable WebAuthn -support diff --git a/.changesets/10817.md b/.changesets/10817.md deleted file mode 100644 index 8617c77192c7..000000000000 --- a/.changesets/10817.md +++ /dev/null @@ -1,25 +0,0 @@ -fix(auth): Allows RedwoodAuthCurrentUserQuery when using Auth, GraphQL and Trusted Documents (#10817) by @dthyresson - -This PR allows authentication to function as expected when using Trusted Documents. - -See issue #10816 above for more detail. - -One way to solve is to allow an arbitrary ad-hoc query -- but just a very narrow and well-defined (aka trusted so-to-speak) one. - -The plgin for persisted operations lets one define what can bypass trusted docs hash id checks: https://the-guild.dev/graphql/yoga-server/docs/features/persisted-operations#allowing-arbitrary-graphql-operations - -So, we can use that in the useTrustedDocuments plugin to just allow that specific request. - -const REDWOOD**AUTH_GET_CURRENT_USER_QUERY = -'{"query":"query **REDWOOD\_\_AUTH_GET_CURRENT_USER { redwood { currentUser } }"}' -When using Redwood Auth, we want to allow the known, trusted redwood.currentUser query to be executed without a persisted operation. - -This is because the currentUser query is a special case that is used to get the current user from the auth provider. - -We'll check if the request is for the currentUser query and has the correct headers which are set by the useCurrentUser hook in the auth package. - -The usePersistedOperations plugin relies on this function to determine if a request should be allowed to execute via its allowArbitraryOperations option. - -By checking for that very exact string, and that there is a content type header, an auth-provider header and an authorization header then we can allow this to execute. - -The auth provider will still be used by the apes getCurrentUser resolver to determine if the credentials whatever they are are valid. diff --git a/.changesets/10825.md b/.changesets/10825.md deleted file mode 100644 index c5f527bf4c13..000000000000 --- a/.changesets/10825.md +++ /dev/null @@ -1,10 +0,0 @@ -- fix: Fixes support for Mocking GraphQL Queries in Storybook whene using GraphQL Fragments(#108125) by @dthyresson - -Fixes https://github.com/redwoodjs/redwood/issues/10807 - -If one used GraphQL fragments, when mocking the GraphQL query for use in Storybook, the `typename` for the data object must be included otherwise Apollo client cannot properly map the data. - -This PR - -- adds the typename to the cell generator templates -- updates the testing and graphql mock and fragments documentation to show how properly defines mock data diff --git a/.changesets/10827.md b/.changesets/10827.md deleted file mode 100644 index 01a3f635de79..000000000000 --- a/.changesets/10827.md +++ /dev/null @@ -1,9 +0,0 @@ -docs(directives): Removes outdated mockAsyncRedwoodDirective and explains how to test async directives (#10827) by @dthyresson - -Fixes #10812 - -This PR removes mockAsyncRedwoodDirective from documentation and properly show how to test async directives using resolves and rejects. - -History: - -mockAsyncRedwoodDirective was an early implementation but after PR review it was determined that a separate functions wasn't needed, but the resolves/rejects could be uses by making mockRedwoodDirective handle promises better. However, the documentation retained the older reference. diff --git a/.changesets/10830.md b/.changesets/10830.md deleted file mode 100644 index 906feae23a7b..000000000000 --- a/.changesets/10830.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(cli): Add check for excessively long route (#10830) by @Josh-Walker-GM - -This change adds an additional internal check to protect against route definitions which are preposterously long. diff --git a/.changesets/10833.md b/.changesets/10833.md deleted file mode 100644 index 08c80b8b931a..000000000000 --- a/.changesets/10833.md +++ /dev/null @@ -1,5 +0,0 @@ -- fix(deps): update dependency firebase-admin to v12 (#10833) by @renovate - -This change updates our firebase auth provider to use the v12 major version of the `firebase-admin` package. This will require you to update your own version of `firebase-admin` that is listed in your api side package json file. - -We have noticed no breaking api changes in our limited testing. Please consult the `firebase-admin` upgrade guide if you experience problems after upgrading - especially if you have more extensive or complex use of the firebase suite of products. diff --git a/.changesets/10849.md b/.changesets/10849.md deleted file mode 100644 index 7a9ef4b106af..000000000000 --- a/.changesets/10849.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(dbAuth): Prompt for creating User table (#10849) by @Tobbe - -To skip the prompt you can pass `--createUserModel` (or just `-u`) to `yarn rw setup auth dbAuth`. diff --git a/.changesets/10859.md b/.changesets/10859.md deleted file mode 100644 index 3abe49219198..000000000000 --- a/.changesets/10859.md +++ /dev/null @@ -1,3 +0,0 @@ -- remove(cli): Remove deprecated deploy providers (#10859) by @Josh-Walker-GM - -This change removes the deprecated deploy providers edgio and ~~serverless~~. Serverless has been restored and is available in v8. diff --git a/.changesets/10864.md b/.changesets/10864.md deleted file mode 100644 index bfb10d8748e0..000000000000 --- a/.changesets/10864.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(g dbAuth): Detect WebAuthn support (#10864) by @Tobbe - -Automatically add WebAuthn support to generated pages when WebAuthn is enabled for dbAuth diff --git a/.changesets/10865.md b/.changesets/10865.md deleted file mode 100644 index 0dc3fba1dcaa..000000000000 --- a/.changesets/10865.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(dbAuth): Prompt to generate dbAuth pages (#10865) by @Tobbe - -When setting up dbAuth we'll now prompt if the user also wants to generate pages for login, signup, password reset etc. We only prompt if no existing pages exist. diff --git a/.changesets/10867.md b/.changesets/10867.md deleted file mode 100644 index 6dcd0b7065fb..000000000000 --- a/.changesets/10867.md +++ /dev/null @@ -1,17 +0,0 @@ -- breaking: remove webpack (#10867) by @Josh-Walker-GM - -This PR removes support for webpack. There are a number of breaking changes associated with removing a core component of previous versions. A list of such changes is: - -1. `prebuildWebFile` is function no longer exported from `@redwoodjs/babel-config` package -2. `@redwoodjs/cli-storybook` has been removed -3. `yarn rw build` no longer accepts the `--stats` flag -4. `yarn rw dev` no longer accepts the `--watchNodeModules` flag -5. `yarn rw setup custom-web-index` command has been removed -6. `yarn rw setup webpack` has been removed -7. `@redwoodjs/core` no longer provides `@redwoodjs/core/config/*` files -8. The `web.bundler` TOML config option has been removed -9. `@redwoodjs/testing` no longer provides storybook config files -10. `@redwoodjs/testing` no longer provides a `StorybookProvider` -11. The `webpack` bin has been removed from `@redwoodjs/web` - -You can also find more information on the upgrade guide. diff --git a/.changesets/10869.md b/.changesets/10869.md deleted file mode 100644 index beac04684f9b..000000000000 --- a/.changesets/10869.md +++ /dev/null @@ -1,25 +0,0 @@ -feat(prisma): Support multi file Prisma schemas (#10869) by @dthyresson - -Prisma's `prismaSchemaFolder` [feature](https://www.prisma.io/docs/orm/prisma-schema/overview/location#multi-file-prisma-schema) allows you to define multiple files in a schema subdirectory of your prisma directory. - -This PR updates: - -- Prisma utilities -- generators -- dbAuth setup -- documentation - -to support single and multi file Prisma schemas. - -If you have enabled Prisma multi file schemas, you configure your project toml api `schemaPath` setting the directory where your schema.prisma can be found, for example: './api/db/schema' - -When [organizing your Prisma Schema into multiple files](https://www.prisma.io/blog/organize-your-prisma-schema-with-multi-file-support), you will need [enable](https://www.prisma.io/docs/orm/prisma-schema/overview/location#multi-file-prisma-schema) that feature in Prisma, move your `schema.prisma` file into a new directory such as `./api/db/schema` and then set `schemaPath` in the api toml config. -::: - -For example: - -```toml title="redwood.toml" -[api] - port = 8911 - schemaPath = "./api/db/schema" -``` diff --git a/.changesets/10871.md b/.changesets/10871.md deleted file mode 100644 index ea5ffe34d4f9..000000000000 --- a/.changesets/10871.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(dbAuth): Automatically create User model in fresh projects (#10871) by @Tobbe - -Automatically create a `User` model in the project's `schema.prisma` when setting up dbAuth in a new project. diff --git a/.changesets/10873.md b/.changesets/10873.md deleted file mode 100644 index c3512fa24d4d..000000000000 --- a/.changesets/10873.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(router): add router useBlocker hook (#10873) by @xmaxcooking - -Add `useBlocker()` hook to router to allow blocking navigation. Most commonly used to prevent users from accidentally leaving a page with unsaved changes. diff --git a/.changesets/10874.md b/.changesets/10874.md deleted file mode 100644 index 15f98bf72f36..000000000000 --- a/.changesets/10874.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(router): Navigate to splash page using routes.home() (#10874) by @Tobbe - -This PR makes it so that `routes.home()` works even when there's no actual `/` route in the `Routes.tsx` file if navigating to `/` would show the splash page. diff --git a/.changesets/10881.md b/.changesets/10881.md deleted file mode 100644 index 25de0e64da00..000000000000 --- a/.changesets/10881.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(tw): settings key should be "tailwindCSS.classAttributes" (#10881) by @Tobbe - -Fixes the VSCode settings for our TailwindCSS setup diff --git a/.changesets/10888.md b/.changesets/10888.md deleted file mode 100644 index 4a38e50a9410..000000000000 --- a/.changesets/10888.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(prerender): Fold output to prevent crashing on large prerender counts (#10888) by @Josh-Walker-GM - -This change alters the CLI output during prerendering to prevent crashes when prerendering a large number (>100,000) of routes. diff --git a/.changesets/10893.md b/.changesets/10893.md deleted file mode 100644 index c83381b21236..000000000000 --- a/.changesets/10893.md +++ /dev/null @@ -1,11 +0,0 @@ -fix(realtime/trusted-docs): Supports GraphQL subscriptions and trusted documents (#10893) by @dthyresson - -Fixes: https://github.com/redwoodjs/redwood/issues/10892 - -This PR updates the SSELink to check if there is a trusted document hash in the request. If there is, then don't also include the query. - -The persisted operations plugin checks if the params has a query. If it does then raises an error that only persisted operations are allowed. - -Subscriptions failed this test because the request had both the hash and a query. And since there were query details, the request was blocked. - -Now, if there is a hash, the SSELink won't add back the query and thus it succeeds. diff --git a/.changesets/10894.md b/.changesets/10894.md deleted file mode 100644 index 7ab04f310bde..000000000000 --- a/.changesets/10894.md +++ /dev/null @@ -1,34 +0,0 @@ -feat(trusted-docs): Allows useRedwoodTrustedDocuments to set more custom UsePersistedOperationsOptions (#10894) by @dthyresson - -Allows useRedwoodTrustedDocuments to set more custom UsePersistedOperationsOptions - -Allows the useRedwoodTrustedDocuments plugin to define: - -```ts - /** - * Whether to allow execution of arbitrary GraphQL operations aside from persisted operations. - */ - allowArbitraryOperations?: boolean | AllowArbitraryOperationsHandler; - /** - * The path to the persisted operation id - */ - extractPersistedOperationId?: ExtractPersistedOperationId; - - /** - * Whether to skip validation of the persisted operation - */ - skipDocumentValidation?: boolean; - - /** - * Custom errors to be thrown - */ - customErrors?: CustomPersistedQueryErrors; -``` - -This can let you override to allow certain ops or skip validation etc: - -> If you validate your persisted operations while building your store, we recommend to skip the validation on the server. So this will reduce the work done by the server and the latency of the requests. - -The allow authenticated request is still considered, but `allowArbitraryOperations` can override. - -Omitted `getPersistedOperation` as this extracts hash from store. diff --git a/.changesets/10900.md b/.changesets/10900.md deleted file mode 100644 index d2c810b34926..000000000000 --- a/.changesets/10900.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(Storybook Vite): Add JS project support (#10900) by @arimendelow - -This adds support to the SBV CLI for JS projects. diff --git a/.changesets/10910.md b/.changesets/10910.md deleted file mode 100644 index 1f12a3f9a0c5..000000000000 --- a/.changesets/10910.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(eslint-plugin): support flat config (#10910) by @JoshuaKGoldberg - -Makes it possible to use the eslint-plugin package in the "flat config" eslint configuration format. diff --git a/.changesets/10911.md b/.changesets/10911.md deleted file mode 100644 index b82c358dd9be..000000000000 --- a/.changesets/10911.md +++ /dev/null @@ -1,36 +0,0 @@ -- chore: brought in typescript-eslint@v8 with stylistic preset (#10911) by @JoshuaKGoldberg - -This change updates Redwood linting config and introduces some changes to the linting rules that are applied to your project. - -Specifically: - -1. `jsx-a11y/no-noninteractive-element-to-interactive-role` has it's default config updated. -2. `@typescript-eslint/explicit-function-return-type` used to be turned off, now it's no longer applied. -3. `@typescript-eslint/no-empty-interface` - used to be turned off, now it's no longer applied. -4. `@typescript-eslint/explicit-module-boundary-types` - used be turned off, now it's no longer applied. -5. `@typescript-eslint/ban-types` - used to be 'warn', now it's no longer applied. This has been replaces with a set of smaller more specific rules. -6. `no-empty-function` - used be turned off, now it's no longer applied. The ts-eslint flavour is still there and turned off still. -7. `camelcase` - used to be turned off, now it's 'warn'. -8. `@typescript-eslint/camelcase` - used to be turned off, now it's no longer applied. -9. `no-use-before-define` - used to be turned off, now it's no longer applied. -10. `@typescript-eslint/no-use-before-define` - used to be turned off, now it's no longer applied. -11. `@typescript-eslint/prefer-namespace-keyword` - used to be turned off, now it's 'error' -12. `unicode-bom` - used to be turned off, now it's no longer applied. -13. `@typescript-eslint/adjacent-overload-signatures` - used to be 'error', now it's no longer applied. -14. `@typescript-eslint/no-explicit-any` - used be 'warn', now 'error' -15. `@typescript-eslint/no-inferrable-types` - used to be 'error', now it's no longer applied. -16. `no-loss-of-precision` - used be 'off', now 'error' -17. `@typescript-eslint/no-loss-of-precision` - used be 'error', now it's no longer applied. -18. `@typescript-eslint/no-non-null-assertion` - used be 'warn', now it's no longer applied. -19. `valid-typeof` - used be either 'error' or 'off', now always 'error' -20. `no-unused-expressions` - used be always 'error', now either 'error' or 'off' -21. `@typescript-eslint/prefer-function-type` - newly added as 'off' -22. `@typescript-eslint/no-require-imports` - newly added as 'off' -23. `@typescript-eslint/no-empty-object-type` - newly added as 'off' -24. `unicorn/template-indent` - newly added as 'off' -25. `@typescript-eslint/no-duplicate-enum-values` - newly added as 'error' -26. `@typescript-eslint/no-unsafe-declaration-merging` - newly added as 'error' -27. `@typescript-eslint/no-unsafe-function-type` - newly added as 'error' -28. `@typescript-eslint/no-unused-expressions` - newly added as 'error' -29. `@typescript-eslint/no-wrapper-object-types` - newly added as 'error' -30. `no-new-native-nonconstructor` - newly added as 'off' diff --git a/.changesets/10922.md b/.changesets/10922.md deleted file mode 100644 index d9cba8d33800..000000000000 --- a/.changesets/10922.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(baremetal): Check for setup before running deploy (#10922) by @Tobbe - -Print a helpful error message if baremetal has not been setup before running `yarn rw deploy baremetal`. diff --git a/.changesets/10939.md b/.changesets/10939.md deleted file mode 100644 index 571972ef9be6..000000000000 --- a/.changesets/10939.md +++ /dev/null @@ -1,6 +0,0 @@ -- feat(colors): Add more chalk colors. And prepare for chalk upgrade (#10939) by @Tobbe - -Add more colors to `@redwoodjs/cli-helpers`. - -Breaking: No longer exporting `green` as a color. Use `tip` or `success` -instead depending on what you want to convey. diff --git a/.changesets/10961.md b/.changesets/10961.md deleted file mode 100644 index ee75c7843a56..000000000000 --- a/.changesets/10961.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(storybook): Fix import issues with storybook vite (#10961) by @Josh-Walker-GM - -Fixes an issue with the `yarn rw storybook-vite` command where it would not start due to an import issue. diff --git a/.changesets/11058.md b/.changesets/11058.md deleted file mode 100644 index 256f0b7463e4..000000000000 --- a/.changesets/11058.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(link): Pass options to navigate() (#11058) by @Tobbe - -Allow passing `NavigateOptions` (which for now is just `replace`) from a `` and `` to `navigate()` by setting an `options` prop on the link component. diff --git a/.changesets/11062.md b/.changesets/11062.md deleted file mode 100644 index a2e51acf7bf6..000000000000 --- a/.changesets/11062.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(router): Add check for excessively long path (#11062) by @Josh-Walker-GM - -This change adds an additional internal check to protect against route paths which are excessively long. diff --git a/.changesets/11068.md b/.changesets/11068.md deleted file mode 100644 index 5b6f46aacdeb..000000000000 --- a/.changesets/11068.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(cli): restore serverless deploy (#11068) by @Josh-Walker-GM - -Serverless deployment is deprecated and was removed in #10859. This PR restores this for now until we can provide a better alternative to users. diff --git a/.changesets/11069.md b/.changesets/11069.md deleted file mode 100644 index 46e84e0b3c04..000000000000 --- a/.changesets/11069.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(storybook): switch command for storybook vite (#11069) by @Josh-Walker-GM - -This change moves the vite based storybook to the standard storybook command. Essentially making it the default storybook command. diff --git a/.changesets/11072.md b/.changesets/11072.md deleted file mode 100644 index 5c3a91845806..000000000000 --- a/.changesets/11072.md +++ /dev/null @@ -1,3 +0,0 @@ -- feat(cli): Move docker setup out of experimental (#11072) by @Josh-Walker-GM - -This change introduces `yarn rw setup docker`. This is a result of moving our docker setup command out of it's experimental phase. diff --git a/.changesets/11108.md b/.changesets/11108.md deleted file mode 100644 index 8fe7cd0208af..000000000000 --- a/.changesets/11108.md +++ /dev/null @@ -1,25 +0,0 @@ -- feat(testing): Configure jest to ignore sidecar files in **tests** folder (#11108) by @V1shvesh - -Solves for #10870 - -### Description: - -`./api` directory structure: -image -`./web` directory structure: -image - -Before: - -`yarn rw test api`: -image - -`yarn rw test web`: -image - -After: -`yarn rw test api`: -image - -`yarn rw test web`: -image diff --git a/.changesets/11109.md b/.changesets/11109.md deleted file mode 100644 index 860cf6226eb8..000000000000 --- a/.changesets/11109.md +++ /dev/null @@ -1,14 +0,0 @@ -(Delete this help paragraph when you're done.) Thanks for writing a changeset! Here's a place to start. -Don't edit the title, but in editing the body, try to explain what this PR means for Redwood users. -The more detail the better. E.g., is it a new feature? How do they use it? Code examples go a long way! - -- fix: concurrent api builds (#11109) by @callingmedic911 - -A few users [reported](https://community.redwoodjs.com/t/redwood-v7-0-0-upgrade-guide/5713/90?u=callingmedic911) that the API server crashes with the error `EADDRINUSE` when switching between branches. This issue happens on the API side when: - -1. New files are added or existing files are removed. -2. Immediately after, an existing file is changed. - -This scenario is common when doing git operations like switching branches or using git stash, where these changes occur simultaneously. When this happens, step 1 triggers a full build (without esbuild's rebuild), and step 2, without canceling the build from step 1, triggers a separate `rebuild`. This results in concurrent builds and two instances of the API server trying to start. - -This PR provides a quick fix for the issue. A follow-up PR will be created to refactor the process, aiming to avoid separate build processes altogether, ensure a cleaner separation between the build and the server, and improve overall readability. diff --git a/.changesets/11131.md b/.changesets/11131.md deleted file mode 100644 index 0d6afbe128e7..000000000000 --- a/.changesets/11131.md +++ /dev/null @@ -1,4 +0,0 @@ -- feature(studio): Make studioHandler install Studio v12 (#11131) by @Tobbe - -Makes sure you get the latest version of Redwood Studio the first time you run -`yarn rw studio` diff --git a/.changesets/11135.md b/.changesets/11135.md deleted file mode 100644 index afb073672f46..000000000000 --- a/.changesets/11135.md +++ /dev/null @@ -1,11 +0,0 @@ -- fix(cli-cache): Remove RW CLI cache on upgrade (#11135) by @dac09 - -This change removes the redwood cli plugin cache in `.redwood/commandCache.json` on running `rw upgrade`. - -This prevents the redwood CLI from using outdated versions of CLI plugins, and is particularly important when they same alias. - -**Before** -running `yarn rw sb` -> would use the outdated storybook-cli package, and error out. - -**After** -with no commandCache, it'll create a new command cache, and attempt to install the new vite CLI diff --git a/.changesets/11154.md b/.changesets/11154.md deleted file mode 100644 index 920a5b7ae784..000000000000 --- a/.changesets/11154.md +++ /dev/null @@ -1,124 +0,0 @@ -- feat(rw-uploads): Create uploads package with prisma extension and upload processor (#11154) by @dac09 - -Introduces `@redwoodjs/uploads` package which houses - -- Prisma extension for handling uploads. Currently - a) Query Extension: will save, delete, replace files on disk during CRUD - b) Result Extension: gives you functions like `.withSignedUri` on configured prisma results - which will take the paths, and convert it to a signed url -- Storage adapters e.g. FS and Memory to use with the prisma extension -- Processors - i.e. utility functions which will take [`Files`](https://developer.mozilla.org/en-US/docs/Web/API/File) and save them to storage - -## Usage - -In `api/src/uploads.ts` - setup uploads - processors, storage and the prisma extension. - -```ts -// api/src/lib/uploads.ts - -import { UploadsConfig } from '@redwoodjs/uploads' -import { setupUploads } from '@redwoodjs/uploads' -import { FileSystemStorage } from '@redwoodjs/uploads/FileSystemStorage' -import { UrlSigner } from '@redwoodjs/uploads/signedUrl' - -const uploadConfig: UploadsConfig = { - // πŸ‘‡ prisma model - profile: { - // πŸ‘‡ pass in fields that are going to be File uploads - // these should be configured as string in the Prisma.schema - fields: ['avatar', 'coverPhoto'], - }, -} - -// πŸ‘‡ exporting these allows you access elsewhere on the api side -export const storage = new FileSystemStorage({ - baseDir: './uploads', -}) - -// Optional -export const urlSigner = new UrlSigner({ - secret: process.env.UPLOADS_SECRET, - endpoint: '/signedUrl', -}) - -const { uploadsProcessors, prismaExtension, fileListProcessor } = setupUploads( - uploadConfig, - storage, - urlSigner, -) - -export { uploadsProcessors, prismaExtension, fileListProcessor } -``` - -### Configuring db to use the prisma extension - -```ts -// api/src/lib/db.ts - -import { PrismaClient } from '@prisma/client' - -import { emitLogLevels, handlePrismaLogging } from '@redwoodjs/api/logger' - -import { logger } from './logger' -import { prismaExtension } from './uploads' - -// πŸ‘‡ Notice here we create prisma client, and don't export it yet -export const prismaClient = new PrismaClient({ - log: emitLogLevels(['info', 'warn', 'error']), -}) - -handlePrismaLogging({ - db: prismaClient, - logger, - logLevels: ['info', 'warn', 'error'], -}) - -// πŸ‘‡ Export db after adding uploads extension -export const db = prismaClient.$extends(prismaExtension) -``` - -## Using Prisma extension - -### A) CRUD operations - -No need to do anything here, but you have to use processors to supply Prisma with data in the correct format. - -### B) Result extensions - -```ts -// api/src/services/profiles/profiles.ts - -export const profile: QueryResolvers['profile'] = async ({ id }) => { - // πŸ‘‡ await the result from your prisma query - const profile = await db.profile.findUnique({ - where: { id }, - }) - - // Convert the avatar and coverPhoto fields to signed URLs - // Note that you still need to add a api endpoint to handle these signed urls - return profile?.withSignedUrl() -} -``` - -## Using processors - -In your services, you can use the preconfigured "processors" to convert Files to strings for Prisma to save into the database. The processors, and storage adapters determine where the file is saved. - -```ts -// api/src/services/profiles/profiles.ts - -export const updateProfile: MutationResolvers['updateProfile'] = async ({ - id, - input, -}) => { - const processedInput = await uploadsProcessors.processProfileUploads(input) - - // This becomes a string πŸ‘‡ - // The configuration on where it was saved is passed when we setup uploads in src/lib/uploads.ts - // processedInput.avatar = '/mySavePath/profile/avatar/generatedId.jpg' - - return db.profile.update({ - data: processedInput, - where: { id }, - }) -} -``` diff --git a/.changesets/11170.md b/.changesets/11170.md deleted file mode 100644 index 3fd0e84e161e..000000000000 --- a/.changesets/11170.md +++ /dev/null @@ -1,11 +0,0 @@ -- fix: Update default tsconfig options (target, module and moduleResolution) (#11170) by @Josh-Walker-GM - -This changes the default values of: - -- target -- module -- moduleResolution - -in the tsconfig files for both the API and web side. The benefit of this change is increased correctness for build time checking of the imports from packages which specify `exports` in their `package.json` files. - -This change will have a limited effect while Redwood apps are still built to CJS rather than ESM. After that switch to ESM there would be more breaking changes but they are not applied here and are a future concern. diff --git a/.changesets/11175.md b/.changesets/11175.md deleted file mode 100644 index 96c11ffbc650..000000000000 --- a/.changesets/11175.md +++ /dev/null @@ -1,17 +0,0 @@ -- feat(uploads): Configure apollo client to do multi-part form uploads (#11175) by @dac09 - -a) Configures the Apollo client we export to use upload link - https://github.com/jaydenseric/apollo-upload-client -b) Configures our API side fastify server to accept multipart form data - -Notes: - -1. apollo-upload-client is ESM only. In order to get this working for prerender, I had to bundle it for CJS version only. - Without this change you get errors during prerender like this: - -``` -Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/dac09/Experiments/apollo-upload-link/node_modules/apollo-upload-client/createUploadLink.mjs not supported. -``` - -2. Currently the multi-part config only applies when you have a server file (see separate PR with fix: https://github.com/redwoodjs/redwood/pull/11176) - -3. The upload link internally will handle whether to do a regular POST or multipart POST. In order to make use of this on the backend you need to set your graphql schema field to a scalar of `File` diff --git a/.changesets/11176.md b/.changesets/11176.md deleted file mode 100644 index f3f5924e0050..000000000000 --- a/.changesets/11176.md +++ /dev/null @@ -1,6 +0,0 @@ -- fix(api-server): Use createServer in all cases, to make fastify config consistent (#11176) by @dac09 - -[BREAKING] Removes serverConfig support, in favour of server file to configure your Fastify instance. -You can still customise your server settings by running `yarn rw setup server-file` first. See docs for [Server File](https://docs.redwoodjs.com/docs/docker/#using-the-server-file) - -This PR removes all the cases where we use `createFastifyInstance` for the api server, and replaces it with `createServer`. This makes sure that the API server config is always consistent - whether you use a server file or not. diff --git a/.changesets/11189.md b/.changesets/11189.md deleted file mode 100644 index f5ee9ad36933..000000000000 --- a/.changesets/11189.md +++ /dev/null @@ -1,12 +0,0 @@ -- fix(babel-plugins): Handle additional syntax when extracting graphql options (#11189) by @Josh-Walker-GM - -This fixes an issue with the automatic extraction of options from the `createGraphQLHandler` function when you were wrapping that function within a custom handler function. For example the following would have failed before this fix: - -```ts -const graphQLHandler = createGraphQLHandler({ - // ...options -}) -export const handler = (event, context) => { - return graphQLHandler(event, context) -} -``` diff --git a/.changesets/11238.md b/.changesets/11238.md deleted file mode 100644 index 397b61166158..000000000000 --- a/.changesets/11238.md +++ /dev/null @@ -1,14 +0,0 @@ -- Adds background job scheduling and execution (#10906) by @cannikin - -This new package provides scheduling and processing of background jobs. We want everything needed to run a modern web application to be included in Redwood itselfβ€”you shouldn't need any third party integrations if you don't want. - -Background jobs have been sorely missed, but the time has come! (If you do want to use a third party service we have had an [integration with Inngest](https://community.redwoodjs.com/t/ship-background-jobs-crons-webhooks-and-reliable-workflows-in-record-time-with-inngest-and-redwoodjs/4866) since May of 2023!) - -## Features - -- Named queues: you can schedule jobs in separate named queues and have a different number of workers monitoring each oneβ€”makes it much easier to scale your background processing -- Priority: give your jobs a priority from 1 (highest) to 100 (lowest). Workers will sort available jobs by priority, working the most important ones first. -- Configurable delay: run your job as soon as possible (default), wait a number of seconds before running, or run at a specific time in the future -- Auto-retries with backoff: if your job fails it will back off at the rate of attempts \*\* 4 for a default of 24 tries, the time between the last two attempts is a little over three days. -- Run inline: instead of scheduling to run in the background, run immediately -- Integrates with Redwood's [logger](https://docs.redwoodjs.com/docs/logger): use your existing one in api/src/lib/logger or create a new one just for job logging diff --git a/.changesets/11250.md b/.changesets/11250.md deleted file mode 100644 index ae78b6e9abad..000000000000 --- a/.changesets/11250.md +++ /dev/null @@ -1,7 +0,0 @@ -- fix(cli): Service generator supports relations (#11250) by @dthyresson - -This PR address an issue when using `yarn rw g service` independently vs having ti be called by `yarn rw g sdl` or `yarn rw g scaffold`. - -When using `yarn rw g service`, the model's relations were not correctly determined. For the sdl generator, relations are determined and then passed as an argument to the service generator; however, if you run just the service generator, the relations were always `[]`. - -This PR fixes that by adding a check to see if the relations are already passed in as an argument. If they are, it uses that; otherwise, it falls back to determining the relations itself. diff --git a/.changesets/11262.md b/.changesets/11262.md deleted file mode 100644 index 70d00a9d4c0c..000000000000 --- a/.changesets/11262.md +++ /dev/null @@ -1,4 +0,0 @@ -- fix(exec): Include nested scripts in --list (#11262) by @Tobbe - -Now also nested scripts, like `scripts/nested/script.ts`, are included in the -output of `yarn rw exec --list` diff --git a/.changesets/11278.md b/.changesets/11278.md deleted file mode 100644 index 891d5b90c13d..000000000000 --- a/.changesets/11278.md +++ /dev/null @@ -1,8 +0,0 @@ -- feat(exec): Add --silent to silence all RW output (#11278) by @Tobbe - -Run with `--silent` (or `-s`) to not have the framework itself print anything to -your console. Only console logs you have yourself in the script, or any files -the script includes, will come through. - -If you're using Prisma you might want to tweak Prisma's logging (in -`api/lib/db.ts`) and turn off "info" logging, depending on your goals. diff --git a/.changesets/11307.md b/.changesets/11307.md deleted file mode 100644 index c45f540bd004..000000000000 --- a/.changesets/11307.md +++ /dev/null @@ -1,3 +0,0 @@ -- refactor(api): Add conditional exports to package.json (#11307) by @Josh-Walker-GM - -This change restricts the available imports from this package. You can no longer freely import from within the dist like `@redwoodjs/api/dist/...`. If you were doing so please consult the `@redwoodjs/api` `package.json` file to see what exports are now available. diff --git a/.changesets/11337.md b/.changesets/11337.md deleted file mode 100644 index 04ac9939bd34..000000000000 --- a/.changesets/11337.md +++ /dev/null @@ -1,3 +0,0 @@ -- refactor(prerender): build with esbuild and introduce conditional exports (#11337) by @Josh-Walker-GM - -This change restricts the available imports from the `@redwoodjs/prerender` package. You will also have to use modern `moduleResolution` settings in your tsconfig to resolve the imports correctly within TS. diff --git a/.changesets/11338.md b/.changesets/11338.md deleted file mode 100644 index 1ccc0a64da75..000000000000 --- a/.changesets/11338.md +++ /dev/null @@ -1,3 +0,0 @@ -- refactor(forms): Build with esbuild and add conditional exports (#11338) by @Josh-Walker-GM - -This change introduces restrictions on what can be imported from the `@redwoodjs/forms` package. You can no longer import from `@redwoodjs/forms/dist/...`. All imports should be available simply from `@redwoodjs/forms`. diff --git a/.changesets/11366.md b/.changesets/11366.md deleted file mode 100644 index 67823a06c613..000000000000 --- a/.changesets/11366.md +++ /dev/null @@ -1,5 +0,0 @@ -- fix(template): Set scripts/ module resolution to match api/ (#11366) by @Tobbe - -Make the module resolution for `scripts/` be more predictable/stable, and match that of `api/` - -See also https://github.com/redwoodjs/redwood/pull/11170 diff --git a/.changesets/11367.md b/.changesets/11367.md deleted file mode 100644 index 03ca00108e38..000000000000 --- a/.changesets/11367.md +++ /dev/null @@ -1,6 +0,0 @@ -- fix(template): api type declaration merging for scripts (#11367) by @Tobbe - -Make imports in scripts (files in `scripts/`) find our mirror types used for declaration merging also for `api/src/` imports (not just web imports) - -Users upgrading are adviced to manually upgrade their tsconfig files to match -what is now in the template. diff --git a/.changesets/11375.md b/.changesets/11375.md deleted file mode 100644 index 6b4c3a7d5c5b..000000000000 --- a/.changesets/11375.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix: Use sse link with `@live` directive (#11375) by @callingmedic911 - -Use SSE links that allows proper headers that in turn show proper requests with the body in browser devtools. diff --git a/.changesets/11378.md b/.changesets/11378.md deleted file mode 100644 index 3ad3844ecf17..000000000000 --- a/.changesets/11378.md +++ /dev/null @@ -1,5 +0,0 @@ -- feat(uploads): Add File scalar to rootSchema (#11378) by @dac09 - -Adds `File` scalar to rootSchema, to enable parsing fields set to File as a https://developer.mozilla.org/en-US/docs/Web/API/File - -The parsing and scalar is actually built in to GraphQL Yoga, this change just enables it by default instead of having to add `scalar File` to one or more of your SDLs. diff --git a/.changesets/11379.md b/.changesets/11379.md deleted file mode 100644 index 907eb0e04ded..000000000000 --- a/.changesets/11379.md +++ /dev/null @@ -1,29 +0,0 @@ -- template(db): Update `api/src/lib/db` template (#11379) by @dac09 - -Updates the template in `api/src/lib/db.{js,ts}` to export `db` differently. - -In your existing projects, you can make the following changes: - -```diff - -import { PrismaClient } from '@prisma/client' - -import { emitLogLevels, handlePrismaLogging } from '@redwoodjs/api/logger' - -import { logger } from './logger' -import { prismaExtension } from './uploads' - -- export const db = new PrismaClient({ -+ const prismaClient = new PrismaClient({ - log: emitLogLevels(['info', 'warn', 'error']), -}) - -handlePrismaLogging({ -- db -+ db: prismaClient, - logger, - logLevels: ['info', 'warn', 'error'], -}) - -+ export const db = prismaClient -``` diff --git a/.changesets/11383.md b/.changesets/11383.md deleted file mode 100644 index c8c68a1c0766..000000000000 --- a/.changesets/11383.md +++ /dev/null @@ -1,3 +0,0 @@ -- few Flightcontrol template & doc updates (#11383) by @flybayer - -Updates the flight control deployment command and documentation. Corrects issue #10754 which is to do with an outdated database setup. diff --git a/.changesets/11390.md b/.changesets/11390.md deleted file mode 100644 index 0bb0f41e215d..000000000000 --- a/.changesets/11390.md +++ /dev/null @@ -1,9 +0,0 @@ -- feat(storage): Add support for createMany, updateMany and upsert (#11390) by @dac09 - -Extends the uploads Prisma client extension with the following: - -1. `createMany`: support for bulk creation with automatic cleanup of uploaded files if the operation fails. - -2. `updateMany`: bulk update functionality that manages file uploads across multiple records, including removal of old files after successful updates. - -3. `upsert`: determining whether it's an insert or update and managing file uploads accordingly - delete files on creation fail, and replace files on update diff --git a/.changesets/11406.md b/.changesets/11406.md deleted file mode 100644 index 44ca9b1f8a9b..000000000000 --- a/.changesets/11406.md +++ /dev/null @@ -1,7 +0,0 @@ -- feat(rsc): Initial support for RSA rerender (#11406) by @Tobbe - -This PR makes it so that the entire page is re-rendered when a React Server Action returns. -Previously when calling an RSA you'd only get the result of the action back. -Now, when calling an RSA you'll still get the result back, and in addition to that the page will update. -What this means is that if you for example update a counter on the server that a server component is displaying that counter will now immediately update. -Also, if some data has been updated by something external to the app the new data will be displayed (like if someone used an external CMS to update some .md file you're rendering) diff --git a/.changesets/11411.md b/.changesets/11411.md deleted file mode 100644 index 88142b5dc0d2..000000000000 --- a/.changesets/11411.md +++ /dev/null @@ -1,38 +0,0 @@ -- chore(uploads): Reorganise, change uploads package to storage (#11411) by @dac09 - -This PR does the following: - -- renames `@redwoodjs/uploads` -> `@redwoodjs/storage` -- Renames `processors` -> `savers` - -They now look like this: - -```ts -// reads much nicer βœ… -const processedInput = await saveFiles.forProfile(input) - -// avatar is a File becomes a string -// processedInput.avatar = -// '/basePath/uploads/profile-avatar-01J6ACDPWAER8B1SAXPKQK5YA1.png' - -const profile = await db.profile.update({ - data: processedInput, - where: { id }, -}) -``` - -even though when you export it, it looks weird - -```ts -// api/src/lib/uploads.ts -const { saveFiles, storagePrismaExtension } = setupStorage({ - //... -}) - -export { saveFiles, storagePrismaExtension } -``` - -The naming convention is: -`for` - takes inputs in the shape of a Prisma data for that model but with Files instead of strings. The files get saved to storage, and a key/path is replaced in the value. - -`inList` - does the same, but only takes an array of File, and returns an array of stored paths/keys diff --git a/.changesets/11412.md b/.changesets/11412.md deleted file mode 100644 index 3dad0b04344c..000000000000 --- a/.changesets/11412.md +++ /dev/null @@ -1,15 +0,0 @@ -- feat(uploads): Increase default fastify body limit to 100MB (#11412) by @dac09 - -Increases the default limit for receiving requests to 100MB (instead of 15MB). This number is arbitrary really, but it is the TOTAL size of the request, not of each file being uploaded. - -The user can override this in their server file. - -```jsx -// api/server.js -const server = await createServer({ - logger, - fastifyServerOptions: { - bodyLimit: 1048576 * 2, // 2 MiB - }, -}) -``` diff --git a/.changesets/11414.md b/.changesets/11414.md deleted file mode 100644 index 290760d0709f..000000000000 --- a/.changesets/11414.md +++ /dev/null @@ -1,3 +0,0 @@ -- fix(cli-helpers): Don't add spaces around `=` for env vars (#11414) by @Tobbe - -The `addEnvVar` helper function in `packages/cli-helpers` no longer adds spaces around `=` when setting environment variables. diff --git a/.changesets/8556.md b/.changesets/8556.md deleted file mode 100644 index 51c751ee3eef..000000000000 --- a/.changesets/8556.md +++ /dev/null @@ -1,22 +0,0 @@ -- feat(codegen): support sdl generation for model with compound id (#8556) by @russell-dot-js - -The SDL generator will no longer error when handling a table with a composite id, like so: - -```prisma -model Order { - tenantId String - id String @unique @default(uuid()) - @@id([tenantId, id]) -} -``` - -It will now generate code in the SDL that handles input of both these variables: - -```gql -input TempIdInput { - tenantId: String! - id: String! -} -``` - -If you are using a custom `sdl.{j,t}s.template` then you may have to update it to support the new `idInput`. diff --git a/.changesets/9366.md b/.changesets/9366.md deleted file mode 100644 index 6bf399594e2a..000000000000 --- a/.changesets/9366.md +++ /dev/null @@ -1,3 +0,0 @@ -- πŸ“ Added page for using GitPod to the documentation (#9366) by @ahaywood - -This introduces new documentation to make getting started with redwood using GitPod easy! diff --git a/.changesets/9848.md b/.changesets/9848.md deleted file mode 100644 index 03ce8329ef77..000000000000 --- a/.changesets/9848.md +++ /dev/null @@ -1,3 +0,0 @@ -- Detect/resolve ambiguous script names (#9848) by @codersmith - -Detects and resolves ambiguous script name combinations like `[foo.js, foo.ts]` or `[foo.ts, foo.json]` when running `yarn rw exec foo`. diff --git a/.changesets/young-spiders-ring.md b/.changesets/young-spiders-ring.md deleted file mode 100644 index 4b9212d8ccee..000000000000 --- a/.changesets/young-spiders-ring.md +++ /dev/null @@ -1,5 +0,0 @@ -- PR title (#PR number) by @PR author - -fix: Fixes Unknown Fragment issues due to GraphQL Tag type mismatch in web (#10357) by @dthyresson - -Users reported in #10322 an incompatibility with fragments and when using gql from global web. The TS errors were caused by the global web gql type not being compatible with the standard graphql-tag type.