Skip to content

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.

Usage scenarioRecommended action
Authoring .gram recipes via CLI, renderer, or playgroundNone. 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 notificationsSee Replacement of the Gantt chart and its components.
Writing an editor client for the language serverSee Language server preview notification.
Programmatic integration of @gram-lang/kitchen or @gram-lang/analyzerSee 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 viewSee The runSheetRange string and Playground view labels.

To audit your application code, see Identify deprecated usages in your codebase.

v1.4.0

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 fieldReplacement property
steps[].timingsstep blocks in schedule.blocks
steps[].backgroundTaskspassive blocks in schedule.blocks
metrics.totalTimeschedule.totalTime
metrics.idleTimeschedule.idleTime
metrics.activeTimeschedule.activeTime
metrics.activeBreakdown, metrics.prepBreakdown, metrics.totalBreakdownStructured 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).

Previously, each step encapsulated its own timing data and passive background tasks:

for (const section of recipe.sections) {
  for (const step of section.steps) {
    if (step.type !== 'step') continue; // comments have no timing data
    draw(step.action, step.timings.start, step.timings.end);
    for (const task of step.backgroundTasks) {
      const start = step.timings.start + task.startOffset;
      draw(task.name ?? 'Timer', start, start + task.duration);
    }
  }
}

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.

import { scheduleFor } from '@gram-lang/kitchen';

const schedule = scheduleFor(recipe, chosenMode); // 'perSection', 'upfront' or 'perDay'

for (const block of schedule.blocks) {
  if (block.kind === 'prep') continue; // section mise en place (new block kind)
  const step = recipe.sections[block.section].steps[block.step];
  const label = block.kind === 'passive' ? (block.track ?? 'Timer') : step.action;
  draw(label, block.start, block.end);
}

The Build a custom UI guide provides a complete implementation example.

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 items array of each section in miseEnPlace;
  • Step execution timelines: inspect blocks in schedule.blocks (block duration is computed as end - start).
v1.4.0

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:

const { total, breakdown } = calculatePreparationTime(sections, registry);
for (const item of breakdown) show(item.label, item.duration);

Now, inspect structured mise en place items instead:

import { calculatePreparationTime, computeMiseEnPlace } from '@gram-lang/kitchen';

const { total } = calculatePreparationTime(sections, registry);
for (const entry of computeMiseEnPlace(sections, registry)) {
  for (const item of entry.items) {
    // { kind: 'gather', target: 'ingredient' | 'cookware', count, duration }
    // { kind: 'prepare', ref: { type, id }, duration }
    show(item, item.duration);
  }
}

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”
v1.4.0

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 itemRecommended 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.cssNot 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:

// Before (deprecated):
import { toGanttHTML, attachGanttInteractivity } from '@gram-lang/renderer';
container.innerHTML = toGanttHTML(compiled);
attachGanttInteractivity(container, { timeMode: 'forward', targetTime: '', isCompactMode: false });

// After (recommended):
import { runSheet } from '@gram-lang/scheduler';
import { runSheetToHTML } from '@gram-lang/renderer';

const sheet = runSheet(compiled.schedule, { graph: compiled.tasks }); // or project(...) with a serving time
container.innerHTML = runSheetToHTML(sheet, compiled);

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.

v1.4.0

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 itemRecommended 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 previewThe error property of a paused update (title, message, range), complementing standard published diagnostics.

Migration example:

// Before (deprecated):
client.onNotification('gram/previewUpdated', ({ uri, html }) => show(uri, html));

// After (recommended):
const client = new LanguageClient(id, name, serverOptions, {
  ...clientOptions,
  initializationOptions: { views: true },
});
client.sendNotification('gram/setOpenViews', { uri, viewIds: ['recipe'] });
client.onNotification('gram/viewUpdated', (update) => {
  if (update.state === 'ok') show(update.uri, update.payload);
  else pause(update.uri, update.error.title);
});
v1.4.0

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 itemRecommended replacement
playground.views.preview, runSheet, ast, json, jsonTreerenderer.outputs[id], with the output ids recipe, runSheet, ast, json and json-tree
playground.views.markdownrenderer.formats.markdown (Markdown is a format of a view, not a view)
playground.viewLabelplayground.output.views (the tabs) and playground.output.inspect (the inspector menu)
v1.5.0

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.

// Before
fillTemplate(t.renderer.runSheetRange, { min: formatDuration(480), max: formatDuration(960) }); // "8 h to 16 h"

// After
formatDurationRange(480, 960, lang); // "8–16 h"
v1.4.0

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.

v1.4.0

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:

const html = toHTML(recipe, { interactiveScaling: true });
// ...then listen to the stepper's data-scale-action buttons

After:

import { compile, applyScale } from '@gram-lang/kitchen';

const recipe = applyScale(compile(ast), 6 / 4); // from 4 portions to 6
const html = toHTML(recipe); // shows "6 portions ×1.5"

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.

v1.4.0

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:

grep -rnE "\b(timings|backgroundTasks|totalTime|idleTime|activeTime|activeBreakdown|prepBreakdown|totalBreakdown|calculatePreparationTime)\b" src/

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.