Skip to content

Platform context fallbacks #4292

Closed
@hmnd

Description

@hmnd

Describe the problem

  • When developing with svelte-kit dev, the event.platform object is always empty, with no great way to mock it.
  • When building using an adapter like Cloudflare Workers, event.platform is empty for prerendering.

Describe the proposed solution

Ability to provide a platform object in svelte.config.js that is

  • Substituted for event.platform when event.platform is undefined.
  • Merged with event.platform, useful for specifying optional/default platform values.
  • Both?

Alternatives considered

Perhaps allowing a 'transform' function that accepts an event may be better, in case platform needs to change based on inputs?

Importance

would make my life easier

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions