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

fix(cache): invalidate codeCache in most cases when imports change #369

Merged

Commits on Jun 26, 2022

  1. fix(cache): invalidate declarations when imports change

    - previously, the `checkImports` flag was set to `true` for type-checking, but `false` for compilation
      - I _believe_ it is `false` because the compiled JS shouldn't change if an import changes
        - though I'm not sure if that was the original intent behind the code
      - problematically though, compilation results can include declarations, and those _can_ change if imports change
        - for instance, the types of an import can change the declaration that is output
      - so now, only set it to `false` for compilation if declarations are _not_ needed
    agilgur5 committed Jun 26, 2022
    Configuration menu
    Copy the full SHA
    2340c86 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2022

  1. add !isolatedModules check as well

    - ezolenko gave a good example of enums, which can indeed cause the compiled JS code to change based on imports
      - so also check `!isolatedModules` as well
      - I thought it might be the case that the code wouldn't handle other edge cases, but couldn't think of one off the top of my head
        - ironically, I compared it to Babel, which transpiles per file, and Babel _requires_ `isolatedModules` to work
    agilgur5 committed Jul 2, 2022
    Configuration menu
    Copy the full SHA
    2873ea6 View commit details
    Browse the repository at this point in the history