@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.
- package/README.md +10 -1
- 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
|
-
|
|
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