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

Ensure ts object passed to plugins contains deprecatedCompat declarations #32

Closed

Conversation

jakebailey
Copy link
Owner

@jakebailey jakebailey commented Oct 3, 2022

We pass the entire "ts" object into plugins. However, we need to make
sure that that object contains the debug compat helpers.

In the old codebase, the deprecated compat code would tack things onto
the actual ts object, after the server code was executed, and later that
same object would be given to plugins.

But in modules, each TS project only sees the view of the "ts" namespace
that their references implied, not the ts object as some sort of
singleton. To ensure that plugins get the debug compat code, we have to
bring that into each project's view of the ts namespace, and not add it
on later in the executable projects.


Please do not comment on this PR. Depending on how this set of PRs evolves, this PR's contents may change entirely based on the order of commits.

This PR is a part of a stack:

  1. Make a few changes to allow all code to be loaded as one project
  2. Explicitly reference ts namespace in tsserverlibrary
  3. Generated module conversion step - unindent
  4. Generated module conversion step - explicitify
  5. Generated module conversion step - stripNamespaces
  6. Generated module conversion step - inlineImports
  7. Generated module conversion step - .git-ignore-blame-revs
  8. Add gitlens settings suggestion
  9. Make processDiagnosticMessages generate a module
  10. Fix up linting, make lint clean
  11. Undo changes needed to load codebase into ts-morph
  12. Add JSDoc eslint rule
  13. Fix all internal JSDoc comments
  14. Convert require calls to imports
  15. Remove typescriptServices, protocol.d.ts, typescript_standalone.d.ts
  16. Get codebase building pre bundling
  17. Add build via esbuild
  18. Add dts bundling
  19. Consolidate checks that test if the current environment is Node
  20. Add ts to globalThis in run.js for convenience during debugging
  21. Rename Gulpfile to Herebyfile for improved git diff
  22. Change build system to hereby
  23. Update baselines for corrected line endings in lib files
  24. Use jsonc-parser instead of LKG compiler in build
  25. Modernize localize script, use new XML library
  26. Don't use needsUpdate for quick tasks
  27. Remove mkdirp
  28. Export ts namespace from tsserver for hacky-post patching
  29. Directly import namespaces for improved esbuild output
  30. Ensure ts object passed to plugins contains deprecatedCompat declarations (this PR)
  31. Move compiler-debug into Debug namespace, which allows the compiler to be tree shaken
  32. Remove Promise redeclaration
  33. Remove globalThisShim and globalThis modification for TypeScriptServicesFactory
  34. Disable slow CodeQL queries
  35. Remove outFiles from launch.json
  36. Remove dynamicImport and setDynamicImport

@jakebailey jakebailey force-pushed the transform-stack-commit-29 branch 5 times, most recently from 68929dd to 5d22fdb Compare October 10, 2022 17:10
@jakebailey jakebailey changed the title Restore self-compilation using built compiler in CI tests Rename Gulpfile to Herebyfile for improved git diff Oct 10, 2022
@jakebailey jakebailey changed the title Rename Gulpfile to Herebyfile for improved git diff Use jsonc-parser instead of LKG compiler in build Oct 10, 2022
@jakebailey jakebailey force-pushed the transform-stack-commit-30 branch 2 times, most recently from b124ac1 to 435ba70 Compare October 10, 2022 22:54
@jakebailey jakebailey changed the title Use jsonc-parser instead of LKG compiler in build Rename Gulpfile to Herebyfile for improved git diff Oct 14, 2022
@jakebailey jakebailey changed the title Directly import namespaces for improved esbuild output Ensure ts object passed to plugins contains deprecatedCompat declarations Oct 24, 2022
…ions

We pass the entire "ts" object into plugins. However, we need to make
sure that that object contains the debug compat helpers.

In the old codebase, the deprecated compat code would tack things onto
the actual ts object, after the server code was executed, and later that
same object would be given to plugins.

But in modules, each TS project only sees the view of the "ts" namespace
that their references implied, not the ts object as some sort of
singleton. To ensure that plugins get the debug compat code, we have to
bring that into each project's view of the ts namespace, and not add it
on later in the executable projects.
@jakebailey jakebailey closed this Nov 7, 2022
@jakebailey jakebailey deleted the transform-stack-commit-30 branch November 7, 2022 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant