Skip to content

Invoke tsc programmatically#172

Merged
chriskrycho merged 16 commits intomasterfrom
programmatic-compilation
Apr 15, 2018
Merged

Invoke tsc programmatically#172
chriskrycho merged 16 commits intomasterfrom
programmatic-compilation

Conversation

@chriskrycho
Copy link
Copy Markdown
Member

No description provided.

@dzaman
Copy link
Copy Markdown

dzaman commented Mar 15, 2018

TL;DR: After installing ember-cli-typescript on an existing app I had trouble with automatic rebuilds / live reloading. Switching to the programmatic-compilation build solved this problem.


The initial build would work as expected in a normal amount of time for our app (20s), but rebuilds for me would take significantly longer (in some cases 5+ minutes) and in other cases I gave up waiting. I think it's possible that the completed builds were actually tied to additional file changes and would have otherwise hung indefinitely.

When the rebuilds hung, I'd see output that a file has changed and that incremental compilation was starting, but neither the build success message nor the expected typescript warnings were output.

I would kill rebuilds older than that, but wasn't able to ctrl+c them, I'd have to kill the process. I'd see the "cleaning up..." message, but it would just hang after that.

I'm using Ember 2.16.2 on OS X Sierra 10.12.6

@jasonworden
Copy link
Copy Markdown

jasonworden commented Mar 15, 2018

While trying @dzaman's branch with ember-cli-typescript on that same app, I had similar troubles. Here is what happened.

  • Initial build took expected amount of time
  • I was able to make 5-10 changes throughout a ~15 minute span that were reflected in the browser via hot-reloaded as expected.
  • I made a subsequent change, and the browser tab did not reflect the changes. I manually refreshed the browser tab, and it was hung up trying to refresh for several minutes. The re-build after these changes never finished.
  • I ctrl-C'd out of the ember server process, but then had to kill the process.
  • Chrome crashed, I believe right after I killed the server process.
  • Restarted the server and was able to make a few changes with hot-reloaded working for about 5-10 minutes.
  • A subsequent change did not result in a proper re-build, and I followed the same steps.
  • I changed app branches and was able to work without the Typescript in the project.
  • I'm working with the programmatic-compilation now. Everything seemed good for awhile, but I eventually ran into the same issue as above.

While the rebuilds failed to finish, my machine became really slow. I did not check my CPU stats but I will if this happens again.

Ember 2.16.2 on OS X Sierra 10.13.1

@chriskrycho
Copy link
Copy Markdown
Member Author

@dfreeman one thing I was thinking about just now: can we leverage this to properly fail builds when people have the noEmitOnError setting enabled? That'd be a nice win here.

@dfreeman
Copy link
Copy Markdown
Contributor

@chriskrycho I'm hoping so.

Overall this still needs a fair amount of thought/effort to get it beyond the prototype stage, but it seems like a promising approach and I do hope to get it across the finish line over the next few weeks.

I'd love to see #167 land before this—the TS compiler APIs are a little scary to try and use without actual, well, TypeScript 😄

tansongyang and others added 2 commits April 7, 2018 14:22
Previously, on Windows, `broccoli` would fail with this error:

    EPERM: operation not permitted, symlink ...

This appeared to only happen the first time it attempted to create a
symlink from `tmp/broccoli_merge_trees-output_path-{some_hash}.tmp` to
`tmp/funnel-input_base_path-{some_other_hash}.tmp`.

We don't know the cause, but the error goes away when we use `chokidar`.
Windows-compatible programmatic compilations
@machty
Copy link
Copy Markdown

machty commented Apr 9, 2018

This PR fixes an issue with ember-cli-addon-docs that I was running into where changing a .md file caused the rebuild to hang. I believe the root cause is that the tsc binary doesn't emit the "Compilation complete. Watching for file changes." text when it sees a non-JS/TS file change.

@tansongyang
Copy link
Copy Markdown
Contributor

Hello everyone. I'm checking in here to see what else needs to be done before this can be merged into master.

@chriskrycho
Copy link
Copy Markdown
Member Author

We need to get the tests passing, either by removing the helper-using test or by fixing the typings so it works properly (preferably but not necessarily the latter).

@tansongyang
Copy link
Copy Markdown
Contributor

@chriskrycho Is work already being done on the typings? If not, I think I could give some time to that this weekend.

@chriskrycho
Copy link
Copy Markdown
Member Author

chriskrycho commented Apr 11, 2018 via email

@tansongyang
Copy link
Copy Markdown
Contributor

OK. If I don't hear any updates by this weekend, I'll just start on it. Could you point me to where I should be looking?

@chriskrycho
Copy link
Copy Markdown
Member Author

@tansongyang what we know so far is documented in #133.

@dfreeman dfreeman force-pushed the programmatic-compilation branch 2 times, most recently from 737f413 to 46f3456 Compare April 15, 2018 01:20
@dfreeman dfreeman force-pushed the programmatic-compilation branch from 46f3456 to 309a89d Compare April 15, 2018 01:35
@chriskrycho
Copy link
Copy Markdown
Member Author

That is one super weird AppVeyor failure. Do we have some kind of caching problem, maybe?

@dfreeman
Copy link
Copy Markdown
Contributor

@chriskrycho Haha, I was just about to ping you to ask if we could try to clear that somehow. Bad cached dependency tree, maybe? 😬

@chriskrycho chriskrycho merged commit 3d0fb1f into master Apr 15, 2018
@chriskrycho chriskrycho deleted the programmatic-compilation branch April 15, 2018 02:42
@jamescdavis
Copy link
Copy Markdown
Contributor

🎉

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants