Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(optim/fix): only emit type declarations once #691

Merged
merged 2 commits into from
Apr 20, 2020

Commits on Apr 20, 2020

  1. (optim/fix): only emit type declarations once

    - every other emission is just a duplicate -- no need to spend compute
      time to make duplicates
      - even for the upcoming multi-entry, the same types are emitted for
        each entry as the compiler just emits types for everything in the
        `tsconfig` `include`
    
    - fixes a long-standing bug with the deprecated moveTypes() function
      that would occassionally cause types to not be properly output
      - this was actually due to moveTypes() being run multiple times in
        parallel (as well as the types themselves being emitted multiple
        times in parallel)
        - hence the EEXIST and ENOENT filesystem errors being thrown, as
          that directory was being changed multiple times in parallel
          - race conditions, fun!
      - now they're only emitted once and only moved once, so no problems!
    
    - also fixes a bug with an initial version of multi-entry where if an
      entry in a subdir of src/ were added, e.g. src/foo/bar, the entire
      tree of type declarations would get output into dist/foo/src/*.d.ts
      - alternatively, could call `moveTypes()` with an arg for each entry,
        but there's no need since all declarations get produced the first
        time around anyway
      - similar bug occurred with an initial version of `--preserveModules`
        that used separate format directories
    agilgur5 committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    db62b19 View commit details
    Browse the repository at this point in the history
  2. (optim): no need for separate cacheRoot per format

    - similarly to the previous commit, it's unnecessary and less
      performant to have a separate cacheRoot per format
      - each TS compilation occurs before the format is changed anyway, so
        at that point in the process, format is irrelevant
      - builds can now re-use cache from other formats, which resulted in
        a perf boost during testing
    agilgur5 committed Apr 20, 2020
    Configuration menu
    Copy the full SHA
    714e4bd View commit details
    Browse the repository at this point in the history