-
Notifications
You must be signed in to change notification settings - Fork 17
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(RemoteContentLoader): navDataPrefix option #583
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 445d4fb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Ah I see now. So generally it's |
@@ -95,22 +104,28 @@ export default class RemoteContentLoader implements DataLoader { | |||
if (!this.opts.mainBranch) this.opts.mainBranch = 'main' | |||
if (!this.opts.scope) this.opts.scope = {} | |||
if (!this.opts.remarkPlugins) this.opts.remarkPlugins = [] | |||
|
|||
this.navDataPrefix = this.opts.navDataPrefix || this.opts.basePath |
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.
suggestion: convention is for everything to be read from this.opts
, so we can use a similar default approach above and assign to this.opts.basePath
if it is unset. No need for the extra class property
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.
Good call! I'll do that
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.
Removed the extra property: 445d4fb
Yea, this has been one of those assumptions that hasn't caused issues in the past, but not sort of does |
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!
📦 Canary Packages PublishedLatest commit: 445d4fb Published 1 packages@hashicorp/react-docs-page@16.1.0-canary-20220505214234
|
Description
This adds a
navDataPrefix
option to ourRemoteContentLoader
.This helps to address a previous assumption that
basePath
would always be the same fordoc
andnav-data
lookups from our API, which is not necessarily going to be the case going forward.🎟️ Asana Task
🔍 Preview Link
Description
Describe this pull request: what is it aiming to achieve? What should someone reviewing this PR know? If this PR includes visual changes, consider including before / after screenshots, or an animated gif showing interactions.
PR Checklist 🚀
Items in this checklist may not may not apply to your PR, but please consider each item carefully.