Remove Slice modes Slice1 and Slice2#463
Remove Slice modes Slice1 and Slice2#463bernardnormier merged 3 commits intoicerpc:csharp-0.6-devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the Slice1/Slice2 “mode” concept from the docs site and unifies Slice documentation under a single /slice chapter, including removal of all mode-selection UI and mode-specific Markdoc tags.
Changes:
- Eliminates
Mode/mode-selection logic across Markdoc transforms, client state, navigation, and search/feedback plumbing. - Renames Slice navigation + sidebar sources from
/slice1+/slice2to/sliceand consolidates the content map. - Updates Slice docs content to remove mode-conditioned sections/pages and adjusts syntax highlighting + code fence schema accordingly.
Reviewed changes
Copilot reviewed 80 out of 80 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| WRITING_DOCS.md | Removes documentation for the addMode code fence attribute and updates nav guidance. |
| utils/prism-slice.js | Updates Prism grammar to remove Slice1-only keywords/types/constants. |
| utils/modeFromPath.ts (deleted) | Removes mode detection from URL paths. |
| types/side-bar.ts | Replaces SLICE1_BASE_URL/SLICE2_BASE_URL with SLICE_BASE_URL. |
| types/mode.ts (deleted) | Removes Mode enum and modes list. |
| types/index.ts | Stops exporting the removed mode types. |
| types/feedback.ts | Removes mode from FeedbackData. |
| markdoc/tags/title.markdoc.ts | Stops passing mode through the Title tag. |
| markdoc/tags/mode-section.markdoc.ts (deleted) | Removes {% slice1 %} / {% slice2 %} tag transforms. |
| markdoc/tags/index.ts | Stops exporting removed mode-section tags. |
| markdoc/schema.ts | Removes the ModeSection component binding. |
| markdoc/nodes/fence.markdoc.ts | Removes addMode attribute from fence schema. |
| markdoc/nodes/document.markdoc.ts | Removes mode-based heading filtering and mode propagation. |
| lib/markdown.ts | Removes slice1/slice2 slug rewriting and mode-based markdown filtering for reading time. |
| data/index.ts | Updates baseUrls, currentNavItem, and sideBarData to use /slice. |
| data/contentMap.json | Consolidates slice1/slice2 into a single slice sidebar tree and updates paths. |
| context/state.tsx | Removes Mode/Search contexts and localStorage mode persistence; keeps platform + path. |
| content/slice/language-reference/slice-grammar.md | Removes mode statements and Slice1-only constructs from grammar docs. |
| content/slice/language-reference/doc-comments.md | Updates doc-comment text/grammar for unified Slice (but leaves an inconsistency—see comments). |
| content/slice/language-guide/well-known-types.md | Removes mode-conditional text; keeps unified well-known types. |
| content/slice/language-guide/using-proxies-as-slice-types.md | Removes mode statement and mode-only sections. |
| content/slice/language-guide/type-alias.md | Removes addMode=true from code fence usage. |
| content/slice/language-guide/struct-types.md | Removes Slice1-only struct examples/notes. |
| content/slice/language-guide/sequence-types.md | Removes Slice1-only examples and addMode=true usage. |
| content/slice/language-guide/result-types.md | Removes Slice1-only warnings; keeps unified Result docs. |
| content/slice/language-guide/primitive-types.md | Removes Slice1-only AnyClass and mode-conditional sections. |
| content/slice/language-guide/parameters.md | Removes Slice1-only parameter rules and mode tags. |
| content/slice/language-guide/operation.md | Removes Slice1-only exception specification content and addMode=true usage. |
| content/slice/language-guide/module.md | Removes addMode=true from examples. |
| content/slice/language-guide/interface.md | Removes addMode=true and updates relative proxy link to /slice. |
| content/slice/language-guide/fields.md | Removes Slice1-only class/tagged-field examples. |
| content/slice/language-guide/exception.md (deleted) | Removes exceptions guide page. |
| content/slice/language-guide/enum-types.md | Removes Slice1-only sections/examples. |
| content/slice/language-guide/dictionary-types.md | Removes Slice1-only examples and addMode=true usage. |
| content/slice/language-guide/custom-types.md | Removes addMode=true and Slice1-only nullable custom type mapping section. |
| content/slice/language-guide/compilation-mode.md (deleted) | Removes compilation mode guide page. |
| content/slice/language-guide/comments.md | Removes mode mention from doc comment attach rules (but introduces a grammar typo—see comments). |
| content/slice/language-guide/class-types.md (deleted) | Removes classes guide page. |
| content/slice/language-guide/attributes.md | Removes Slice1-only slicedFormat attribute row and updates examples. |
| content/slice/index.md | Removes Slice1-vs-Slice2 intro section; keeps unified Slice intro. |
| content/slice/encoding/user-defined-types.md | Removes Slice1 class encoding section; retains unified enum/struct encoding (but has stale references—see comments). |
| content/slice/encoding/primitive-types.md | Removes Slice1-only sections; keeps unified encoding docs. |
| content/slice/encoding/overview.md | Removes compilation-mode-based encoding version discussion. |
| content/slice/encoding/operation.md | Removes Slice1-specific encoding section; keeps unified segment/stream encoding (but has a broken link—see comments). |
| content/slice/encoding/icerpc.md | Removes Slice1-specific payload description and ServiceAddress Slice1 encoding/decoding sections. |
| content/slice/encoding/exceptions.md (deleted) | Removes exceptions encoding page. |
| content/slice/encoding/encoding-only-constructs.md | Removes Slice1 variable-length size section; keeps bit sequence/segment. |
| content/slice/encoding/constructed-types.md | Removes mode wrappers and Slice1-only sequence encoding section. |
| content/slice/basics/slice-files.md | Removes addMode=true from examples. |
| content/slice/basics/examples.md | Removes mode-conditioned examples and addMode=true from fences. |
| content/icerpc/slic-transport/protocol-frames.md | Updates Slice link from /slice2 to /slice. |
| content/icerpc/invocation/service-address.md | Updates relative proxies link to /slice. |
| content/icerpc/icerpc-protocol/mapping-rpcs-to-streams.md | Updates Slice link from /slice2 to /slice. |
| content/icerpc/icerpc-protocol/connection-shutdown.md | Updates Slice link from /slice2 to /slice. |
| content/icerpc/icerpc-protocol/connection-establishment.md | Updates Slice link from /slice2 to /slice. |
| content/icerpc/ice-protocol/protocol-frames.md | Replaces Slice snippets with TODO placeholders and adjusts wording re: encoding (needs follow-up—see comments). |
| content/icerpc-for-ice-users/slice/new-slice.md (deleted) | Removes “New Slice” page. |
| content/icerpc-for-ice-users/slice/ice-object.md | Replaces Slice snippet with TODO placeholder (needs follow-up—see comments). |
| content/icerpc-for-ice-users/slice/converting-ice-into-slice.md (deleted) | Removes conversion guide page. |
| content/icerpc-for-ice-users/rpc-core/ice-identity.md | Replaces Slice snippet with Ice IDL snippet for Identity. |
| content/icerpc-for-ice-users/index.md | Removes card linking to the deleted conversion guide. |
| content/icerpc-for-ice-users/high-level-comparison/using-icerpc-with-ice.md | Replaces interop guidance with “TBD” placeholder (needs follow-up—see comments). |
| content/icerpc-for-ice-users/high-level-comparison/new-features.md | Updates wording around new Slice and .slice extension. |
| components/tags/mode-section.tsx (deleted) | Removes client component that conditionally rendered content by mode. |
| components/slice-selector.tsx (deleted) | Removes Slice mode selector UI component. |
| components/shell/top-navigation/top-navigation-item.tsx | Updates active-path logic for /slice. |
| components/shell/top-navigation/top-nav-items.tsx | Makes Slice nav item always link to /slice. |
| components/shell/top-navigation/mobile-menu.tsx | Makes Slice menu item always link to /slice and removes mode dependency. |
| components/shell/side-navigation/side-nav.tsx | Removes slice selector rendering from side nav. |
| components/shell/side-navigation/side-nav-selector.tsx (deleted) | Removes side-nav mode selector wrapper. |
| components/shell/side-navigation/mobile-side-nav.tsx | Removes slice selector from mobile side nav. |
| components/shell/search-button.tsx | Removes mode-filtered Algolia search behavior and embedded mode selector. |
| components/shell/feedback/feedback-form.tsx | Stops sending mode in feedback payload. |
| components/nodes/document.tsx | Removes mode prop from Document node typing. |
| components/nodes/app-link.tsx | Removes slice link rewriting and mode-setting on click. |
| components/index.ts | Stops exporting removed ModeSection component. |
| components/code-block.tsx | Removes addMode support and mode-based first-line injection. |
| app/layout.tsx | Updates navigation structured data URL for Slice from /slice2 to /slice. |
| app/api/feedback/route.ts | Removes mode field from feedback email content. |
| app/[...slug]/page.tsx | Stops generating slice1/slice2 paths and allows /slice routing. |
Comments suppressed due to low confidence (3)
content/slice/encoding/operation.md:43
- The link reference
[tagged field]: user-defined-types#class-tagged-fieldpoints to an anchor that no longer exists inuser-defined-types.mdafter removing the class section. Please update this reference to the correct section that describes tagged field/parameter encoding (or add an appropriate anchor) so the link doesn’t 404.
content/slice/encoding/user-defined-types.md:173 - These link references appear stale after removing Slice modes/attributes:
operation#slicedformat-attributeno longer exists incontent/slice/language-guide/operation.md, andencoding-only-constructs#variable-length-sizewas removed. Please remove or update these references (and any related text) to avoid broken links.
content/slice/language-reference/doc-comments.md:54 - The lexical grammar no longer defines
throws_keyword, but the syntactic grammar still includesThrowsBlockand usesthrows_keyword. Please either restore the missing lexical token or remove/adjust the ThrowsBlock production to keep the grammar consistent with the updated Slice feature set.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Frames and types from this page are defined using [Slice]. | ||
|
|
||
| The header is a compact struct defined as follows: | ||
|
|
||
| ```slice | ||
| mode = Slice1 | ||
|
|
||
| compact struct HeaderData { | ||
| magic: int32 // always 0x49 0x63 0x65 0x50 i.e. "IceP". | ||
| protocolMajor: uint8 // always 1 | ||
| protocolMinor: uint8 // always 0 | ||
| encodingMajor: uint8 // always 1 | ||
| encodingMinor: uint8 // always 0 | ||
| frameType: FrameType | ||
| compressionStatus: uint8 | ||
| frameSize: int32 | ||
| } | ||
|
|
||
| enum FrameType { // encoded on a single byte | ||
| Request = 0 | ||
| BatchRequest = 1 | ||
| Reply = 2 | ||
| ValidateConnection = 3 | ||
| CloseConnection = 4 | ||
| } | ||
| ``` | ||
| TODO: ice definitions | ||
|
|
There was a problem hiding this comment.
The file now contains placeholder text (TODO: ice definitions) where the Ice frame/type definitions should be. This leaves the documentation incomplete and also makes the earlier statement “Frames and types from this page are defined using Slice” unverifiable. Please replace these TODO blocks with the intended definitions (likely in Ice IDL syntax) or remove/rework the surrounding text so the page is self-contained.
| With IceRPC, a Slice interface does not have any implicit base interface, and `Ice::Object` is just a regular interface: | ||
|
|
||
| ```slice | ||
| mode = Slice1 | ||
|
|
||
| [cs::namespace("IceRpc.Slice.Ice")] | ||
| module Ice | ||
|
|
||
| /// Provides 3 ice_ operations. Services implemented with Ice or that offer compatibility with Ice implement this | ||
| /// interface. | ||
| [cs::identifier("IceObject")] | ||
| interface Object { | ||
| /// Gets the Slice type IDs of all the interfaces implemented by the target service. | ||
| /// @returns: The Slice type IDs of all these interfaces, sorted alphabetically. | ||
| idempotent ice_ids() -> Sequence<string> | ||
|
|
||
| /// Tests whether the target service implements the specified interface. | ||
| /// @param id: The Slice type ID of the interface to test against. | ||
| /// @returns: True when the target service implements this interface; otherwise, false. | ||
| idempotent ice_isA(id: string) -> bool | ||
|
|
||
| /// Pings the service. | ||
| idempotent ice_ping() | ||
| } | ||
| ``` | ||
| TODO: show Object.ice | ||
|
|
There was a problem hiding this comment.
This page still has a TODO: show Object.ice placeholder. If this is meant to replace the previous Slice snippet, please include the actual Ice IDL definition (or a link to the canonical source) so readers can understand the interface shape without relying on missing content.
| TBD: Ice IDL and encoding support. | ||
|
|
There was a problem hiding this comment.
The content includes a TBD: Ice IDL and encoding support. placeholder, which makes this guide incomplete. Please either restore a minimal explanation of how IceRPC interoperates with Ice (and what “Ice IDL” support means here) or remove the placeholder and link to the relevant docs/issues.
| TBD: Ice IDL and encoding support. | |
| Here, support for Ice IDL means support for services and data types defined with Slice, the interface definition | |
| language used by Ice. When an IceRPC application and an Ice application use compatible Slice definitions, they can | |
| exchange requests and responses using the Ice protocol and Ice encodings. | |
| As a result, interop is based on sharing the same contract and wire format rather than on using the same runtime | |
| library. IceRPC applications can communicate with Ice applications as long as both sides use compatible Slice | |
| definitions and stay within the interop limitations described below. |
| splitPath.pop(); | ||
| } | ||
|
|
||
| // For 'slice' base, create paths for 'slice1' and 'slice2' | ||
| if (base === 'slice') { | ||
| const slice1Slug = splitPath | ||
| .map((part) => (part === 'slice' ? 'slice1' : part)) | ||
| .slice(1); | ||
| const slice2Slug = splitPath | ||
| .map((part) => (part === 'slice' ? 'slice2' : part)) | ||
| .slice(1); | ||
| paths.push({ params: { slug: slice1Slug } }); | ||
| paths.push({ params: { slug: slice2Slug } }); | ||
| } else { | ||
| paths.push({ params: { slug: splitPath.slice(1) } }); | ||
| } | ||
| paths.push({ params: { slug: splitPath.slice(1) } }); | ||
| } |
There was a problem hiding this comment.
With Slice modes removed, generateStaticParams no longer produces /slice1/** or /slice2/** routes. As a result, existing inbound links/bookmarks to the old URLs will 404 unless there’s a redirect layer elsewhere. Consider adding redirects (e.g., /slice1/... and /slice2/... -> /slice/...) to preserve compatibility.
There was a problem hiding this comment.
I don't think we should worry about this.
|
|
||
| A slice file consists of any number of [file attributes][attribute] and at most one [mode statement][mode-statement]. | ||
| File attributes can appear both before and after the mode statement. | ||
| A slice file consists of any number of [file attributes][attribute]. |
There was a problem hiding this comment.
All this Language Reference is currently not published.
| {% slice1 %} | ||
|
|
||
| ## Encoding a ServiceAddress {% icerpcSlice=true %} | ||
|
|
There was a problem hiding this comment.
We could reuse this information later in the IceRPC for Ice users chapter, although a full description of the Ice encoding of proxies and endpoints sounds over the top.
Since the Ice IDL doesn't support custom types, you can't encode/decode a ServiceAddress with Ice; instead, you encode/decode a proxy, such as IceObjectProxy.
| splitPath.pop(); | ||
| } | ||
|
|
||
| // For 'slice' base, create paths for 'slice1' and 'slice2' | ||
| if (base === 'slice') { | ||
| const slice1Slug = splitPath | ||
| .map((part) => (part === 'slice' ? 'slice1' : part)) | ||
| .slice(1); | ||
| const slice2Slug = splitPath | ||
| .map((part) => (part === 'slice' ? 'slice2' : part)) | ||
| .slice(1); | ||
| paths.push({ params: { slug: slice1Slug } }); | ||
| paths.push({ params: { slug: slice2Slug } }); | ||
| } else { | ||
| paths.push({ params: { slug: splitPath.slice(1) } }); | ||
| } | ||
| paths.push({ params: { slug: splitPath.slice(1) } }); | ||
| } |
There was a problem hiding this comment.
I don't think we should worry about this.
InsertCreativityHere
left a comment
There was a problem hiding this comment.
Didn’t run it locally, but all the changes look good to me!
This is a comprehensive removal of the Slice mode, and all of the Slice1 mode documentation.
Slice is now a regular chapter, just like IceRPC and Protobuf. All the Slice1/Slice2 selector logic was also removed.
Other changes for 0.6, such as cs::internal => cs::public, are not included in this update.