-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NextjsSite construct] add basePath support back into NextjsSite construct #3613
Conversation
🦋 Changeset detectedLatest commit: ce73cb0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
private pathPattern(pattern: string): string { | ||
const { basePath } = this.routesManifest || {}; | ||
return basePath && basePath.length > 0 | ||
? `${basePath.slice(1)}/${pattern}` | ||
: pattern; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taken from:
sst/packages/sst/src/constructs/deprecated/NextjsSite.ts
Lines 1406 to 1411 in d6917d8
private pathPattern(pattern: string): string { | |
const { basePath } = this.routesManifest || {}; | |
return basePath && basePath.length > 0 | |
? `${basePath.slice(1)}/${pattern}` | |
: pattern; | |
} |
Thanks! Let me ask the team to review. |
@jayair any updates here? We're nearing the end of our evaluation period of SST and hoping to use this getting released as an example of our ability to influence/improve community implementations (as an alternative to doing things more in-house) |
Ah I see. Let me see if I can bump up the timeframe on this. We've been a little behind after the holidays. |
Just pulled this down and tested it and it seems to work for my stuff. Thanks @jplwood |
@jayair any idea about when this could be merged? |
Oh no, let me see why it didn't get merged. |
Partially addresses #2964
The original, now-deprecated version of the
NextjsSite
construct (as far as I can tell, it's deprecated because the non-deprecated construct uses SsrSite as a base, whereas the deprecated one doesn't?) supportedbasePath
(see deprecated code, and Next.js docs onbasePath
), a crucial feature for hosting apps behind a reverse proxy (and a major convenience when linking around if all of your app's routes are all heavily nested). When the new version ofNextjsSite
construct was released,basePath
support seemed to have been removed.This PR takes that original functionality and adds it back to the new NextjsSite construct.
Unclear if this is safely additive or if it's a breaking change.