Skip to content

Support using the target + lib options to resolve d.ts per playground session #7

Closed

Description

@orta

I was trying to help someone with a problem using Object.entries but the playground didn't think it existed. The options panel is great, but doesn't offer a way to specify the lib option. This is a fairly troublesome issue when trying to help people with their modern, up-to-date code.

Perhaps a short-term easy fix would be to default to the latest libs?

Eventually, being able to specify libs (or even a full tsconfig.json as suggested in #4) would probably be best.

Activity

  1. added
    PlaygroundIssues that affect the Playground
    and removed
    PlaygroundIssues that affect the Playground
    on Jul 10, 2019
  2. orta commented on Jul 11, 2019

    @orta
    ContributorAuthor

    I've added the extra paragraph from your original post 👍

  3. orta commented on Mar 23, 2020

    @orta
    ContributorAuthor

    This got update to ES2015 - so for now I'll close it

  4. orta commented on Mar 23, 2020

    @orta
    ContributorAuthor

    I've been using this as the catch-all for grabbing the right lib files for the TS Playground - so we'll keep it here

  5. changed the title [-]Add support for lib options to the playground[/-] [+]Support using the target + lib options to resolve d.ts fires uniquely per playground session[/+] on Mar 23, 2020
  6. apieceofbart commented on Jun 15, 2020

    @apieceofbart

    What about stuff like Array.prototype.includes ?

  7. orta commented on Jun 15, 2020

    @orta
    ContributorAuthor

    That's what this issue is about - I shipped a deploy change which makes the nightly builds use the ESNext build last week, so you can test out what it will be like for 4.0 here: https://www.staging-typescript.org/play?ts=next

  8. apieceofbart commented on Jun 15, 2020

    @apieceofbart

    Orta Therox (@orta) wow, this looks awesome! thanks a lot!

  9. changed the title [-]Support using the target + lib options to resolve d.ts fires uniquely per playground session[/-] [+]Support using the target + lib options to resolve d.ts per playground session[/+] on Jun 25, 2020
  10. orta commented on Jun 26, 2020

    @orta
    ContributorAuthor

    microsoft/monaco-typescript#64 - will unblock this feature

  11. iugo commented on Jan 30, 2021

    @iugo

    use Object.fromEntries()

    setting: "lib": ["ES2019"]

  12. orta commented on Mar 10, 2021

    @orta
    ContributorAuthor

    This is in

  13. adaamz commented on Mar 29, 2021

    @adaamz

    Orta Therox (@orta) I don't see the lib option in TSConfig options tab, was this added or what is the resolution for this issue?

  14. orta commented on Mar 29, 2021

    @orta
    ContributorAuthor

    You can use twoslash notation to define your own lib: // @lib: ["thing", "other"] - I'm not sure if I'll ever give it a UI

  15. majellin24 commented on Feb 8, 2022

    @majellin24

    For anyone arriving here looking for how to enable this like me, I was not able to use the notation mentioned above like:
    // @lib: ["thing", "other"]

    I tried several variations and other settings changed before bothering to look into some of the other tickets in which this was mentioned.

    To potentially save someone a few minutes, the way I was able to get it to work was the following:

    /// <reference lib="es2015" />
    /// <reference lib="dom" />
    
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

    PlaygroundIssues that affect the Playground

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions