-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: Add support for deploying Telescope using spa-tools #273
Conversation
09ebf39
to
7536cf3
Compare
// - true, we append index.html to the original request URI | ||
// - false, we serve the top-level index.html file, as all the routing is handled client-side. | ||
if (serveNestedIndexHtml) { | ||
return request.uri.replace(/\/$/, '') + '/index.html' |
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.
don't we need to consider the json files generated by gatsby (or other SSGs) for navigation after initial load?
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.
Wouldn't those be handled by the previous condition isFileRequest
?
Frankly I'm not loving that we are handling this ourselves this way but is seems to have served us well so far.
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.
yeah you're right, didn't make a lot of sense what I wrote - this is only for rewriting paths where we don't have a file.
https://linear.app/pleo/issue/WEB-1796/fix-telescope-feature-deploys
We want to fix Telescope website feature deploys by using
spa-tools
for build and deploy.What's changed
Telescope build relies on having NOTION_API_KEY env variable.
Add support for having multiple nested index.html files in the app by using a new variable
serve_nested_index_html
in the Terraform module.Telescope uses Gatsby SSG (static site generation) and pre-renderes static
index.html
for each route.Before this change if we go to https://telescope.pleo.io/components/overview/overview.about, we get the root
/index.html
file served from the S3 bucket.After these changes we get
/components/overview/overview.about/index.html
from the S3 bucket.We now use
mime-type
library to detect if a requested URL is for a file. Until now we were naively checking that the last part of a pathname has a dot.
in it, so URL/components/overview/overview.about
was considered to request a static file.Output "permanent" preview url from the deploy reusable workflow. This is used to update PR description with the preview link in a custom way compared to the way we do it in Web repo.