11/**
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`.
98 */
109
1110import { logger } from '@sentry/utils' ;
@@ -23,7 +22,6 @@ import type { LoaderThis } from './types';
2322const DATA_FETCHING_FUNCTIONS = {
2423 getServerSideProps : { placeholder : '__ORIG_GSSP__' , alias : '' } ,
2524 getStaticProps : { placeholder : '__ORIG_GSPROPS__' , alias : '' } ,
26- getStaticPaths : { placeholder : '__ORIG_GSPATHS__' , alias : '' } ,
2725} ;
2826
2927type LoaderOptions = {
@@ -91,7 +89,7 @@ function wrapFunctions(userCode: string, templateCode: string, filepath: string)
9189}
9290
9391/**
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
9593 */
9694export default function wrapDataFetchersLoader ( this : LoaderThis < LoaderOptions > , userCode : string ) : string {
9795 // We know one or the other will be defined, depending on the version of webpack being used
0 commit comments