Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Tech Exploration for In-Browser Node Playground #12

@amiller-gh

Description

@amiller-gh

Branching this conversation off from #9.

There is strong interest to bring a "try it in your browser" feature to the new website. We need to evaluate and choose a technical strategy to pull this off.

Deliverable from this ticket should be a fleshed out tech proposal for a node playground on nodejs.org.

Options already discussed (in order of my personal opinions on feasibility 😉):

  1. Use an existing "runnable snippets" service (Ex: Glot.io is open source and provides an API)
  2. Run it all in-browser (Ex: by bundling browserify native package shims for dummy behavior)
  3. Run our own container to execute simple programs (would like to avoid)
  4. Code dummy REPLs to only run the commends requires for specific examples.

1) Use Existing Service

Pros:

  • Security and maintenance is someone else's issue
  • Should work out of the box
  • Actually runs real code. No unexpected behavior.

Cons:

  • We become dependent on an external service (risk may be mitigated by using an open source solution)
  • Potential added complexity to the website.
  • Cost? Not sure what pricing models look like here.

2) In-Browser Solution

Pros:

  • Static! Build it once and forget it. No network, hosting, or 3rd pary required.
  • Runs "real"-ish code. Will do well enough for limited demos.
  • Bragging rights. Really shows off that Node is just JavasScript.

Cons:

  • Potential security risks?
  • Potential unexpected behavior from in-browser shims.
  • We will have to maintain it.
  • Will bloat page size (Fix: lazy loading?..)

3) Run our own container service

Pros:

  • We control it.
  • Actually runs real code. No unexpected behavior.

Cons:

  • SECURITY.
  • Time and maintenance cost.
  • We really shouldn't pick this option.

4) Dummy REPL

Pros:

  • Potentially simplest solution.
  • Doesn't actually run code, no security risk.

Cons:

  • Doesn't actually allow you to write / run code like you would want. I question if this is the ideal UX.
  • Dummy REPL may be too complex to actually handle all cases we'd want from interactive demos.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions