feat(compiler): Wire offline compilation as a build step.#8098
feat(compiler): Wire offline compilation as a build step.#8098alexeagle wants to merge 7 commits intoangular:masterfrom
Conversation
tools/metadata/src/collector.ts
Outdated
There was a problem hiding this comment.
@chuckjaz here is where this function signature could go into a host interface. I suppose I would just add that interface declaration in this file, maybe before the MetadataCollector class?
There was a problem hiding this comment.
Something like,
export interface MetadataCollectorHost {
resolveModuleFromPath?(path: string): string;
}That way we could add another method without breaking the API.
|
i know this is still WIP, so sorry for the comments, but one bit of weirdness: doesn't work, and throws (after some debugging) with a using and doing the same thing works and successfully generates a .template file. The test code here does the same thing (took me a while to recognize that), is that expected? Some artifact of recent changes? |
tools/compiler_cli/test/basic.html
Outdated
There was a problem hiding this comment.
why Igor? What does this flag do?
|
Very exciting!!! |
|
@chuckjaz Rob has a good point above, that I reverse-map based on the path where a module was discovered, to workaround path mapping issues. Any import from a re-export has this problem, because the string It won't be a problem if you use the collector.ts from head, and angular2 comes from regular node moduleResolution with no pathMapping. That's how users would use it. Just a problem in our test case. We need a real chat about #8082 ... |
|
We should go over this tomorrow. |
d92c839 to
96f1ef1
Compare
gulpfile.js
Outdated
There was a problem hiding this comment.
Does your PR still require typescript@next? If not, maybe use gulp-typescript?
There was a problem hiding this comment.
Yes, I still use typescript@next to compile the compiler (it uses baseUrl/paths to resolve the 'angular2' imports)
There was a problem hiding this comment.
But, the issue referenced here is resolved, so it may be possible to use gulp-typescript instead.
(Not that it adds anything, I want the tsconfig.json to express everything).
Will try upgrading it.
There was a problem hiding this comment.
Tried newer gulp-typescript, it is still broken. Filed a new issue and referenced in this comment.
Note that I think we should stop using gulp-typescript and store our configuration in tsconfig.json instead. Maybe in a followup PR I'll remove it :)
2595054 to
e01e5b8
Compare
Preserves constructor calls in addition to function calls. Introduced a special case for forwardRef() similar to CONST_EXPR.
These worked in Dart because they were effectively exported even without the export keyword. Without exporting these symbols, they are not produced in .metadata.json files, which leaves dangling references from the Decorators that use them.
- pass a baseUrl for asset resolution from static symbols - fixes in StaticReflector to work with a path-aware host see angular#7483
This tool lets us re-write TypeScript sources before entering the emit pipeline. For example, we lower Decorators to the tree-shakable Annotation form.
|
Cleaned up and ready for review |
|
Merging PR #8098 on behalf of @alexeagle to branch presubmit-alexeagle-pr-8098. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
cc @gdi2290