Skip to content

Developer API for versioning / deploying REPL examples #842

Open
@bryanmylee

Description

@bryanmylee

The process of managing, updating, and deploying code examples with the REPL is quite fragile and cumbersome.

A simple developer API for managing project examples and deploying them to the REPL would be nice. It should also provide a unified experience for Svelte package developers to provide

Features

Ideally, we would want certain features to streamline the process of building documentation examples.

  1. Let users specify a project folder on the REPL to store all examples for a given project (this would require an extension to the REPL for folders)
  2. Generate an access token to allow writes to the project folder for CI / CD.
  3. Configure the documentation project to specify the project ID.
  4. Write code examples as Svelte files with some metadata to specify the example ID, Svelte environment, REPL title, etc.
  • We could even automatically resolve imports to include all the required files for an example
  1. Provide a custom store / component that gets a link to the correct REPL when given the example ID, which the user can then embed in their documentation
  • This could even be a re-direct link in the format of svelte.dev/repl/{project-id}/{example-id}
  1. Provide CI tools to deploy code examples onto the REPL

Benefits

It encourages Svelte package developers to more readily provide code examples due to the accessibility of the REPL. In the long run, it should improve the Svelte ecosystem.

Potential issues

Given the niche applicability of the use case, the added complexity to the REPL might not be warranted.

This may also not be in the spirit of the REPL, as it should be a simple playground to try new Svelte things. However, the complexity should be completely hidden to average users and the end experience should remain simple.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions