Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed May 7, 2024
1 parent a63885f commit d254dcb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions packages/astro/src/core/render-context.ts
Expand Up @@ -50,9 +50,9 @@ export class RenderContext {
) {}

/**
* A flag that tells the render content if the rerouting was triggered
* A flag that tells the render content if the rewriting was triggered
*/
isRerouting = false;
isRewriting = false;
/**
* A safety net in case of loops
*/
Expand Down Expand Up @@ -125,7 +125,7 @@ export class RenderContext {
statusText: 'Not found',
});
} finally {
this.isRerouting = true;
this.isRewriting = true;
}
} else {
this.pipeline.logger.warn(
Expand Down Expand Up @@ -163,7 +163,7 @@ export class RenderContext {
if (
this.routeData.route === '/404' ||
this.routeData.route === '/500' ||
this.isRerouting
this.isRewriting
) {
response.headers.set(REROUTE_DIRECTIVE_HEADER, 'no');
}
Expand Down Expand Up @@ -215,7 +215,7 @@ export class RenderContext {
this.url = new URL(this.request.url);
this.cookies = new AstroCookies(this.request);
this.params = getParams(routeData, url.toString());
this.isRerouting = true;
this.isRewriting = true;
return await this.render(component);
} catch (e) {
pipeline.logger.debug('router', 'Rewrite failed.', e);
Expand Down Expand Up @@ -402,7 +402,7 @@ export class RenderContext {
this.url = new URL(this.request.url);
this.cookies = new AstroCookies(this.request);
this.params = getParams(routeData, url.toString());
this.isRerouting = true;
this.isRewriting = true;
return await this.render(component);
} catch (e) {
pipeline.logger.debug('router', 'Rerouting failed, returning a 404.', e);
Expand Down
6 changes: 3 additions & 3 deletions packages/astro/src/vite-plugin-astro-server/pipeline.ts
Expand Up @@ -74,7 +74,7 @@ export class DevPipeline extends Pipeline {
mode,
settings,
} = this;
const filePath = new URL(`./${routeData.component}`, root);
const filePath = new URL(`${routeData.component}`, root);
// Add hoisted script tags, skip if direct rendering with `directRenderScript`
const { scripts } = settings.config.experimental.directRenderScript
? { scripts: new Set<SSRElement>() }
Expand Down Expand Up @@ -146,7 +146,7 @@ export class DevPipeline extends Pipeline {
config: { root },
loader,
} = this;
const filePath = new URL(`./${routeData.component}`, root);
const filePath = new URL(`${routeData.component}`, root);
return getComponentMetadata(filePath, loader);
}

Expand Down Expand Up @@ -186,7 +186,7 @@ export class DevPipeline extends Pipeline {
if (component) {
return component;
} else {
const filePath = new URL(`./${routeData.component}`, this.config.root);
const filePath = new URL(`${routeData.component}`, this.config.root);
return await this.preload(routeData, filePath);
}
}
Expand Down

0 comments on commit d254dcb

Please sign in to comment.