Skip to content

Expose development vs production mode to JavaScript #748

Description

@romain-pm

Part of #734. A module has no way to know whether it is running on a developer's instance or in production, so the library cannot warn about anything only a developer would want to hear.

The immediate need is #737: buildImageUrl knows when a resize hint will be silently ignored (default provider, no Media Optimization) — the single worst image trap — but can only report it, not surface it. Same shape as any other develop-time-only diagnostic the library might add later.

The engine already computes it: ViewRenderError.isDevelopmentMode() wraps SettingsBean.getInstance().isDevelopmentMode(). It just isn't on the server bridge (GraalVMEngine.java:284 assembles those helpers).

  • Expose it, e.g. server.config.isDevelopmentMode(): boolean on ConfigHelper — or argue for a better home.
  • Type it in globals.d.ts.
  • Warn once per image whose candidates land on the inert query channel, naming the node and pointing at the images guide.

Warnings must be develop-only and must not repeat per render — production pays nothing, and a dev tailing logs should not drown.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featA new feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions