-
Notifications
You must be signed in to change notification settings - Fork 25k
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
fix(compiler): compile .ngfactory.ts
files even if nobody reference…
#16899
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
@@ -13,39 +13,53 @@ import * as path from 'path'; | |||
|
|||
import {main} from '../src/main'; | |||
|
|||
function getNgRootDir() { | |||
const moduleFilename = module.filename.replace(/\\/g, '/'); | |||
const distIndex = moduleFilename.indexOf('/dist/all'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe throw if you don't find it? this failure will be hard to track down when we change the output layout next time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ngOptions.basePath = basePath; | ||
const createProgram = (host: ts.CompilerHost, oldProgram?: ts.Program) => | ||
ts.createProgram(parsed.fileNames, parsed.options, host, oldProgram); | ||
let rootFileNames: string[] = parsed.fileNames.slice(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we now prefer splat in a new array
[...parsed.fileNames]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
ts.createProgram(parsed.fileNames, parsed.options, host, oldProgram); | ||
let rootFileNames: string[] = parsed.fileNames.slice(0); | ||
const createProgram = (host: ts.CompilerHost, oldProgram?: ts.Program) => { | ||
return ts.createProgram(rootFileNames.slice(0), parsed.options, host, oldProgram); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
constructor(private readFile = ts.sys.readFile, private readDirectory = ts.sys.readDirectory) {} | ||
constructor(private readFile = ts.sys.readFile, private readDirectory = ts.sys.readDirectory) { | ||
this.parseConfigHost = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you give this a type now, to avoid typos? looks like we only omitted it due to g3 version skew earlier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has one, see the member declaration.
…s them. This is especially important for library authors, as they will not reference the .ngfactory.ts files. Fixes angular#16741
…s them. (angular#16899) This is especially important for library authors, as they will not reference the .ngfactory.ts files. Fixes angular#16741
…s them. (angular#16899) This is especially important for library authors, as they will not reference the .ngfactory.ts files. Fixes angular#16741
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. |
…s them.
This is especially important for library authors, as they will
not reference the .ngfactory.ts files.
Fixes #16741
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
What is the new behavior?
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: