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

fix(compiler): compile .ngfactory.ts files even if nobody reference… #16899

Merged
merged 1 commit into from
May 25, 2017

Conversation

tbosch
Copy link
Contributor

@tbosch tbosch commented May 19, 2017

…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")

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

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")

[ ] Yes
[ ] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@mary-poppins
Copy link

The angular.io preview for e2f1c96 is available here.

Copy link
Contributor

@alexeagle alexeagle left a 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');
Copy link
Contributor

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

Copy link
Contributor Author

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);
Copy link
Contributor

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]

Copy link
Contributor Author

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);
Copy link
Contributor

Choose a reason for hiding this comment

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

again

Copy link
Contributor Author

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 = {
Copy link
Contributor

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

Copy link
Contributor Author

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.

@mary-poppins
Copy link

The angular.io preview for a45c0ab is available here.

@mary-poppins
Copy link

The angular.io preview for 81f5be3 is available here.

…s them.

This is especially important for library authors, as they will
not reference the .ngfactory.ts files.

Fixes angular#16741
@mary-poppins
Copy link

The angular.io preview for 8f10968 is available here.

@chuckjaz chuckjaz added area: core Issues related to the framework runtime type: bug/fix labels May 23, 2017
@tbosch tbosch added the action: merge The PR is ready for merge by the caretaker label May 25, 2017
@chuckjaz chuckjaz merged commit 573b861 into angular:master May 25, 2017
asnowwolf pushed a commit to asnowwolf/angular that referenced this pull request Aug 11, 2017
…s them. (angular#16899)

This is especially important for library authors, as they will
not reference the .ngfactory.ts files.

Fixes angular#16741
@tbosch tbosch deleted the ngc_no_compile branch August 14, 2017 16:50
juleskremer pushed a commit to juleskremer/angular that referenced this pull request Aug 28, 2017
…s them. (angular#16899)

This is especially important for library authors, as they will
not reference the .ngfactory.ts files.

Fixes angular#16741
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime cla: yes type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NGC not type checking .ngfactory files on the first run
6 participants