GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support single-module transpilation mode · Issue #2499 · microsoft/TypeScript

Support single-module transpilation mode #2499

New issue
Copy link
New issue
Copy link
Closed
Closed
Support single-module transpilation mode#2499
Copy link
Labels
CommittedThe team has roadmapped this issueThe team has roadmapped this issueDomain: APIRelates to the public API for TypeScriptRelates to the public API for TypeScriptSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
TypeScript 1.5.3

Description

@mhegazy
Mohamed Hegazy (mhegazy)
opened on Mar 26, 2015
Issue body actions

The compiler does not do emit based on semantic information in most cases. this allows us to provide an api for transpiling a module that does not require typecheck or full program information. just single file syntactic transformation.
This can be helpful in multiple scenarios, including: typescript-simple (https://github.com/teppeis/typescript-simple), JSPM (#2233), es6-module-loader and as atom extensions.

A new compiler flag (--singeFileTranspilation or --disableFullProgramOptimizations for instance) that will make cases that break single file-transpilation an error namely: 1.Const enums defined in ambient modules and 2.Re-exporting types-only constructs when targeting ES6

Reacted by Herrington Darkholme

Activity

  1. Mohamed Hegazy (mhegazy)
    added
    SuggestionAn idea for TypeScriptAn idea for TypeScript
    In DiscussionNot yet reached consensusNot yet reached consensus
    Domain: APIRelates to the public API for TypeScriptRelates to the public API for TypeScript
    on Mar 26, 2015
  2. sophiajt commented on Mar 26, 2015

    @sophiajt
    Sophia J. Turner (sophiajt)
    on Mar 26, 2015
    Contributor
    More actions

    👍 though we need a good name for the flag :)

  3. Mohamed Hegazy (mhegazy)
    added this to the TypeScript 1.5 milestone on Mar 31, 2015
  4. Mohamed Hegazy (mhegazy)
    assigned
    Vladimir Matveev (vladima)
    on Mar 31, 2015
  5. vladima commented on Mar 31, 2015

    @vladima
    Vladimir Matveev (vladima)
    on Mar 31, 2015
    Contributor
    More actions

    Proposed implementation #2550.
    Regarding the name of the flag: we've already had a long discussion about possible names but all options were non-ideal, Some names that we've tried are: 'separateCompilation', 'singleFileEmit', 'disablGlobalOptimizations', 'safeForTranspile', 'isolated', 'singleFileScope' - we could not pick one since all of them were equally bad. What about moving from the boolean flag and instead have an enum named 'compilationMode' or 'compilationUnit' or something similar? Enum values will be 'program' and 'file' and 'program' will be default.

    tsc a.ts b.ts --compilationUnit: file

  6. Mohamed Hegazy (mhegazy)
    modified the milestones: TypeScript 1.5, This milestone has been deleted on Apr 23, 2015
  7. Sophia J. Turner (sophiajt)
    changed the title [-]Support single-module transplantation mode[/-] [+]Support single-module transpilation mode[/+] on Apr 28, 2015
  8. Ciantic commented on May 3, 2015

    @Ciantic
    Jari Pennanen (Ciantic)
    on May 3, 2015
    More actions

    Visual Studio Code does not transpile on save. And I suppose it's because TSC does not implement this. It's major pain to transpile and compile all files each time, it causes a lot of file changes and triggers many webpack/browserify processes, time from edit to F5 is really big.

    Only tool doing single file transpiling at the moment is atom-typescript, but it's not using TSC for that.

    Btw, it probably should be called "--singleModuleTranspile" because single file transpile is not same thing, if I understod this right.

  9. mhegazy commented on May 5, 2015

    @mhegazy
    Mohamed Hegazy (mhegazy)
    on May 5, 2015
    ContributorAuthor
    More actions

    Vladimir Matveev (@vladima) we will need another check for reexporting type-only names in ES6 and in singleFile mode. we also need to update the name of the flag after the next desing meeting discussion.

  10. mhegazy commented on May 19, 2015

    @mhegazy
    Mohamed Hegazy (mhegazy)
    on May 19, 2015
    ContributorAuthor
    More actions

    PR #3208 renames the flag to --isolatedModules

  11. Ryan Cavanaugh (RyanCavanaugh)
    added
    CommittedThe team has roadmapped this issueThe team has roadmapped this issue
    and removed
    In DiscussionNot yet reached consensusNot yet reached consensus
    on May 19, 2015
  12. mhegazy commented on May 22, 2015

    @mhegazy
    Mohamed Hegazy (mhegazy)
    on May 22, 2015
    ContributorAuthor
    More actions

    The flag has been renamed to --isolatedModules see PR #3208 for more details.

  13. Mohamed Hegazy (mhegazy)
    closed this as completedon May 22, 2015
  14. microsoft
    locked and limited conversation to collaborators on Jun 18, 2018
  15. TypeScript Bot (typescript-bot)
    unassigned
    Vladimir Matveev (vladima)
    on Jun 18, 2018
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

    CommittedThe team has roadmapped this issueThe team has roadmapped this issueDomain: APIRelates to the public API for TypeScriptRelates to the public API for TypeScriptSuggestionAn idea for TypeScriptAn idea for TypeScript

    Type

    No type

    Projects

    No projects

      Milestone

      • TypeScript 1.5.3

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.