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

Improvements to moving source files #276

Closed
2 tasks done
dsherret opened this issue Mar 15, 2018 · 1 comment
Closed
2 tasks done

Improvements to moving source files #276

dsherret opened this issue Mar 15, 2018 · 1 comment

Comments

@dsherret
Copy link
Owner

dsherret commented Mar 15, 2018

This is talked about a bit in #199.

Right now, sourceFile.move:

  1. Needs to update...
    • import equals declarations.
    • [ ] Referenced files in the tsconfig.json.
    • [ ] <reference ... /> tags.
    • Dynamic imports ex. await import("./test");
  2. EDIT: DONE! - Does not use a graph to figure out the dependent files (This would also be nice as a standalone feature as well).
    • I have been looking at getAllDependencies in BuilderProgram, but this seems dependent on compilation (ex. returning all files when specifying the outFile or out compiler options). I think I'm just going to build up my own lazy graph... not so hard to do.
dsherret added a commit that referenced this issue Mar 18, 2018
* Adds sourceFile.getReferencingNodesInOtherSourceFiles()
* Drastically improves the performance of moving many source files.
* Updates dynamic imports.
* Updates ImportEqualsDeclarations.
dsherret added a commit that referenced this issue Mar 18, 2018
* Adds sourceFile.getReferencingNodesInOtherSourceFiles()
* Drastically improves the performance of moving many source files.
* Updates dynamic imports.
* Updates ImportEqualsDeclarations.
@dsherret
Copy link
Owner Author

dsherret commented Mar 23, 2018

I was just looking with ts-ast-viewer and there is an internal imports property on ts.SourceFile that has all the string literals for any imports. This would be way faster to use! It's ok to rely on this internal property because there will be tests in this library that would catch when this changes.

Edit: Done.

dsherret added a commit that referenced this issue Mar 23, 2018
* Improve speed of moving files for #276.
* Fixes a bug related to copying a file where it would not update the descendant dynamic imports.
dsherret added a commit that referenced this issue May 14, 2019
* Adds sourceFile.getReferencingNodesInOtherSourceFiles()
* Drastically improves the performance of moving many source files.
* Updates dynamic imports.
* Updates ImportEqualsDeclarations.
dsherret added a commit that referenced this issue May 14, 2019
* Improve speed of moving files for #276.
* Fixes a bug related to copying a file where it would not update the descendant dynamic imports.
@dsherret dsherret closed this as completed Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant