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

Add moduleDetection compiler flag to allow for changing how modules are parsed #47495

Merged
merged 10 commits into from
Mar 11, 2022

Commits on Jan 18, 2022

  1. Add moduleDetection compiler flag to allow for changing how modules a…

    …re parsed
    
    The default setting is 'auto', where JSX containing files under react-jsx and react-jsxdev are
    always parsed as modules, and esm-format files under module: node12+ are always parsed as modules,
    in addition to the 'legacy' detection mode's conditions for other files. (Declaration files are exempt from
    these new conditions)
    
    The 'legacy' mode preserves TS's behavior prior to the introduction of this flag - a file is
    parsed as a module if it contains an import, export, or import.meta expression.
    
    In addition, there is a 'force' mode that forces all non-declaration files to be parsed as modules.
    (Declaration files are still only modules if they contain a top-level import or export.)
    
    This technically breaks the parser API, but it's kinda-sorta backwards compatible so long
    as you don't need the functionality associated with more recent compiler flags.
    weswigham committed Jan 18, 2022
    Configuration menu
    Copy the full SHA
    f073cb6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    53a409b View commit details
    Browse the repository at this point in the history
  3. Fix post-merge lint

    weswigham committed Jan 18, 2022
    Configuration menu
    Copy the full SHA
    60f709b View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2022

  1. Configuration menu
    Copy the full SHA
    9ad5610 View commit details
    Browse the repository at this point in the history
  2. Rename function

    weswigham committed Feb 11, 2022
    Configuration menu
    Copy the full SHA
    6215541 View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2022

  1. Configuration menu
    Copy the full SHA
    9bd8c47 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ccb851a View commit details
    Browse the repository at this point in the history
  3. PR feedback

    weswigham committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    f9eb659 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    dcc86cc View commit details
    Browse the repository at this point in the history
  5. Fix lint and typo

    weswigham committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    e5c3dc0 View commit details
    Browse the repository at this point in the history