Skip to content

Hide backend-incompatible block categories on Pyodide#312

Merged
milanofthe merged 1 commit into
mainfrom
refactor/pyodide-hidden-categories
Jun 2, 2026
Merged

Hide backend-incompatible block categories on Pyodide#312
milanofthe merged 1 commit into
mainfrom
refactor/pyodide-hidden-categories

Conversation

@milanofthe
Copy link
Copy Markdown
Member

Some block categories can't work in the browser sandbox (e.g. FMI/FMU blocks that drive an external .fmu through a native runtime) but are fine on a native backend (Flask/remote). There was no way to keep them out of the in-browser Block Library.

  • PYODIDE_HIDDEN_CATEGORIES (in constants/python.ts): parsed from VITE_PYODIDE_HIDDEN_CATEGORIES (comma-separated), empty by default — no behaviour change for the default build.
  • NodeLibrary.svelte: when the active backend is pyodide, filters out nodes whose category is in that set.
  • BLOCK_CATEGORY_ORDER: adds DAE and FMI to the display order (inert when no blocks use them).

A distribution that ships browser-incompatible categories (e.g. an engine with FMI blocks) sets VITE_PYODIDE_HIDDEN_CATEGORIES=FMI and the category is offered only on a native backend. svelte-check: 0 errors/0 warnings.

@milanofthe milanofthe merged commit e9d4913 into main Jun 2, 2026
4 checks passed
@milanofthe milanofthe deleted the refactor/pyodide-hidden-categories branch June 2, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant