Skip to content

Add ts to globalThis in run.js for convenience during debugging #22

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

Closed

Conversation

jakebailey
Copy link
Owner

@jakebailey jakebailey commented Sep 13, 2022

In namespaces, we'd have access to a variable named "ts" when debugging,
because that was just the ts namespace in the current file. But when
modules, that variable doesn't exist, either because we are pure modules
(so no ts variable), or named something else (when bundled, for export).

Tack a "ts" object onto the globals, which should make this easier. Of
course, someone may eventually declare a variable in the top level scope
named "ts" and break this, but we can cross that bridge when we come to
it.


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 (this PR)
  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
  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-19 branch 3 times, most recently from 1a97904 to c388116 Compare September 20, 2022 05:06
@jakebailey jakebailey changed the title Fix up api-extractor configs, add Gulp task Add babel for let/const lowering Sep 20, 2022
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from e666aad to a88fedb Compare September 20, 2022 05:06
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch 3 times, most recently from c292ea6 to bb4001f Compare September 24, 2022 16:51
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from a88fedb to 0b39eda Compare September 24, 2022 16:51
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from bb4001f to 5813ec9 Compare September 26, 2022 23:10
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 0b39eda to 472b33b Compare September 26, 2022 23:10
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from 5813ec9 to 58f41e1 Compare September 27, 2022 21:59
@jakebailey jakebailey changed the title Add babel for let/const lowering Consolidate checks that test if the current environment is Node Sep 27, 2022
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 472b33b to 41cda7d Compare September 27, 2022 21:59
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from 58f41e1 to eac528e Compare September 28, 2022 00:37
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 41cda7d to bde0986 Compare September 28, 2022 00:37
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from eac528e to 04898d5 Compare September 28, 2022 00:45
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from bde0986 to 3ee116d Compare September 28, 2022 00:45
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from 04898d5 to 6726b3b Compare September 28, 2022 05:04
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 3ee116d to 3065851 Compare September 28, 2022 05:04
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from 6726b3b to e57029d Compare September 28, 2022 07:46
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 3065851 to 9f09312 Compare September 28, 2022 07:46
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from e57029d to 75162a2 Compare September 28, 2022 19:40
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 9f09312 to 7eb1f08 Compare September 28, 2022 19:40
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from 75162a2 to 01112ec Compare September 28, 2022 22:03
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 7eb1f08 to d46fefa Compare September 28, 2022 22:03
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from 01112ec to d4decce Compare October 3, 2022 21:41
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from d46fefa to 074ba8f Compare October 3, 2022 21:41
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from d4decce to d29dbf6 Compare October 3, 2022 23:33
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 074ba8f to 4d20fcf Compare October 3, 2022 23:34
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 1667a2e to 1b5c731 Compare October 24, 2022 23:15
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from 084b7ea to aab52d6 Compare October 25, 2022 02:24
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 1b5c731 to c35d3e3 Compare October 25, 2022 02:24
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from aab52d6 to de670ad Compare October 27, 2022 04:24
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from c35d3e3 to e5098d0 Compare October 27, 2022 04:24
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from de670ad to 384fe8d Compare October 27, 2022 17:42
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from e5098d0 to 6d97c8e Compare October 27, 2022 17:42
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from 384fe8d to 026e6e9 Compare October 28, 2022 02:24
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 6d97c8e to 2b3207e Compare October 28, 2022 02:25
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from 026e6e9 to af1a0d3 Compare October 31, 2022 21:35
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 2b3207e to d408983 Compare October 31, 2022 21:35
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from af1a0d3 to d93aadf Compare November 2, 2022 00:45
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from d408983 to 85ac80a Compare November 2, 2022 00:46
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from d93aadf to 2601d2b Compare November 2, 2022 16:57
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 85ac80a to 45ad420 Compare November 2, 2022 16:57
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from 2601d2b to fd98dd3 Compare November 2, 2022 19:47
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 45ad420 to 7b878a9 Compare November 2, 2022 19:48
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from fd98dd3 to 231f965 Compare November 6, 2022 21:52
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 7b878a9 to 3cd4a8a Compare November 6, 2022 21:52
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from 231f965 to 8e7607f Compare November 6, 2022 21:58
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 3cd4a8a to 9665d34 Compare November 6, 2022 21:58
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from 8e7607f to ba01ac8 Compare November 7, 2022 03:53
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 9665d34 to 40c61ca Compare November 7, 2022 03:53
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from ba01ac8 to cd0bfbc Compare November 7, 2022 19:28
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from 40c61ca to eaf22e3 Compare November 7, 2022 19:28
In namespaces, we'd have access to a variable named "ts" when debugging,
because that was just the ts namespace in the current file. But when
modules, that variable doesn't exist, either because we are pure modules
(so no ts variable), or named something else (when bundled, for export).

Tack a "ts" object onto the globals, which should make this easier. Of
course, someone may eventually declare a variable in the top level scope
named "ts" and break this, but we can cross that bridge when we come to
it.
@jakebailey jakebailey force-pushed the transform-stack-commit-19 branch from cd0bfbc to 423ad68 Compare November 7, 2022 21:38
@jakebailey jakebailey force-pushed the transform-stack-commit-20 branch from eaf22e3 to 96627f8 Compare November 7, 2022 21:38
@jakebailey jakebailey closed this Nov 7, 2022
@jakebailey jakebailey deleted the transform-stack-commit-20 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