-
Notifications
You must be signed in to change notification settings - Fork 30
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
NextJS: add /about and /projects base paths #2519
Conversation
Running a test project locally: I'm seeing asset requests prefixed as expected 👍 |
28ef9b7
to
27177a2
Compare
@@ -61,7 +61,7 @@ spec: | |||
- containerPort: 3000 | |||
env: | |||
- name: PROJECT_ASSET_PREFIX | |||
value: https://fe-project.zooniverse.org | |||
value: https://fe-project.zooniverse.org/projects |
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.
This can be changed to https://www.zooniverse.org/projects
, once routing is set up.
@@ -153,7 +153,7 @@ spec: | |||
- containerPort: 3000 | |||
env: | |||
- name: CONTENT_ASSET_PREFIX | |||
value: https://fe-content-pages.zooniverse.org | |||
value: https://fe-content-pages.zooniverse.org/about |
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.
This can change to https://www.zooniverse.org/about
.
@@ -51,7 +51,7 @@ spec: | |||
- containerPort: 3000 | |||
env: | |||
- name: PROJECT_ASSET_PREFIX | |||
value: https://fe-project.preview.zooniverse.org | |||
value: https://fe-project.preview.zooniverse.org/projects |
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.
This can change to https://frontend.preview.zooniverse.org/projects
.
@@ -135,7 +135,7 @@ spec: | |||
- containerPort: 3000 | |||
env: | |||
- name: CONTENT_ASSET_PREFIX | |||
value: https://fe-content-pages.preview.zooniverse.org | |||
value: https://fe-content-pages.preview.zooniverse.org/about |
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.
This can change to https://frontend.preview.zooniverse.org/about
.
- Set `next.config.basePath` to `/about` for content pages and `/projects` for projects. - Remove the corresponding page paths so that page URLs don't change. - Update asset prefix URLs so that static assets don't break.
27177a2
to
12f85f9
Compare
@camallen would it be ok to merge this? I’d like to see how it works behind nginx, on staging. |
Looking at the placeholder images for subjects, on a staging page, those are being served directly from https://fe-project.preview.zooniverse.org/subject-placeholder.png. That won't break here, they'll still be served to the browser from https://frontend.preview.zooniverse.org/projects/eatyourgreens/-project-testing-ground/classify/workflow/3223?env=staging |
There's one other static image that's served directly from the origin at the moment: https://fe-project.preview.zooniverse.org/simple-avatar.png on the team pages. |
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.
LGTM - happy to get this to staging and iterate. One assumption is this won't impact any production deployment when it ships - we need to be quick to fix any issues if they arise on production.
@@ -29,6 +29,7 @@ const COMMIT_ID = process.env.COMMIT_ID || commitID() | |||
|
|||
const nextConfig = { | |||
assetPrefix, | |||
basePath: '/about', |
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.
Should we allow this to be modified by ENV var with the default /about
as fallback?
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.
I'm not sure. It changes the URL of all the pages served by the app and I'm not sure I see the value of changing those from /about/team
and /about/publications
to a different URL.
@@ -19,9 +19,10 @@ function commitID () { | |||
} | |||
} | |||
|
|||
const basePath = '/projects' |
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.
Again - any use in allowing this to be set via ENV var with the above as fallback?
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.
Same here. I'm not sure about the value of changing project URLs away from /projects/:owner:/:project:
, with the associated overhead of updating our static setup.
Agreed. That's why I'd like to get it out on staging: so we can test it out when URL rewriting is in place. |
#2519 added /projects as a base path for the project app. This PR updates links, which have been hardcoded with `/projects` and now point to `/projects/projects/:owner:/:name:`.
#2519 added /projects as a base path for the project app. This PR updates links, which have been hardcoded with `/projects` and now point to `/projects/projects/:owner:/:name:`.
next.config.basePath
to/about
for content pages and/projects
for projects.Package:
app-project
app-content-pages
Towards #2518.
Review Checklist
General
Components
Apps
yarn panic && yarn bootstrap
ordocker-compose up --build
and app works as expected?Publishing
Post-merging