Skip to content

Generated module conversion step - stripNamespaces #5

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 May 18, 2022

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.


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 (this PR)
  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
  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-4 branch from 91e8c22 to 8885adb Compare May 18, 2022 00:02
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from a931d75 to d4f7962 Compare May 18, 2022 00:02
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 8885adb to 0e1d400 Compare May 18, 2022 22:03
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from d4f7962 to 4d57e12 Compare May 18, 2022 22:03
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 0e1d400 to d0b989b Compare May 19, 2022 01:31
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 4d57e12 to 24f0324 Compare May 19, 2022 01:31
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from d0b989b to 1ab00db Compare May 25, 2022 01:21
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 24f0324 to b55f5c1 Compare May 25, 2022 01:21
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 1ab00db to 6a10437 Compare May 25, 2022 02:40
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from b55f5c1 to b9b79ec Compare May 25, 2022 02:40
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 6a10437 to 65d3c7d Compare May 25, 2022 21:06
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from b9b79ec to 0cad571 Compare May 25, 2022 21:06
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 65d3c7d to 998d77a Compare May 25, 2022 21:09
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 0cad571 to 99635f8 Compare May 25, 2022 21:09
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 998d77a to c9d5bf0 Compare May 25, 2022 21:10
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 99635f8 to c8f247b Compare May 25, 2022 21:10
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from c9d5bf0 to 13ef966 Compare May 25, 2022 21:43
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from c8f247b to 4264477 Compare May 25, 2022 21:43
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 13ef966 to aed7990 Compare May 25, 2022 21:45
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 4264477 to 94efec6 Compare May 25, 2022 21:45
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from aed7990 to 1a405d2 Compare May 26, 2022 03:15
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 94efec6 to e36e5ef Compare May 26, 2022 03:15
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 1a405d2 to f154eb7 Compare May 26, 2022 21:56
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from e36e5ef to a7aa767 Compare May 26, 2022 21:56
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from f154eb7 to 6cf63ac Compare May 27, 2022 04:15
@jakebailey jakebailey changed the title CONVERSION STEP - inlineImports [4/8] CONVERSION STEP - inlineImports May 27, 2022
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from a7aa767 to 329f521 Compare May 27, 2022 04:15
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 6cf63ac to 89d1af6 Compare May 27, 2022 04:16
@jakebailey jakebailey changed the title [4/8] CONVERSION STEP - inlineImports [5/8] CONVERSION STEP - inlineImports May 27, 2022
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 329f521 to 2313137 Compare May 27, 2022 04:16
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from ec84a52 to 2ac68f9 Compare October 27, 2022 04:18
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 7329445 to 2b3e70f Compare October 27, 2022 04:18
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 2ac68f9 to d12318c Compare October 27, 2022 17:31
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 2b3e70f to 5a2ca2c Compare October 27, 2022 17:32
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from d12318c to 5e3513d Compare October 27, 2022 17:36
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 5a2ca2c to 2f88db2 Compare October 27, 2022 17:36
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 5e3513d to 77a2601 Compare October 28, 2022 02:18
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 2f88db2 to bdff460 Compare October 28, 2022 02:19
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 77a2601 to 408dd2a Compare October 31, 2022 21:29
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from bdff460 to 312b309 Compare October 31, 2022 21:29
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 408dd2a to 999d5e8 Compare November 2, 2022 00:39
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 312b309 to 054cfb6 Compare November 2, 2022 00:40
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 999d5e8 to f7c6d49 Compare November 2, 2022 16:51
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 054cfb6 to 4b63095 Compare November 2, 2022 16:51
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from f7c6d49 to 5c6d677 Compare November 2, 2022 19:41
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 4b63095 to f17f50a Compare November 2, 2022 19:42
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 5c6d677 to 41e599e Compare November 6, 2022 21:51
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from f17f50a to 8e611f8 Compare November 6, 2022 21:52
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 41e599e to 52d5cfc Compare November 6, 2022 21:57
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 8e611f8 to 70b4b5e Compare November 6, 2022 21:57
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 52d5cfc to c890e6f Compare November 7, 2022 03:52
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from 70b4b5e to b48ab3d Compare November 7, 2022 03:52
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from c890e6f to 7310192 Compare November 7, 2022 19:27
@jakebailey jakebailey force-pushed the transform-stack-commit-5 branch from b48ab3d to 46802eb Compare November 7, 2022 19:27
@jakebailey jakebailey force-pushed the transform-stack-commit-4 branch from 7310192 to dc25bdf Compare November 7, 2022 21:37
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 jakebailey force-pushed the transform-stack-commit-5 branch from 46802eb to ec16755 Compare November 7, 2022 21:37
@jakebailey jakebailey deleted the branch transform-stack-commit-4 November 7, 2022 23:54
@jakebailey jakebailey closed this Nov 7, 2022
@jakebailey jakebailey deleted the transform-stack-commit-5 branch November 7, 2022 23:54
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