1
1
/**
2
- * This loader auto-wraps a user's page-level data-fetching functions (`getStaticPaths`, `getStaticProps`, and
3
- * `getServerSideProps`) in order to instrument them for tracing. At a high level, this is done by finding the relevant
4
- * functions, renaming them so as not to create a name collision, and then creating a new version of each function which
5
- * is a wrapped version of the original. We do this by parsing the user's code and some template code into ASTs,
6
- * manipulating them, and then turning them back into strings and appending our template code to the user's (modified)
7
- * page code. Greater detail and explanations can be found in situ in the functions below and in the helper functions in
8
- * `ast.ts`.
2
+ * This loader auto-wraps a user's page-level data-fetching functions (`getStaticProps` and `getServerSideProps`) in
3
+ * order to instrument them for tracing. At a high level, this is done by finding the relevant functions, renaming them
4
+ * so as not to create a name collision, and then creating a new version of each function which is a wrapped version of
5
+ * the original. We do this by parsing the user's code and some template code into ASTs, manipulating them, and then
6
+ * turning them back into strings and appending our template code to the user's (modified) page code. Greater detail and
7
+ * explanations can be found in situ in the functions below and in the helper functions in `ast.ts`.
9
8
*/
10
9
11
10
import { logger } from '@sentry/utils' ;
@@ -23,7 +22,6 @@ import type { LoaderThis } from './types';
23
22
const DATA_FETCHING_FUNCTIONS = {
24
23
getServerSideProps : { placeholder : '__ORIG_GSSP__' , alias : '' } ,
25
24
getStaticProps : { placeholder : '__ORIG_GSPROPS__' , alias : '' } ,
26
- getStaticPaths : { placeholder : '__ORIG_GSPATHS__' , alias : '' } ,
27
25
} ;
28
26
29
27
type LoaderOptions = {
@@ -91,7 +89,7 @@ function wrapFunctions(userCode: string, templateCode: string, filepath: string)
91
89
}
92
90
93
91
/**
94
- * Wrap `getStaticPaths`, ` getStaticProps`, and `getServerSideProps` (if they exist) in the given page code
92
+ * Wrap `getStaticProps` and `getServerSideProps` (if they exist) in the given page code
95
93
*/
96
94
export default function wrapDataFetchersLoader ( this : LoaderThis < LoaderOptions > , userCode : string ) : string {
97
95
// We know one or the other will be defined, depending on the version of webpack being used
0 commit comments