Skip to content

Declaration emitter cleanup - #4068

Closed
Mohamed Hegazy (mhegazy) wants to merge 61 commits into
masterfrom
declarations
Closed

Declaration emitter cleanup#4068
Mohamed Hegazy (mhegazy) wants to merge 61 commits into
masterfrom
declarations

Conversation

@mhegazy

Copy link
Copy Markdown
Contributor

This is the first set of changes to get declaration bundling working. the first step is to split the emitter logic into two phases; the first to collect declarations that we need to emit (preprocess) and the second to write them (write). With these changes there should not be any functional changes, just error messages and reporting differences. I will be sending out changes to support --out with --module for declaration and then another set for bundling.

Note for reviewers, declarationEmitter.ts has changed significantly, so i would look at the file as whole instead of diffs. changes to other files are fairly limited though, so diffs should be sufficient.

Comment thread src/compiler/checker.ts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use named parameters here.

@DanielRosenwasser

Copy link
Copy Markdown
Member

In declarationEmitter.ts:

  • Replace all "handel" with "handle"
  • Replace all "infered" with "inferred"
  • Replace all "diffrent" with "different"
  • See where else we use lambdas that do nothing if you find any, let's see if we can move emptyHandler to utilities.ts.
  • Use a for-of in visitExportDeclaration.
  • I'm not sure how consistent action is with the rest of our codebase. I think we've just used visit and callback.
  • Rename reportUnamedDeclarationMessage to reportUnnamedDeclarationMessage.
  • Rename collectDeclatation with collectDeclaration or aggregateDeclaration.
  • In emitDeclarations, don't use diagnostics.push.apply - use addRange.
  • Can you document preprocessDeclarations a little more?

@ahejlsberg Anders Hejlsberg (ahejlsberg) changed the title Declaration emiter cleanup Declaration emitter cleanup Jul 29, 2015
Conflicts:
	src/compiler/declarationEmitter.ts
	src/compiler/types.ts
Conflicts:
	src/compiler/checker.ts
	src/compiler/declarationEmitter.ts
	src/compiler/diagnosticInformationMap.generated.ts
	src/compiler/diagnosticMessages.json
	src/compiler/types.ts
	tests/baselines/reference/chainedImportAlias.symbols
	tests/baselines/reference/es6ImportNamedImportInIndirectExportAssignment.symbols
@mhegazy

Copy link
Copy Markdown
Contributor Author

closing for now. will refresh and resubmit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants