Skip to content

Make sure all code examples are runnable #7293

Closed

Description

@bmuenzenmeyer

Broken out of #7197

At Collab Summit we discussed that there have been instances of the code examples not being runnable snippets.

There are many ways we could approach this, but they all have the same characteristics:

  • execute the code samples against ACTIVE version of Node.js
  • display the code samples on the website

Whether or not the authoritative source code remains on the website or elsewhere represents work and pros/cons for website maintenance and approachability.

@bnb had some more thoughts on how to accomplish this, but I don't think we have any concrete approaches yet.

Activity

  1. AugustinMauroy commented on Nov 29, 2024

    @AugustinMauroy
    Member

    execute the code samples against ACTIVE version of Node.js

    Shouldn't we use the LTS because that's what's recommended on the home page?

  2. ovflowd commented on Nov 29, 2024

    @ovflowd
    Member

    Maybe we should add a tag on each snippet called version="current" or version="lts" so we know which version to run the snippet against.

    And then we can also visually add the label with a tooltip so people know if the latest lts or current version support said feature

  3. bmuenzenmeyer commented on Nov 30, 2024

    @bmuenzenmeyer
    ContributorAuthor

    The home page recommends 22 right now, which is ACTIVE.

  4. ovflowd commented on Nov 30, 2024

    @ovflowd
    Member

    The home page recommends 22 right now, which is ACTIVE.

    Wdym with active? 22 is LTS.

  5. bmuenzenmeyer commented on Nov 30, 2024

    @bmuenzenmeyer
    ContributorAuthor

    Screenshot_20241129_214005_Chrome.jpg

    ACTIVE

  6. AugustinMauroy commented on Nov 30, 2024

    @AugustinMauroy
    Member

    If we go back to the idea of having the version for which the document was designed in metadata. This makes it possible to keep the code functional on a given version.

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

    learnIssues/pr concerning the learn section

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions