File tree Expand file tree Collapse file tree 3 files changed +26
-9
lines changed
test/pages/already wrapped gSSP and component Expand file tree Collapse file tree 3 files changed +26
-9
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import {
12
12
isClassDeclaration ,
13
13
isExportDefaultDeclaration ,
14
14
isFunctionDeclaration ,
15
- isFunctionExpression ,
16
15
isIdentifier ,
17
16
isVariableDeclaration ,
18
17
stringLiteral ,
@@ -119,14 +118,6 @@ function wrapExportDefaultDeclaration(path: NodePath<any>) {
119
118
120
119
const { node } = path ;
121
120
122
- if ( isIdentifier ( node . declaration ) ) {
123
- node . declaration = wrapInHOC ( node . declaration ) ;
124
- }
125
-
126
- if ( isFunctionExpression ( node . declaration ) ) {
127
- node . declaration = wrapInHOC ( node . declaration ) ;
128
- }
129
-
130
121
if (
131
122
isFunctionDeclaration ( node . declaration ) ||
132
123
isClassDeclaration ( node . declaration )
@@ -145,6 +136,8 @@ function wrapExportDefaultDeclaration(path: NodePath<any>) {
145
136
) ;
146
137
}
147
138
}
139
+ } else {
140
+ node . declaration = wrapInHOC ( node . declaration ) ;
148
141
}
149
142
}
150
143
Original file line number Diff line number Diff line change
1
+ export const getServerSideProps = withAuthUserTokenSSR ( {
2
+ whenUnauthed : AuthAction . REDIRECT_TO_LOGIN ,
3
+ } ) ( async ( { AuthUser } ) => {
4
+ // ...
5
+ return {
6
+ props,
7
+ } ;
8
+ } ) ;
9
+
10
+ export default withAuthUser ( ) ( Component ) ;
Original file line number Diff line number Diff line change
1
+ import { withSuperJSONPage as _withSuperJSONPage } from 'babel-plugin-superjson-next/tools' ;
2
+ import { withSuperJSONProps as _withSuperJSONProps } from 'babel-plugin-superjson-next/tools' ;
3
+ export const getServerSideProps = _withSuperJSONProps (
4
+ withAuthUserTokenSSR ( {
5
+ whenUnauthed : AuthAction . REDIRECT_TO_LOGIN ,
6
+ } ) ( async ( { AuthUser } ) => {
7
+ // ...
8
+ return {
9
+ props,
10
+ } ;
11
+ } ) ,
12
+ [ 'smth' ]
13
+ ) ;
14
+ export default _withSuperJSONPage ( withAuthUser ( ) ( Component ) ) ;
You can’t perform that action at this time.
0 commit comments