Skip to content

Commit 03e2f40

Browse files
committed
fix: replace usedatafunctionreturn with serializefrom as per remix 1.7.0
1 parent b5f2779 commit 03e2f40

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ First, you have to install the package itself:
2121
yarn add -D remix-docs-gen
2222
```
2323

24+
> Note that you need @remix-run/server-runtime to be at least ^1.7.0.
25+
2426
## Usage Example
2527

2628
You can simply run:

packages/remix-docs-gen/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# remix-docs-gen
22

3+
## 0.1.3
4+
5+
### Patch Changes
6+
7+
- Replace UseDataFunctionReturn with SerializeFrom as per Remix 1.7.0.
8+
39
## 0.1.2
410

511
### Patch Changes

packages/remix-docs-gen/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "remix-docs-gen",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"license": "MIT",
@@ -33,6 +33,6 @@
3333
"config": "*"
3434
},
3535
"peerDependencies": {
36-
"@remix-run/dev": "^1.0.3"
36+
"@remix-run/dev": "^1.7.0"
3737
}
3838
}

packages/remix-docs-gen/src/docs.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ const parseDataFunctionOutput = (
8484

8585
const typeName = `__RESERVED_${dataFunctionName}_RETURN_TYPE_${timestamp}`;
8686

87-
const dataFunctionReturnTypeName = `__RESERVED_USE_DATA_FUNCTION_RETURN_${timestamp}`;
87+
const serializeFromTypeName = `__RESERVED_SERIALIZE_FROM_${timestamp}`;
8888

8989
sourceFile
9090
.replaceWithText(
91-
`import { UseDataFunctionReturn as ${dataFunctionReturnTypeName} } from "@remix-run/react/dist/components";
91+
`import type { SerializeFrom as ${serializeFromTypeName} } from "@remix-run/server-runtime";
9292
${sourceFile.getFullText()}
9393
94-
type ${typeName} = ${dataFunctionReturnTypeName}<typeof ${dataFunctionName}>;
94+
type ${typeName} = ${serializeFromTypeName}<typeof ${dataFunctionName}>;
9595
`
9696
)
9797
.getFullText();

0 commit comments

Comments
 (0)