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

[DO NOT REVIEW] More module-ified compiler testing #51144

Closed
wants to merge 41 commits into from

Commits on Oct 11, 2022

  1. Configuration menu
    Copy the full SHA
    95274fb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    812331e View commit details
    Browse the repository at this point in the history
  3. CONVERSION STEP - unindent

    This step makes further commits look clearer by unindenting all of the top level namespaces preemptively.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    863d0a0 View commit details
    Browse the repository at this point in the history
  4. CONVERSION STEP - explicitify

    This step makes all implicit namespace accesses explicit, e.g. "Node" turns into "ts.Node".
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    8480dd1 View commit details
    Browse the repository at this point in the history
  5. CONVERSION STEP - stripNamespaces

    This step converts each file into an exported module by hoisting the namespace bodies into the global scope and transferring internal markers down onto declarations as needed.
    
    The namespaces are reconstructed as "barrel"-style modules, which are identical to the old namespace objects in structure. These reconstructed namespaces are then imported in the newly module-ified files, making existing expressions like "ts." valid.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    bab724b View commit details
    Browse the repository at this point in the history
  6. CONVERSION STEP - inlineImports

    This step converts as many explicit accesses as possible in favor of direct imports from the modules in which things were declared. This restores the code (as much as possible) back to how it looked originally before the explicitify step, e.g. instead of "ts.Node" and "ts.Symbol", we have just "Node" and "Symbol".
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    541e6af View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b82fb96 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f8de0e7 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    27007b4 View commit details
    Browse the repository at this point in the history
  10. Remove local ESLint rule one-namespace-per-file

    Now that we are modules, there's no reason to ban multiple namespaces
    per file; each file is its own scope and declaring a namespace won't
    merge it into any other files.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    2f8996f View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    a330c00 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    74b460e View commit details
    Browse the repository at this point in the history
  13. Add JSDoc eslint rule

    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    6a1622c View commit details
    Browse the repository at this point in the history
  14. Fix all internal JSDoc comments

    If these are regular comments, then they won't appear in our d.ts files.
    But, now we are relying on api-extractor to produce out final merged
    d.ts files, so they need to be present in the "input" d.ts files,
    meaning they have to be JSDoc comments.
    
    These comments only work today because all of our builds load their TS
    files from scratch, so they see the actual source files and their
    non-JSDoc comments.
    
    The comments also need to be attached to a declaration, not floating,
    otherwise they won't be used by api-extractor, so move them if needed.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    f7db5bb View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    58ca2d5 View commit details
    Browse the repository at this point in the history
  16. Remove typescriptServices project

    This project is the same as the (soon added) typescript project.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    0f84ad7 View commit details
    Browse the repository at this point in the history
  17. Remove generation of protocol.d.ts

    This file is unreferenced, and just a subset of tsserverlibrary.d.ts.
    What I've heard is that this was intended to be used to detect protocol
    chagnes, but, no test actually references it, and we have separate
    infrastructure in place to ensure that protocol changes get the
    attention they need.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    33fae66 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    d9d9c2f View commit details
    Browse the repository at this point in the history
  19. Get test suites running

    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    c6a71de View commit details
    Browse the repository at this point in the history
  20. Get entrypoints working

    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    bf4f6a1 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    9b39db0 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    174aa54 View commit details
    Browse the repository at this point in the history
  23. Add build via esbuild

    This configures the existing build tasks to use esbuild by defualt. If
    using the plain files is desired, passing `--bundle=false` will build
    using plain files and still produce a runnable system.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    11fe713 View commit details
    Browse the repository at this point in the history
  24. Add dts bundling

    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    5a99735 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    b1eefde View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    632c477 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    87f96d9 View commit details
    Browse the repository at this point in the history
  28. Configuration menu
    Copy the full SHA
    26dd68f View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    8205c4d View commit details
    Browse the repository at this point in the history
  30. Use jsonc-parser instead of LKG compiler in build

    Profiling the build roughly half of the time spent loading the
    build is spent importing typescript.js, for this one function.
    
    Since this stack is already adding required devDependencies, switch
    readJson to use jsonc-parser (published by the VS Code team), rather
    than importing the entire LKG typescript.js library.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    c81df40 View commit details
    Browse the repository at this point in the history
  31. Rename Gulpfile to Herebyfile for improved git diff

    The next commit will switch the build system, but git doesn't detect
    that the two config files are related.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    1ce53cd View commit details
    Browse the repository at this point in the history
  32. Change build system to hereby

    This eliminates a significant number of dependencies, eliminating all
    npm audit issues, speeding up `npm ci` by 20%, and overall making the
    build faster (faster startup, direct code is faster than streams, etc)
    and clearer to understand.
    
    I'm finding it much easier to make build changes for the module
    transform with this; I can more clearly indicate task dependencies and
    prevent running tasks that don't need to be run.
    
    Given we're changing our build process entirely (new deps, new steps),
    it seems like this is a good time to change things up.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    d69f45d View commit details
    Browse the repository at this point in the history
  33. Update baselines for corrected line endings in lib files

    The old gulpfile produced lib.d.ts files with mixed newlines, thanks to
    the files containing CRLF, but the gulp streams adding in LF.
    
    Now they're all LF, which matches every other file in built / lib, but
    our baselines are sensitive to this. Rerun the tests and accept them.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    8d90d31 View commit details
    Browse the repository at this point in the history
  34. Don't use needsUpdate for quick tasks

    needsUpdate may be wrong when the branch changes; these ones are now so
    fast thanks to being pure JS that we can just always run their contents
    and be sure that the outputs are right.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    add890f View commit details
    Browse the repository at this point in the history
  35. Modernize localize script

    This file is pretty much the same as it was when it was committed in
    2017; these days, we can write clearer code with async/await and new FS
    APIs.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    f26b10a View commit details
    Browse the repository at this point in the history
  36. Switch to faster XML parsing library for localize

    Switching to a newer/faster/maintained library speeds up this script by
    more than 50%. We can also eliminate some any and such in the process.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    8507e37 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    f57936f View commit details
    Browse the repository at this point in the history
  38. Remove mkdirp

    If our build scripts target Node 10+, we can use the builtin mkdir
    function in recursive mode instead.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    1eeba39 View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    8fc68d6 View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    157a893 View commit details
    Browse the repository at this point in the history
  41. Backport changes from monaco-editor to createPlaygroundBuild

    However, this script appears to not work as designed; the playground
    instead requests tsWorker.js, a file that we can't produce in our repo.
    
    Probably, we should just remove this script.
    jakebailey committed Oct 11, 2022
    Configuration menu
    Copy the full SHA
    a6eb3d8 View commit details
    Browse the repository at this point in the history