@willyim/idp 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +10 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -82,9 +82,18 @@ return requestHandler(request, {
82
82
  ```ts
83
83
  import { createAuthRoute } from "@willyim/idp/react-router"
84
84
 
85
- export const { loader, action } = createAuthRoute(({ context }) => context.idp)
85
+ const authRoute = createAuthRoute(({ context }) => context.idp)
86
+
87
+ export const loader = authRoute.loader
88
+ export const action = authRoute.action
86
89
  ```
87
90
 
91
+ Export the two handlers separately rather than destructuring in the `export`
92
+ statement. `export const { loader, action } = …` works in dev but fails the
93
+ production build — react-router's route-exports plugin strips server-only
94
+ exports from the client bundle and cannot remove a destructured one
95
+ ("Cannot remove destructured export").
96
+
88
97
  Then guard whatever needs guarding:
89
98
 
90
99
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willyim/idp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Login for apps that don't own identity — OIDC client, server sessions, and react-router guards against the willy.im IdP",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",