This is an automated email from the ASF dual-hosted git repository. chaokunyang pushed a commit to branch update_docs in repository https://gitbox.apache.org/repos/asf/fory-site.git
commit ab9f66a5dadd9cfbd8d8bd3ad09a5edee868fc74 Author: chaokunyang <[email protected]> AuthorDate: Tue Aug 4 01:06:35 2026 +0800 docs: fix navigation and deployment follow-ups --- .github/workflows/deploy.yml | 2 +- docs/community/how_to_release.md | 2 +- docs/development/cpp-debugging.md | 10 +- docs/object-serialization/xlang/index.md | 5 + .../current/community/how_to_release.md | 2 +- sidebars.ts | 28 +-- src/pages/404.tsx | 18 +- src/plugin/redirect.js | 216 +++++---------------- 8 files changed, 95 insertions(+), 188 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d6a32934f0..5ea1405246 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -47,7 +47,7 @@ jobs: python --version cd scripts/unified-docs python script.py - ls -lR ../../i18n/zh-CN/ ../../i18n/eu-US/ + ls -lR ../../i18n/zh-CN/ - name: NPM Install run: npm ci --prefer-offline --fund=false diff --git a/docs/community/how_to_release.md b/docs/community/how_to_release.md index 6b5a4d0e76..3cf1ac51bd 100644 --- a/docs/community/how_to_release.md +++ b/docs/community/how_to_release.md @@ -446,7 +446,7 @@ To learn more about Fory, please see https://fory.apache.org/ [ ] No compiled archives bundled in source archive. [ ] Can compile from source. -How to Build and Test, please refer to: https://github.com/apache/fory/blob/main/docs/DEVELOPMENT.md +How to Build and Test, please refer to: https://github.com/apache/fory/blob/main/docs/development/building.md Thanks, diff --git a/docs/development/cpp-debugging.md b/docs/development/cpp-debugging.md index 162858b7f9..360eef894b 100644 --- a/docs/development/cpp-debugging.md +++ b/docs/development/cpp-debugging.md @@ -18,6 +18,10 @@ license: | limitations under the License. --- +import JumpGeneratedFile from "@site/docs/images/jmp_generate_file.png"; +import VscodeDebugFory from "@site/docs/images/vscode_debug_fory.jpg"; +import VscodeSelectDebugRun from "@site/docs/images/vscode_select_debug_run.png"; + ## Debugging C++ Debug C++ is tricky and binary protocol bug is hard to locate without debugging support, but setup @@ -29,7 +33,7 @@ Just open the fory root directory in vscode, then open a test file such as `src/ enter `F5`, then you can debug the c++ code line by line, watch variables, add breakpoints in vscode just like java/python debugging. -<img src="../images/vscode_debug_fory.jpg" alt="Apache Fory™ Debugging Example" width="50%" height="50%" /> +<img src={VscodeDebugFory} alt="Apache Fory™ Debugging Example" width="50%" height="50%" /> ## Notes @@ -38,6 +42,6 @@ java/python debugging. - install gdb for fedora/centos by `sudo yum install -y gdb` - install gdb for fedora/centos by `sudo apt-get install gdb` - If debugging doesn't work, please select correct debug/run options: - <img src="../images/vscode_select_debug_run.png" alt="select correct debug/run options" width="50%" height="50%" /> + <img src={VscodeSelectDebugRun} alt="select correct debug/run options" width="50%" height="50%" /> - Debug will jump to source files in bazel generated directory, we need to return raw files in source tree - for debugging again: <img src="../images/jmp_generate_file.png" alt="jump to generated files" width="50%" height="50%" /> + for debugging again: <img src={JumpGeneratedFile} alt="jump to generated files" width="50%" height="50%" /> diff --git a/docs/object-serialization/xlang/index.md b/docs/object-serialization/xlang/index.md index f5f21cca42..2777ce9d59 100644 --- a/docs/object-serialization/xlang/index.md +++ b/docs/object-serialization/xlang/index.md @@ -153,6 +153,11 @@ This generates native language types with consistent field/type mappings across | [Getting Started](../../start/index.md) | Installation and basic setup for all languages | | [Type Mapping](../../specification/xlang_type_mapping.md) | Xlang type mapping reference | | [Type System](type-system.md) | Built-in types and cross-runtime type behavior | +| [Type Identity](type-identity.md) | Coordinate names and numeric IDs across peers | +| [Nullability](nullability.md) | Nullable field behavior and configuration | +| [References](references.md) | Shared and circular object references | +| [Polymorphism](polymorphism.md) | Runtime type selection and registration | +| [Schema Evolution](schema-evolution.md) | Compatible and same-schema mode choices | | [Zero-Copy](zero-copy.md) | Out-of-band serialization for large data | | [Row Format](../../row-format/index.md) | Cache-friendly binary format with random access | | [Troubleshooting](troubleshooting.md) | Common issues and solutions | diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/community/how_to_release.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/community/how_to_release.md index b9227b8252..247c95e26a 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/community/how_to_release.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/community/how_to_release.md @@ -344,7 +344,7 @@ To learn more about Fory, please see https://fory.apache.org/ [ ] No compiled archives bundled in source archive. [ ] Can compile from source. -How to Build and Test, please refer to: https://github.com/apache/fory/blob/main/docs/DEVELOPMENT.md +How to Build and Test, please refer to: https://github.com/apache/fory/blob/main/docs/development/building.md Thanks, Chaokun Yang diff --git a/sidebars.ts b/sidebars.ts index b5ce98f5d8..22dfd7bd06 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -52,6 +52,7 @@ const sidebars: SidebarsConfig = { label: "Object Serialization", items: [ "object-serialization/index", + "object-serialization/runtimes", "object-serialization/xlang/index", "object-serialization/native", "object-serialization/security", @@ -164,7 +165,6 @@ const sidebars: SidebarsConfig = { "object-serialization/java/graalvm", section("OPERATE"), "object-serialization/java/virtual-threads", - "object-serialization/security", "object-serialization/java/troubleshooting", ], @@ -187,7 +187,6 @@ const sidebars: SidebarsConfig = { "object-serialization/python/out-of-band", "object-serialization/python/numpy-integration", section("OPERATE"), - "object-serialization/security", "object-serialization/python/troubleshooting", ], @@ -206,8 +205,6 @@ const sidebars: SidebarsConfig = { "object-serialization/cpp/polymorphism", "object-serialization/cpp/custom-serializers", "object-serialization/cpp/supported-types", - section("OPERATE"), - "object-serialization/security", ], goObjectSerializationSidebar: [ @@ -227,7 +224,6 @@ const sidebars: SidebarsConfig = { "object-serialization/go/supported-types", section("OPERATE"), "object-serialization/go/thread-safety", - "object-serialization/security", "object-serialization/go/troubleshooting", ], @@ -248,7 +244,6 @@ const sidebars: SidebarsConfig = { "object-serialization/rust/external-types", "object-serialization/rust/custom-serializers", section("OPERATE"), - "object-serialization/security", "object-serialization/rust/troubleshooting", ], @@ -266,7 +261,6 @@ const sidebars: SidebarsConfig = { "object-serialization/javascript/references", "object-serialization/javascript/supported-types", section("OPERATE"), - "object-serialization/security", "object-serialization/javascript/troubleshooting", ], @@ -287,7 +281,6 @@ const sidebars: SidebarsConfig = { "object-serialization/csharp/supported-types", section("OPERATE"), "object-serialization/csharp/thread-safety", - "object-serialization/security", "object-serialization/csharp/troubleshooting", ], @@ -307,7 +300,6 @@ const sidebars: SidebarsConfig = { "object-serialization/swift/external-types", "object-serialization/swift/custom-serializers", section("OPERATE"), - "object-serialization/security", "object-serialization/swift/troubleshooting", ], @@ -330,7 +322,6 @@ const sidebars: SidebarsConfig = { section("PLATFORM"), "object-serialization/dart/web-platform-support", section("OPERATE"), - "object-serialization/security", "object-serialization/dart/troubleshooting", ], @@ -345,8 +336,6 @@ const sidebars: SidebarsConfig = { "object-serialization/scala/schema-metadata", section("SCALA FEATURES"), "object-serialization/scala/default-values", - section("OPERATE"), - "object-serialization/security", ], kotlinObjectSerializationSidebar: [ @@ -361,8 +350,21 @@ const sidebars: SidebarsConfig = { section("KOTLIN FEATURES"), "object-serialization/kotlin/default-values", "object-serialization/kotlin/static-generated-serializers", + ], + + xlangObjectSerializationSidebar: [ + section("ORIENT"), + "object-serialization/xlang/index", + section("SHARED CONCEPTS"), + "object-serialization/xlang/type-system", + "object-serialization/xlang/type-identity", + "object-serialization/xlang/nullability", + "object-serialization/xlang/references", + "object-serialization/xlang/polymorphism", + "object-serialization/xlang/schema-evolution", + "object-serialization/xlang/zero-copy", section("OPERATE"), - "object-serialization/security", + "object-serialization/xlang/troubleshooting", ], generatedCodeSidebar: [ diff --git a/src/pages/404.tsx b/src/pages/404.tsx index e9fd753440..6a7091f214 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -1,10 +1,22 @@ -import React, { useEffect } from 'react'; -import { useHistory } from '@docusaurus/router'; +import React, { useEffect } from "react"; +import { useHistory } from "@docusaurus/router"; export default function NotFound() { const history = useHistory(); useEffect(() => { - history.replace('/'); + const pathname = window.location.pathname; + const locale = + pathname.match(/^\/[a-z]{2}-[A-Z]{2}(?:\/|$)/)?.[0].replace(/\/$/, "") ?? + ""; + const docs = pathname.match( + /^((?:\/[a-z]{2}-[A-Z]{2})?\/docs)(\/next)?(?:\/|$)/, + ); + const start = docs + ? `${docs[1]}${docs[2] ?? ""}/start` + : `${locale}/docs/start`; + history.replace( + pathname === start || pathname === `${start}/` ? `${locale}/` : start, + ); }, [history]); return null; } diff --git a/src/plugin/redirect.js b/src/plugin/redirect.js index 415f8d1f23..18ad511fb9 100644 --- a/src/plugin/redirect.js +++ b/src/plugin/redirect.js @@ -9,169 +9,47 @@ export default function (context, options) { attributes: { type: "text/javascript", }, - // Regex literals need doubled backslashes here so the emitted script - // retains the slash escapes required by JavaScript regex syntax. innerHTML: ` if (window.location.host === 'fury.apache.org') { window.location.href = 'https://fory.apache.org'; } - // Redirect only dev-doc routes that moved during the capability-first - // documentation migration. The unversioned route is the released 1.5.0 - // documentation, so it must retain its original paths. + // Redirect a small set of current/dev entry pages that moved in the + // capability-first documentation restructure. Released versions keep + // their original routes, and old fragments are intentionally dropped. (function() { - var path = window.location.pathname; - var match = path.match(/^((?:\\/[a-z]{2}-[A-Z]{2})?\\/docs\\/next)\\/?(.*)$/); - if (!match) { + var segments = window.location.pathname.split('/').filter(Boolean); + var docsIndex = segments[0] === 'docs' + ? 0 + : /^[a-z]{2}-[A-Z]{2}$/.test(segments[0]) && segments[1] === 'docs' + ? 1 + : -1; + if (docsIndex < 0 || segments[docsIndex + 1] !== 'next') { return; } - var prefix = match[1]; - var rest = match[2].replace(/\\/+$/, ''); - var targetHash = window.location.hash; - - var directRoutes = { + var oldPath = segments.slice(docsIndex + 2).join('/'); + var routes = { 'introduction/overview': 'introduction', 'introduction/benchmark': 'benchmarks', 'start/install': 'start', 'start/usage': 'start', - 'community/development': 'development/building', + 'guide/xlang/index': 'object-serialization/xlang', + 'guide/xlang/getting-started': 'object-serialization/xlang', + 'guide/xlang/serialization': 'object-serialization/xlang', + 'guide/java/json-support': 'json', + 'compiler/compiler-guide': 'compiler/getting-started', 'community/DEVELOPMENT': 'development/building', - 'cpp_debug': 'development/cpp-debugging', - 'security/index': 'object-serialization/security', - 'security/threat-model': 'object-serialization/security', - 'security/deserialization': 'object-serialization/deserialization-security-model', }; - var destination = directRoutes[rest]; - - if (!destination && /^compiler\\/compiler[-_]guide$/.test(rest)) { - destination = 'compiler/getting-started'; - var compilerGuideHash = targetHash.slice(1); - if (/^(command-line-interface|basic-usage|options|scan-generated-files|examples|import-path-resolution|supported-languages|output-structure|error-handling|best-practices|troubleshooting|syntax-errors|duplicate-|unknown-type-references|command-not-found|permission-denied|import-errors-in-generated-code)/.test(compilerGuideHash)) { - destination = 'compiler/cli'; - } else if (/^(build-integration|maven-java|gradle-javakotlin|python-setuptools|go-go-generate|rust-buildrs|cmake-c|bazel|dart--flutter)/.test(compilerGuideHash)) { - destination = 'compiler/build-integration'; - } - } - - if (!destination && /^compiler\\/generated[-_]code$/.test(rest)) { - destination = 'compiler/generated-code'; - var generatedRuntime = { - 'java': 'java', - 'python': 'python', - 'rust': 'rust', - 'c': 'cpp', - 'c-1': 'csharp', - 'go': 'go', - 'javascripttypescript': 'javascript', - 'swift': 'swift', - 'dart': 'dart', - 'kotlin': 'kotlin', - 'scala': 'scala', - }[targetHash.slice(1)]; - if (generatedRuntime) { - destination += '/' + generatedRuntime; - targetHash = ''; - } - } - - if (!destination && rest.indexOf('benchmarks/') === 0) { - var benchmarkParts = rest.split('/'); - var benchmarkRuntime = benchmarkParts[1]; - if (benchmarkRuntime === 'java' && benchmarkParts[2] === 'json') { - destination = 'benchmarks/json/java'; - } else if (benchmarkRuntime === 'java') { - destination = 'benchmarks/object-serialization/native/java'; - } else if (benchmarkRuntime) { - destination = 'benchmarks/object-serialization/xlang/' + benchmarkRuntime; - } - } - - if (!destination && rest.indexOf('guide/') === 0) { - var parts = rest.split('/'); - var runtime = parts[1]; - var topic = parts.slice(2).join('/').replace(/_/g, '-'); - if (runtime === 'xlang') { - var xlangTopics = { - '': '', - 'index': '', - 'serialization-index': '', - 'getting-started': '', - 'serialization': '', - 'field-nullability': 'nullability', - 'field-reference-tracking': 'references', - 'reference-tracking': 'references', - 'field-type-meta': 'type-identity', - 'row-format': '__row__', - }; - var xlangTopic = xlangTopics[topic] ?? topic; - destination = xlangTopic === '__row__' - ? 'row-format/standard' - : 'object-serialization/xlang/' + xlangTopic; - } else if (topic === 'grpc-support') { - destination = 'grpc/' + runtime; - } else if (topic === 'row-format') { - destination = 'row-format/' + runtime; - } else if (topic === 'json-support') { - destination = 'json'; - } else if (topic === 'android-support') { - destination = 'object-serialization/java/android'; - } else if (topic === 'graalvm-support') { - destination = 'object-serialization/java/graalvm'; - } else { - var renamedTopics = { - 'serialization-index': '', - 'basic-serialization': 'core-api', - 'native-serialization': 'native', - 'type-serialization': 'native', - 'xlang-serialization': 'xlang', - 'schema-idl': 'xlang', - }; - var migratedTopic = renamedTopics[topic] ?? topic; - destination = 'object-serialization/' + runtime; - if (migratedTopic && migratedTopic !== 'index') { - destination += '/' + migratedTopic; - } - } - } - - if (destination === 'json') { - var jsonHash = targetHash.slice(1); - var jsonHashRoutes = { - 'requirements-and-installation': ['json/getting-started', 'requirements-and-installation'], - 'jdk-25-and-later': ['json/getting-started', 'jdk-25-and-later'], - 'quick-start': ['json/getting-started', 'quick-start'], - 'reading-and-writing': ['json/getting-started', 'reading-and-writing-apis'], - 'generic-and-declared-types': ['json/getting-started', 'generic-types'], - 'thread-safety-and-code-generation': ['json/object-mapping', 'thread-safety-reuse-and-code-generation'], - 'object-mapping': ['json/object-mapping', 'java-object-mapping'], - 'supported-java-types': ['json/object-mapping', 'supported-java-types'], - 'builder-configuration': ['json/object-mapping', 'builder-configuration'], - 'annotations': ['json/annotations', ''], - 'naming-strategy': ['json/annotations', 'property-naming-strategy'], - 'custom-codecs': ['json/custom-codecs', ''], - 'type-validation-and-untrusted-input': ['json/security', 'type-policy-and-class-loading'], - 'limits-and-unsupported-features': ['json', 'limits-and-unsupported-features'], - 'errors-and-troubleshooting': ['json/troubleshooting', ''], - 'related-java-guides': ['json', ''], - }; - var jsonRoute = jsonHashRoutes[jsonHash]; - if (jsonRoute) { - destination = jsonRoute[0]; - targetHash = jsonRoute[1] ? '#' + jsonRoute[1] : ''; - } else if (/^(mixins|json|dynamic-object-members)/.test(jsonHash)) { - destination = 'json/annotations'; - } else if (/^(selecting-codecs|codec-)/.test(jsonHash)) { - destination = 'json/custom-codecs'; - } + var destination = routes[oldPath]; + if (!destination) { + return; } - if (destination) { - window.location.replace( - prefix + '/' + destination.replace(/^\\/+|\\/+$/g, '') + - '/' + window.location.search + targetHash - ); - } + var prefix = '/' + segments.slice(0, docsIndex + 2).join('/'); + window.location.replace( + prefix + '/' + destination + '/' + window.location.search + ); })(); // Backwards compatibility: Redirect old double "docs" URLs to cleaner URLs @@ -179,29 +57,35 @@ export default function (context, options) { // Also handles locale prefixes like /zh-CN/docs/... (function() { var path = window.location.pathname; + var segments = path.split('/').filter(Boolean); + var docsIndex = segments[0] === 'docs' + ? 0 + : /^[a-z]{2}-[A-Z]{2}$/.test(segments[0]) && segments[1] === 'docs' + ? 1 + : -1; + if (docsIndex < 0) { + return; + } + var sections = ['guide', 'introduction', 'start']; - // Match patterns like: - // /docs/docs/guide/... or /docs/next/docs/guide/... or /docs/0.14/docs/guide/... - // Also with locale: /zh-CN/docs/docs/guide/... or /zh-CN/docs/next/docs/guide/... - var localePrefix = '(?:\\\\/[a-z]{2}-[A-Z]{2})?'; - var versionPrefix = '(?:\\\\/(?:next|[0-9]+\\\\.[0-9]+(?:\\\\.[0-9]+)?))?'; + var duplicateIndex = docsIndex + 1; + var version = segments[duplicateIndex]; + if (version === 'next' || /^[0-9]+[.][0-9]+(?:[.][0-9]+)?$/.test(version)) { + duplicateIndex++; + } + if ( + segments[duplicateIndex] !== 'docs' || + sections.indexOf(segments[duplicateIndex + 1]) < 0 + ) { + return; + } - for (var i = 0; i < sections.length; i++) { - var section = sections[i]; - // Pattern: /docs/{optionalVersion}/docs/{section}/... - // Redirect to: /docs/{optionalVersion}/{section}/... - var pattern = new RegExp( - '^(' + localePrefix + '\\\\/docs' + versionPrefix + ')\\\\/docs\\\\/' + section + '(\\\\/.*)?$' - ); - var match = path.match(pattern); - if (match) { - var prefix = match[1]; - var suffix = match[2] || ''; - var newPath = prefix + '/' + section + suffix; - window.location.replace(newPath + window.location.search + window.location.hash); - return; - } + segments.splice(duplicateIndex, 1); + var newPath = '/' + segments.join('/'); + if (path.endsWith('/')) { + newPath += '/'; } + window.location.replace(newPath + window.location.search + window.location.hash); })(); `, }, --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
