Deprecated features
This page documents all features currently deprecated across Gram, categorized by their target major removal milestone. A deprecated feature remains fully operational and maintains its exact behavior until that version. Each element provides an immediate modern replacement, enabling smooth incremental migration without sudden breaking changes.
Do you need to take action?
Section titled “Do you need to take action?”| Usage scenario | Recommended action |
|---|---|
Authoring .gram recipes via CLI, renderer, or playground | None. The recipe language syntax contains zero deprecations. |
Consuming compiled JSON (gram build, custom UI applications, scripts) | See Compiled JSON fields and Backwards compatibility with older JSON. |
| Rendering a Gantt chart, VS Code command or language server notifications | See Replacement of the Gantt chart and its components. |
| Writing an editor client for the language server | See Language server preview notification. |
Programmatic integration of @gram-lang/kitchen or @gram-lang/analyzer | See Compiled JSON fields, calculatePreparationTime, and Backwards compatibility with older JSON. |
Rendering the HTML recipe with toHTML() options (@gram-lang/renderer) | See The interactiveNutrition option and The interactiveScaling option. |
Reading the strings of @gram-lang/i18n to build a custom view | See The runSheetRange string and Playground view labels. |
To audit your application code, see Identify deprecated usages in your codebase.
Deprecations scheduled for 2.0.0
Section titled “Deprecations scheduled for 2.0.0”Compiled JSON fields
Section titled “Compiled JSON fields”Starting with version 1.4.0, a compiled recipe object exposes miseEnPlace (estimated preparation cost per section), tasks (neutral task dependency graph), and schedule (the default timeline laid out from tasks: mise en place by section, shortest passive durations).
Any alternative timeline (upfront preparation, per working day, or longest passive durations) is computed dynamically from tasks via layout(recipe.tasks, options) or scheduleFor(recipe, mode, rests), without requiring recompilation. These new properties supersede the legacy fields below:
| Deprecated field | Replacement property |
|---|---|
steps[].timings | step blocks in schedule.blocks |
steps[].backgroundTasks | passive blocks in schedule.blocks |
metrics.totalTime | schedule.totalTime |
metrics.idleTime | schedule.idleTime |
metrics.activeTime | schedule.activeTime |
metrics.activeBreakdown, metrics.prepBreakdown, metrics.totalBreakdown | Structured properties miseEnPlace and schedule |
metrics.activeTime evaluated active timers specified as ranges (~{20-25min}) at their midpoint value, matching historical behavior. Conversely, schedule.activeTime plans them using their maximum bound to ensure dinner is never late. The two values are strictly identical for recipes without ranges.
The legacy metrics.totalTime metric calculated total time assuming all preparations took place upfront. Gram tools now default to perSection: use scheduleFor(recipe, 'upfront') to obtain a value comparable to earlier behavior. Results will match unless the recipe includes intermediate ingredients (which upfront mode gathers only once produced).
Step timings and passive tasks
Section titled “Step timings and passive tasks”Previously, each step encapsulated its own timing data and passive background tasks:
Now, read scheduled blocks directly from the chosen timeline. All durations are expressed in minutes from 0 and include mise en place: they depend on the selected scheduling mode and should not be combined with legacy timings within the same chart.
The Build a custom UI guide provides a complete implementation example.
Time breakdowns
Section titled “Time breakdowns”The metrics.activeBreakdown, metrics.prepBreakdown, and metrics.totalBreakdown fields provided lists of labeled durations. This information is now directly accessible from source data:
- Preparation details: inspect the
itemsarray of each section inmiseEnPlace; - Step execution timelines: inspect blocks in
schedule.blocks(block duration is computed asend - start).
The calculatePreparationTime function
Section titled “The calculatePreparationTime function”Deprecated: the breakdown property in the return object. Recommended replacement: structured items from computeMiseEnPlace.
calculatePreparationTime(sections, registry) in @gram-lang/kitchen returns { total, breakdown }. The breakdown array contains composite string labels (ingredients_overhead, cookware_overhead, prep_<id>). This property will be removed in 2.0.0, with the function returning { total } only. Code consuming total will continue to work unchanged.
Before:
Now, inspect structured mise en place items instead:
A compiled recipe carries this identical breakdown inside its miseEnPlace field.
Replacement of the Gantt chart and its components
Section titled “Replacement of the Gantt chart and its components”The legacy Gantt chart is officially replaced by the run sheet: no Gram interface (CLI, playground, VS Code extension) draws this chart anymore, and its code is now frozen until its removal in version 2.0.0.
| Deprecated item | Recommended replacement |
|---|---|
toGanttHTML(), attachGanttInteractivity(), formatTime(), formatAxisTime(), and Gantt* types (@gram-lang/renderer) | Use run sheet rendering functions (runSheetToHTML(), runSheetToText(), runSheetToMarkdown(), runSheetToPrintHTML()) on the RunSheet object returned by runSheet(), or build a custom view from this data. |
@gram-lang/renderer/gantt.css | Not required: run sheet styles are now included directly in gram.css. |
gantt_* keys of playground.views (@gram-lang/i18n) | Not required: the run sheet uses runSheet* keys in the renderer dictionary. |
gram.showGantt command, Gram: Gantt Chart (VS Code) | gram.showRunSheet (Gram: Run Sheet). The old command opens the new view with a one-time notice. |
gram/ganttUpdated notification (language server) | Read gram/viewUpdated for the runSheet output (see Language server preview notification), or consume compiled recipe data directly. |
The toGanttHTML() function logs a one-time warning to the console when called.
Migration example:
If you need to build a custom visual timeline, sheet.recipes[0].days[].entries[] provides every block with its relative minutes from the service: see Build a custom UI.
Language server preview notification
Section titled “Language server preview notification”Deprecated: the gram/previewUpdated notification, sent to editor clients that do not declare the views protocol. Recommended replacement: adopt the views protocol (gram/setOpenViews and gram/viewUpdated).
Until version 2.0.0, clients that do not declare the protocol continue to receive HTML preview notifications for every open recipe—whether visible or hidden—along with an inline error panel whenever compilation fails. The server logs a one-time notice in its trace. Under the new views protocol, the client explicitly declares which outputs are open so the server renders only active views. If a recipe contains syntax or compilation errors, the client retains its last valid rendered state while error details appear in standard LSP diagnostics.
| Deprecated item | Recommended replacement |
|---|---|
gram/previewUpdated notification ({ uri, html }) | gram/viewUpdated for the recipe output: payload contains the rendered HTML when state: "ok", while state: "paused" indicates compilation errors. |
| Error panel rendered in place of the preview | The error property of a paused update (title, message, range), complementing standard published diagnostics. |
Migration example:
Playground view labels
Section titled “Playground view labels”Deprecated: the labels of the playground’s old view selector in @gram-lang/i18n. Recommended replacement: the names of the renderer’s outputs and formats.
The playground now shows the views of the renderer as tabs, each in its formats, and its inspectors in a menu of their own, all named by their id. The old labels keep their text until 2.0.0.
| Deprecated item | Recommended replacement |
|---|---|
playground.views.preview, runSheet, ast, json, jsonTree | renderer.outputs[id], with the output ids recipe, runSheet, ast, json and json-tree |
playground.views.markdown | renderer.formats.markdown (Markdown is a format of a view, not a view) |
playground.viewLabel | playground.output.views (the tabs) and playground.output.inspect (the inspector menu) |
The runSheetRange string
Section titled “The runSheetRange string”Deprecated: the renderer.runSheetRange string of @gram-lang/i18n ("{min} to {max}", "{min} à {max}" in French). Recommended replacement: formatDurationRange() from @gram-lang/renderer.
The run sheet used it to write the range of a wait with a word (8 h to 16 h), while the steps write the same range with an en dash (8–16 h), a writing Gram can read back. Since 1.5.0 both go through formatDurationRange(), and the string is no longer used. It keeps its text until 2.0.0.
The interactiveNutrition option
Section titled “The interactiveNutrition option”Deprecated: the interactiveNutrition option of toHTML() (@gram-lang/renderer). Recommended replacement: none needed, remove it.
The HTML recipe now shows its nutrition as a table, with every basis side by side (per portion, per 100 g) and the whole recipe under it, so there is no basis switch left to turn on. The option is still accepted and does nothing until 2.0.0. To show a single basis, set nutritionBasis.
The interactiveScaling option
Section titled “The interactiveScaling option”Deprecated: the interactiveScaling option of toHTML() (@gram-lang/renderer), and the decreasePortions, increasePortions and editPortions strings of @gram-lang/i18n that go with it. Recommended replacement: scale the recipe before rendering it.
The option draws a portions stepper (− 4 +) in the hero bar of the HTML recipe. The recipe view ships no script, so its buttons only work if the page around it handles them: in an exported file or an editor preview, they would do nothing. The view now only shows the portions, and the factor of a scaled recipe (6 portions ×1.5); setting them belongs to the surface, like every other setting.
Before:
After:
The option keeps working until 2.0.0. In the playground, the portions are set in the Quantities settings, which a click on the portions of the recipe opens.
Backwards compatibility with older JSON
Section titled “Backwards compatibility with older JSON”Deprecated: fallback resolution reading legacy metrics fields. Recommended replacement: recompile stored recipes with @gram-lang/kitchen ≥ 1.4.0.
JSON compiled with Kitchen 1.3.0 or earlier contains neither tasks nor schedule. Until version 2.0.0, scheduleTimes(compiled, mode, rests) continues to fall back to legacy metrics fields. This transition fallback will be removed in version 2.0.0.
To differentiate formats, inspect the generator metadata: recipes compiled with Kitchen ≥ 1.4.0 declare the emitting compiler ("@gram-lang/kitchen@1.4.0"), whereas older exports omit this field. Recompile stored recipes before upgrading to 2.0.0.
Identify deprecated usages in your codebase
Section titled “Identify deprecated usages in your codebase”Search your source code for deprecated identifier names. Object destructuring (const { totalTime } = recipe.metrics) is also detected:
When writing TypeScript, deprecated properties and functions from @gram-lang/kitchen are automatically struck through in modern IDEs, with the recommended replacement indicated in hover tooltips.