-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Devcontainer upgrade and implement workaround for #10769 #10770
base: main
Are you sure you want to change the base?
Conversation
…e#7029 by using IPv4 loopback when in Remote Container environment
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import logger from '@docusaurus/logger'; | ||
|
||
export function forceV4OnRemoteContainers( | ||
userCLIConfig: OptionallyProvidedHost, | ||
): void { | ||
if (process.env.REMOTE_CONTAINERS === 'true') { | ||
if (!userCLIConfig.host) { | ||
userCLIConfig.host = '127.0.0.1'; | ||
logger.info( | ||
'Will default to binding to IPv4 local address to better support VSCode Remote port forwarding', | ||
); | ||
} else { | ||
logger.warn('VSCode Remote may not support IPv6'); | ||
} | ||
} | ||
} | ||
|
||
export type OptionallyProvidedHost = { | ||
host?: string; | ||
}; |
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.
We don't want to add Devcontainer specific things into Docusaurus core.
At best I can propose to implement docusaurus start --host 127.0.0
, it's already supported for docusaurus serve
. Devcontainer hacks should be added "from the outside"
Pre-flight checklist
Motivation
Upgrades Dev Container to Ubuntu 24.04 base and Node 22 (latest LTS)
Also migrates VSCode configuration/settings to correct place in schema
Adds a fairly hacky workaround for #10769 where if the
start
orserve
commands are ran within Remote Containers it will default to127.0.0.1
instead oflocalhost
. Ideally this would have been a cleaner refactor, or fixed somewhere upstream (ie vscode forwards port correctly, or webpack dev server support dual-stack binding)Test Plan
Test links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs
#10769