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

[N8N-4332] Setup Typescript incremental builds #3876

Merged
merged 1 commit into from
Sep 9, 2022

Conversation

netroy
Copy link
Member

@netroy netroy commented Aug 12, 2022

No description provided.

@netroy netroy requested a review from alexgrozav August 12, 2022 11:00
@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team node/improvement New feature or request ui Enhancement in /editor-ui or /design-system labels Aug 12, 2022
@netroy netroy changed the title [N8N-2827] Setup Typescript incremental builds [N8N-4332] Setup Typescript incremental builds Aug 12, 2022
@netroy netroy added tech debt and removed node/improvement New feature or request labels Aug 12, 2022
@ivov
Copy link
Contributor

ivov commented Aug 12, 2022

Does skipLibCheck skip type declaration files in our own packages in addition to those in third-party libs? Based on this, it looks like it skips all of them wherever located. If so, might it be worth converting our own .d.ts to .ts or .types.ts so ours are not skipped?

@netroy netroy requested review from ivov and removed request for alexgrozav August 15, 2022 07:03
@netroy
Copy link
Member Author

netroy commented Aug 15, 2022

for now I've removed the skipLibCheck that were added in this PR.

@ivov
Copy link
Contributor

ivov commented Aug 22, 2022

Have you seen this? Can you help me understand how we expect the incremental flag to interact with Turborepo cache artifacts?

Having tested making a single change and rebuilding with and without this flag, I am not seeing any noticeable speed improvement:

  • TR only, cache hit: 2.265s
  • TR + flag, cache hit: 2.124s
  • TR only, cache miss: 19.916s
  • TR + flag, cache miss: 19.928s
Model Name: MacBook Pro
Model Identifier: MacBookPro17,1
Chip: Apple M1
Total Number of Cores: 8 (4 performance and 4 efficiency)
Memory: 16 GB

@netroy
Copy link
Member Author

netroy commented Aug 22, 2022

@ivov i hadn't seen that issue. I'll check it now.

Can you please delete your tsc cache (rm -rf packages/**/tsconfig.tsbuildinfo) and run the benchmark once more?

@ivov
Copy link
Contributor

ivov commented Aug 29, 2022

@netroy Could you please provide exact steps to be able to see the difference? The difference I'm seeing is negligible when building on top of tsconfig.tsbuildinfo vs. when using rm -rf packages/**/tsconfig.tsbuildinfoand then building, while ensuring that TR has a cache miss. Thanks.

@netroy
Copy link
Member Author

netroy commented Aug 29, 2022

I ran a few builds on this branch, and on master. To invalidate the build cache I also ran tsc --build --clean in every module.

For the cli package:

Build Time (seconds)
master 20
Incremental - no cache 20
Incremental - with cache 5

image

For the nodes-base package:

Build Time (seconds)
master 60
Incremental (no cache) 62
Incremental (with cache) 9

image

For the full build (turbo repo cache disabled):

On master:
image

On this branch, after the tsc cache is generated:
image

@netroy netroy merged commit 799676b into n8n-io:master Sep 9, 2022
@netroy netroy deleted the incremental-builds branch September 9, 2022 13:24
@n8n-assistant n8n-assistant bot added the Upcoming Release Will be part of the upcoming release label Sep 9, 2022
@janober
Copy link
Member

janober commented Sep 15, 2022

Got released with n8n@0.194.0

@janober janober removed the Upcoming Release Will be part of the upcoming release label Sep 15, 2022
valya pushed a commit to valya/n8n that referenced this pull request Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team tech debt ui Enhancement in /editor-ui or /design-system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants