Skip to content

Commit 587edb4

Browse files
guanzhousongmicrosoftpatty-chowtnaum-msCopilotalaye-ms
authored
1.0 release readiness (#219)
* Publish essay on document database choice and participation (#207) Signed-off-by: Patty Chow <91703531+patty-chow@users.noreply.github.com> * Blog: DocumentDB on GitHub Open Source Friday (#208) * Add September Open Source Friday episode recap Signed-off-by: Patty Chow <91703531+patty-chow@users.noreply.github.com> * Remove recap-added note from episode post Signed-off-by: Patty Chow <91703531+patty-chow@users.noreply.github.com> --------- Signed-off-by: Patty Chow <91703531+patty-chow@users.noreply.github.com> * Blog: DocumentDB for VS Code 1.0 (#214) * Add the DocumentDB for VS Code 1.0 blog post Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Use dark-framed images and update tags for the VS Code 1.0 post Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Date the VS Code 1.0 post October 16, 2026 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add DocumentDB Kubernetes operator 1.0 blog post (#218) Describe Kubernetes operator workflows and planned LTS and development release tracks alongside Engine 1.0. * Run CI on PRs targeting the 1.0 release branch Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Publish the 1.0 posts on their dates and fix their links (#221) * Publish the 1.0 posts at 12:01am Pacific and fix their links Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Publish the VS Code 1.0 post on Oct 19 with the operator post Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> --------- Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> Co-authored-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Announce 1.0 across the homepage and blog Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Drop the future-dated post CI step Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Show blog card covers beside the text Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Drop cover images from blog cards Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Switch the site from v0.117-0 to v1.0-0 Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Show the DocumentDB Local telemetry opt-out next to every docker run Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Document the in-place upgrade to 1.0 for packages and containers Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Mark the Kubernetes operator 1.0.0 as GA and pin its chart Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Call LTS planned and retire the RC install steps in the versioning post Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Add the DocumentDB 1.0 announcement post Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Point the 1.0 banner and update notes at the announcement Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Link the getting started guide instead of the retired RC guide Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Fetch the installer from v1.0-0 and test the v1.0-0 repository in CI Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Add a /v1/ landing page for the 1.0 release and point the banners at it Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Say collation is opt-in in 1.0 Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Call Kubernetes operator 1.0.0 generally available Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Act on the /v1/ review: launch-first order, setup prerequisites, contrast, 1.0 social card Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Fix review findings: atomic upgrade SQL, env credentials, base-path links Upgrade: one psql -X -1 ON_ERROR_STOP transaction gated with &&, preload check, setup only updates the postgres database. docker run passes credentials as -e before the image. Root-relative Markdown links get the base path. Drops the DocumentDB Local overlay, keeps the fourth architecture component, fixes installer wording, contrast and TLS-mode count. Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Keep the gateway down until setup updates the extensions; fix CentOS and AI recipes Restarting documentdb-local@18.target started the gateway on the new libraries before setup ran. CentOS Stream has no minor release, so PGDG's rhel-9.-arch path 404s. $vectorSearch filters need an index on the filtered field. Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Stop gateways on adopted and two-major upgrades; make the AI example runnable The CentOS check now reads os-release the way the shell does and also repairs a repo file left by an earlier attempt. The AI example used a 1536-dimension index with a 3-element query. Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Brand unification: DocumentDB extension for Visual Studio Code (#226) * Fix #219 review findings: upgrade gating, blog base path, launch wording Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> * Keep a custom gateway database out of setup when fixing the preload Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> --------- Signed-off-by: Patty Chow <91703531+patty-chow@users.noreply.github.com> Signed-off-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> Co-authored-by: Patty <91703531+patty-chow@users.noreply.github.com> Co-authored-by: Tomasz Naumowicz <tnaumowicz@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Alexander Laye <145385576+alaye-ms@users.noreply.github.com> Co-authored-by: Guanzhou Song <26541184+GuanzhouSong@users.noreply.github.com> Co-authored-by: Guanzhou <guanzhou.song@gmail.com>
1 parent 07faf06 commit 587edb4

50 files changed

Lines changed: 1413 additions & 384 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/continuous-integration.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ on:
55
push:
66
branches:
77
- main
8-
# Runs on pull requests targeting the default branch
8+
# Runs on pull requests targeting the default branch or the 1.0 release branch
99
pull_request:
1010
branches:
1111
- main
12+
- 1.0-release-readiness
1213
# Supersede in-flight runs for a pull request when new commits arrive, so a
1314
# rebase or force-push does not leave several runs racing on stale commits.
1415
# Pushes to main are never cancelled: every commit on the default branch
@@ -96,9 +97,9 @@ jobs:
9697
run: |
9798
sudo apt-get update
9899
sudo apt-get install -y createrepo-c dpkg-dev rpm python3
99-
- name: Generate repository from v0.117-0
100+
- name: Generate repository from v1.0-0
100101
env:
101-
DOCUMENTDB_VERSION: v0.117-0
102+
DOCUMENTDB_VERSION: v1.0-0
102103
run: .github/scripts/download_packages.sh
103104
- name: Verify release inventory and metadata
104105
run: python3 .github/scripts/verify_package_inventory.py

‎PACKAGE-INSTALL.md‎

Lines changed: 74 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
Repository-backed installation commands for DocumentDB.
44

5-
> This repository serves v0.117-0. v1.0-RC2 is for testing only, gets no fixes (those go into
6-
> a later RC or 1.0), has no upgrade path, and isn't in this repository; see
7-
> [Try the 1.0 release candidate](https://documentdb.io/docs/getting-started/release-candidate/).
5+
> This repository serves v1.0-0.
86
97
## Clean-host installer
108

@@ -15,14 +13,10 @@ curl -fsSLo documentdb-install.sh https://documentdb.io/install.sh &&
1513
sudo sh documentdb-install.sh
1614
```
1715

18-
This installs v0.117-0 from this repository on PostgreSQL 18; add `--pg-major 17`
19-
for 17. To try RC2, add `--version v1.0-RC2`. The installer then downloads this host's
20-
packages from the
21-
[v1.0-RC2 release](https://github.com/documentdb/documentdb/releases/tag/v1.0-RC2),
22-
verifies them against its `SHA256SUMS`, and doesn't use this repository. The
23-
`pgNN-1.0-rc2` container image also runs RC2; it sends anonymous usage telemetry by default
24-
(opt out with `-e DOCUMENTDB_USAGE_TELEMETRY=false`). See the
25-
[RC guide](https://documentdb.io/docs/getting-started/release-candidate/).
16+
This installs v1.0-0 from this repository on PostgreSQL 18; add `--pg-major 17`
17+
for 17. On a host where DocumentDB is already set up, it only reports that instance's status
18+
and doesn't upgrade it; to move an existing install to 1.0, see
19+
[Upgrading an existing install](#upgrading-an-existing-install).
2620

2721
The site serves the `install.sh` attached to the release named in
2822
`scripts/publish-installer.mjs`, and the build fails if its SHA256 changes.
@@ -109,10 +103,12 @@ sudo apt install -y documentdb
109103
wall of GDAL candidate lines that never name the missing repository.
110104

111105
```bash
106+
if (. /etc/os-release && [ "$ID" = centos ]) && [ -f /etc/yum.repos.d/pgdg-redhat-all.repo ]; then sudo sed -i 's/rhel-\$releasever_major\.\$releasever_minor-/rhel-$releasever_major-/g' /etc/yum.repos.d/pgdg-redhat-all.repo; fi && \
112107
sudo dnf install -y dnf-plugins-core && \
113108
sudo dnf config-manager --set-enabled crb && \
114109
sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
115110
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-$(uname -m)/pgdg-redhat-repo-latest.noarch.rpm && \
111+
if (. /etc/os-release && [ "$ID" = centos ]) && [ -f /etc/yum.repos.d/pgdg-redhat-all.repo ]; then sudo sed -i 's/rhel-\$releasever_major\.\$releasever_minor-/rhel-$releasever_major-/g' /etc/yum.repos.d/pgdg-redhat-all.repo; fi && \
116112
sudo dnf -qy module disable postgresql && \
117113
sudo rpm --import https://documentdb.io/documentdb-archive-keyring.gpg && \
118114
printf '%s\n' \
@@ -229,7 +225,7 @@ Before using this anywhere but a private machine:
229225

230226
```bash
231227
sudo documentdb-setup --status # gateway listener, service states, resolved paths
232-
documentdb-gateway --version # DocumentDB version (0.117.0)
228+
documentdb-gateway --version # DocumentDB version (1.0.0)
233229
dpkg -l | grep documentdb # or: rpm -qa | grep documentdb
234230
```
235231

@@ -373,54 +369,89 @@ The current release publishes PostgreSQL 17 and 18. Install `documentdb-17` or
373369

374370
## Upgrading an existing install
375371

376-
> **Warning:** In-place package upgrades from earlier releases are not supported yet. Use a
377-
> clean host or a new, empty PostgreSQL instance for the current fresh installation.
378-
> Removing packages alone does not create a fresh database: package removal preserves PostgreSQL data and
379-
> in-database content, and a later setup run reuses an initialized data directory. Upgrading only
380-
> `postgresql-N-documentdb` does not install the gateway, tools, common payload, or `documentdb-N`.
372+
Package installs from v0.116 or later upgrade in place to 1.0. Move the entire stack
373+
together; upgrading only `postgresql-N-documentdb` does not update the gateway, tools, common
374+
payload, or `documentdb-N`. These steps use systemd; upgrading a host without it isn't covered here.
375+
On a package-managed private PostgreSQL 18 instance:
381376

382-
For a later point release that uses the same multi-package layout, move the entire stack
383-
together. On a package-managed private PostgreSQL 18 instance:
377+
> **Warning:** A host that ran a 1.0 release candidate (RC1 or RC2) has no upgrade path. Use a
378+
> clean host or a new, empty PostgreSQL instance.
379+
> Removing packages alone does not create a fresh database: package removal preserves PostgreSQL
380+
> data and in-database content, and a later setup run reuses an initialized data directory.
384381
385382
```bash
386-
sudo systemctl stop documentdb-gateway-local@18.service
387-
388383
# Debian / Ubuntu
389-
sudo apt update
384+
sudo systemctl stop documentdb-gateway-local@18.service &&
385+
sudo apt update &&
390386
sudo apt install --only-upgrade documentdb-18 postgresql-18-documentdb \
391387
documentdb-common documentdb-gateway documentdb-postgresql-tools
392388

393389
# EL9: use this instead of the apt commands above
390+
sudo systemctl stop documentdb-gateway-local@18.service &&
394391
sudo dnf upgrade documentdb-18 postgresql18-documentdb \
395392
documentdb-common documentdb-gateway documentdb-postgresql-tools
396-
397-
# PostgreSQL has the old shared library loaded until it restarts.
398-
sudo systemctl restart documentdb-postgresql@18.service
399393
```
400394

401-
Then update the extensions in **every database** that has DocumentDB installed:
395+
Upgrading the packages does not update the database catalog. The simplest way is to restart
396+
PostgreSQL so it loads the new libraries, then re-run setup with the options you installed with.
397+
Setup updates the extensions and then starts the gateway:
402398

403-
```sql
404-
ALTER EXTENSION documentdb_core UPDATE;
405-
ALTER EXTENSION documentdb UPDATE;
406-
ALTER EXTENSION documentdb_extended_rum UPDATE; -- only if it is installed
399+
```bash
400+
sudo systemctl restart documentdb-postgresql@18.service &&
401+
sudo documentdb-setup --pg-version 18 --use-new-postgres-instance --admin-user admin
407402
```
408403

409-
PostgreSQL applies available intermediate extension upgrade scripts automatically. Confirm
410-
afterwards with:
404+
Setup adds any missing `shared_preload_libraries` entries and updates the extensions, but only in
405+
the `postgres` database. If your gateway uses another database, take the manual route below. It also asks for the admin password and sets it on the existing admin
406+
user: enter the current password to keep it.
411407

412-
```sql
413-
SELECT extname, extversion FROM pg_extension WHERE extname LIKE 'documentdb%';
408+
To update by hand, or for every other database that has DocumentDB installed, first check that
409+
the extended RUM library is preloaded:
410+
411+
```bash
412+
sudo -u documentdb-local psql -h /run/documentdb-local/18/postgresql -p 9718 -d postgres -X -Atc "SHOW shared_preload_libraries;"
414413
```
415414

416-
Finally restart the gateway:
415+
If `pg_documentdb_extended_rum` is missing (possible on a 0.116 install), add it before updating;
416+
the update below would succeed without it, and index builds would fail later. If the gateway uses
417+
`postgres`, re-run setup as above. If it uses another database, add the library to
418+
`shared_preload_libraries` in the instance's `postgresql.conf` yourself: setup would point the
419+
gateway back at `postgres`. Then restart
420+
PostgreSQL, update the extensions in one transaction, and start the gateway only if that worked:
417421

418422
```bash
423+
sudo systemctl restart documentdb-postgresql@18.service &&
424+
sudo -u documentdb-local psql -h /run/documentdb-local/18/postgresql -p 9718 -d postgres \
425+
-X -1 -v ON_ERROR_STOP=1 \
426+
-c 'ALTER EXTENSION documentdb_core UPDATE;' \
427+
-c 'ALTER EXTENSION documentdb UPDATE;' \
428+
-c 'CREATE EXTENSION IF NOT EXISTS documentdb_extended_rum CASCADE;' \
429+
-c 'ALTER EXTENSION documentdb_extended_rum UPDATE;' &&
419430
sudo systemctl start documentdb-gateway-local@18.service
420431
```
421432

422-
Take a backup first. For an adopted PostgreSQL instance, restart its operator-managed
423-
PostgreSQL service instead of `documentdb-postgresql@18.service`.
433+
`-1` runs the statements as one transaction: if any fails, every extension stays at its old version
434+
and the gateway stays stopped. `-X` skips `~/.psqlrc`, which could otherwise turn `ON_ERROR_STOP` off. If DocumentDB is installed in other databases too, run the `psql` part for each of them, with
435+
that `-d`, before the last line, so the gateway starts only after every database is updated.
436+
PostgreSQL applies intermediate upgrade scripts automatically. Take a backup first.
437+
438+
On a host with both PostgreSQL 17 and 18, `documentdb-common`, `documentdb-gateway` and
439+
`documentdb-postgresql-tools` serve both majors, so upgrading them affects both: stop both gateways
440+
(`documentdb-gateway-local@17.service` and `@18.service`) before upgrading, then update each major.
441+
442+
For an adopted PostgreSQL instance, setup never restarts PostgreSQL. Stop the gateway
443+
(`documentdb-gateway-local@18.service`) before upgrading, restart the operator-managed PostgreSQL
444+
service yourself, then re-run
445+
`documentdb-setup --pg-version 18 --target-postgres-instance 18/main --admin-user admin` (with your cluster name); it
446+
updates the extensions and then starts the gateway. If
447+
setup has to change `shared_preload_libraries`, it exits without updating the extensions: restart
448+
PostgreSQL and run it once more. By hand, use that instance's own `psql` connection.
449+
450+
Confirm afterwards with:
451+
452+
```sql
453+
SELECT extname, extversion FROM pg_extension WHERE extname LIKE 'documentdb%';
454+
```
424455

425456
## Version pinning
426457

@@ -449,17 +480,17 @@ published in the documentdb.io package repositories. Community builds are welcom
449480
For example, after checking out the matching release tag, build an extension package with:
450481

451482
```bash
452-
./packaging/build_packages.sh --os deb12 --pg 16
483+
./packaging/build_packages.sh --os deb12 --pg 16 --version 1.0.0
453484
```
454485

455-
That command builds only `postgresql-N-documentdb`. A custom full-stack package set uses
486+
`v1.0-0` and `v1.0-RC2` are on the same commit, so pass `--version`; without it the scripts can build RC-versioned packages. That command builds only `postgresql-N-documentdb`. A custom full-stack package set uses
456487
three entry points:
457488

458489
- `packaging/build_packages.sh` — PostgreSQL extension
459490
- `packaging/gateway/build_gateway_packages.sh` — wire-protocol gateway
460491
- `packaging/build_extra_packages.sh` — tools, common payload, `documentdb-N`, and meta package
461492

462-
The [v0.117 packaging guide](https://github.com/documentdb/documentdb/blob/v0.117-0/packaging/README.md)
493+
The [v1.0 packaging guide](https://github.com/documentdb/documentdb/blob/v1.0-0/packaging/README.md)
463494
documents their required arguments, version formats, prerequisites, and accepted targets.
464495
PostgreSQL 15 remains extension-only for package-managed installs because the setup tools
465496
require PostgreSQL 16 or newer.
@@ -474,9 +505,9 @@ they do not retain packages from older releases.
474505
Examples:
475506

476507
```text
477-
ubuntu24.04-documentdb_0.117.0_all.deb
478-
ubuntu24.04-postgresql-18-documentdb_0.117-0_amd64.deb
479-
rhel9-postgresql18-documentdb-0.117.0-1.el9.x86_64.rpm
508+
ubuntu24.04-documentdb_1.0.0_all.deb
509+
ubuntu24.04-postgresql-18-documentdb_1.0-0_amd64.deb
510+
rhel9-postgresql18-documentdb-1.0.0-1.el9.x86_64.rpm
480511
```
481512

482513
For a full stack, pass the five packages for the selected PostgreSQL major to one command:

‎app/ai/page.tsx‎

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Image from "next/image";
22
import Link from "next/link";
33
import CommandSnippet from "../components/CommandSnippet";
4+
import TelemetryNote from "../components/TelemetryNote";
45
import { getMetadata } from "../services/metadataService";
56
import {
67
documentdbGitHubForks,
@@ -27,29 +28,39 @@ export const metadata = getMetadata({
2728
});
2829

2930
const quickRunCommand = `docker run -dt --name documentdb \\
30-
-p 10260:10260 \\
31-
ghcr.io/documentdb/documentdb/documentdb-local:latest \\
32-
--username admin --password password`;
31+
-p 127.0.0.1:10260:10260 \\
32+
-e USERNAME=admin \\
33+
-e PASSWORD=password \\
34+
ghcr.io/documentdb/documentdb/documentdb-local:latest`;
3335

3436
const connectCommand = `mongosh "mongodb://admin:password@localhost:10260/?tls=true&tlsAllowInvalidCertificates=true"`;
3537

36-
const createIndexCommand = `db.runCommand({
38+
const createIndexCommand = `// Real embeddings are longer: set dimensions to your model's size, such as 1536.
39+
db.documents.insertMany([
40+
{ title: "Vector indexes", category: "technical", embedding: [0.10, -0.02, 0.30] },
41+
{ title: "Release notes", category: "news", embedding: [0.90, 0.40, -0.10] }
42+
]);
43+
44+
db.runCommand({
3745
createIndexes: "documents",
3846
indexes: [{
3947
key: { embedding: "cosmosSearch" },
4048
name: "vector_idx",
4149
cosmosSearchOptions: {
4250
kind: "vector-hnsw",
4351
similarity: "COS",
44-
dimensions: 1536
52+
dimensions: 3
4553
}
4654
}]
47-
});`;
55+
});
56+
57+
// $vectorSearch filters need an index on each filtered field.
58+
db.documents.createIndex({ category: 1 });`;
4859

4960
const vectorSearchCommand = `db.documents.aggregate([
5061
{
5162
$vectorSearch: {
52-
queryVector: [0.12, -0.04, 0.31, /* ... 1536 dims */],
63+
queryVector: [0.12, -0.04, 0.31],
5364
path: "embedding",
5465
limit: 10,
5566
numCandidates: 100,
@@ -113,7 +124,7 @@ const quickStartSteps = [
113124
step: "03",
114125
title: "Create a vector index",
115126
description:
116-
"Create a native HNSW vector index with cosine similarity for embedding retrieval.",
127+
"Add sample documents, a native HNSW vector index with cosine similarity, and an index on the field you filter by.",
117128
label: "Index",
118129
code: createIndexCommand,
119130
},
@@ -296,6 +307,7 @@ export default function AIPage() {
296307
</p>
297308
<div className="mt-5">
298309
<CommandSnippet command={quickRunCommand} label="Docker" />
310+
<TelemetryNote />
299311
</div>
300312
<div className="mt-5 grid gap-3 sm:grid-cols-3">
301313
<div className="rounded-2xl border border-neutral-800 bg-neutral-900/70 p-4">
@@ -386,6 +398,7 @@ export default function AIPage() {
386398
<p className="mt-2 text-sm leading-6 text-gray-400">{item.description}</p>
387399
<div className="mt-5">
388400
<CommandSnippet command={item.code} label={item.label} />
401+
{item.code === quickRunCommand && <TelemetryNote />}
389402
</div>
390403
</article>
391404
))}

‎app/components/AnnouncementBar.tsx‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Link from "next/link";
2+
import { documentdbReleasePageUrl } from "../services/externalLinks";
3+
4+
export default function AnnouncementBar() {
5+
return (
6+
<Link
7+
href={documentdbReleasePageUrl}
8+
className="block bg-gradient-to-r from-emerald-500/20 via-blue-500/20 to-emerald-500/20 px-4 py-2 text-center text-sm text-white transition-colors hover:from-emerald-500/30 hover:via-blue-500/30 hover:to-emerald-500/30"
9+
>
10+
<span className="mr-2 rounded-full bg-emerald-400/20 px-2 py-0.5 text-xs font-semibold uppercase tracking-[0.14em] text-emerald-200">
11+
New
12+
</span>
13+
<span className="font-semibold">DocumentDB 1.0 is here.</span>{" "}
14+
<span className="whitespace-nowrap text-emerald-200 underline-offset-4 hover:underline">
15+
See what&apos;s new <span aria-hidden="true">&rarr;</span>
16+
</span>
17+
</Link>
18+
);
19+
}

‎app/components/Markdown.tsx‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { ReactElement } from 'react';
88
import Code from './Code';
99
import { headingAnchor } from '../lib/docsAnchors';
1010
import { resolveMarkdownLink } from '../lib/markdownLinks';
11+
import { withBasePath } from '../services/sitePath';
1112

1213
interface MarkdownProps {
1314
content: string;
@@ -122,7 +123,7 @@ function getMarkdownComponents(sourcePath: string) {
122123
// Inline code
123124
code: ({ inline, children, ...props }: any) => {
124125
return (
125-
<code className="bg-neutral-900/50 px-2 py-1 rounded text-green-400 font-mono text-sm" {...props}>
126+
<code className="bg-neutral-900/50 px-2 py-1 rounded text-green-400 font-mono text-sm [overflow-wrap:anywhere]" {...props}>
126127
{children}
127128
</code>
128129
);
@@ -254,17 +255,16 @@ function getMarkdownComponents(sourcePath: string) {
254255

255256
// Links: only external links open in a new tab; internal links (/docs/...,
256257
// /samples, #anchors) navigate in place
257-
a: ({ children, href, ...props }: any) => {
258+
a: ({ children, href, node: _node, ...props }: any) => {
258259
const resolvedHref = resolveMarkdownLink(href, sourcePath);
259260
const isExternal = /^https?:\/\//i.test(resolvedHref ?? '');
260261
const linkClassName = 'text-blue-400 hover:text-blue-300 transition-colors';
261262

262263
// A rewritten href is a resolved document route, so it is known to be an
263-
// internal page and is rendered with next/link. That applies the basePath
264-
// from next.config identically on the server and in the browser -
265-
// NEXT_BASE_PATH is not readable from the client bundle, so neither this
266-
// component nor the resolver may prefix the path itself. Any other href
267-
// is left exactly as the author wrote it.
264+
// internal page and is rendered with next/link, which applies the
265+
// basePath itself. Any other root-relative href may be a route Next does
266+
// not own (/blogs/, /install.sh), so it stays a plain anchor and gets the
267+
// base path from withBasePath.
268268
if (resolvedHref && resolvedHref !== href) {
269269
return (
270270
<Link href={resolvedHref} className={linkClassName} {...props}>
@@ -275,7 +275,7 @@ function getMarkdownComponents(sourcePath: string) {
275275

276276
return (
277277
<a
278-
href={resolvedHref}
278+
href={resolvedHref && /^\/(?!\/)/.test(resolvedHref) ? withBasePath(resolvedHref) : resolvedHref}
279279
className={linkClassName}
280280
{...(isExternal ? { target: '_blank', rel: 'noopener noreferrer' } : {})}
281281
{...props}

‎app/components/QuickStartTabs.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import Link from "next/link";
44
import { useRef, useState } from "react";
55
import CommandSnippet from "./CommandSnippet";
6+
import TelemetryNote from "./TelemetryNote";
67

78
type QuickStartTabsProps = {
89
dockerCommand: string;
@@ -109,6 +110,7 @@ export default function QuickStartTabs({
109110
Replace the username and password, then run the command.
110111
</p>
111112
<CommandSnippet command={dockerCommand} label="bash" />
113+
<TelemetryNote />
112114
<p className="mt-4 text-sm leading-6 text-gray-300">
113115
Then connect with your preferred client.
114116
</p>

0 commit comments

Comments
 (0)