Skip to content

feat: switch to esbuild-based build pipeline for faster builds#762

Open
RomanNikitenko wants to merge 5 commits into
che-incubator:mainfrom
RomanNikitenko:reduce-build-time
Open

feat: switch to esbuild-based build pipeline for faster builds#762
RomanNikitenko wants to merge 5 commits into
che-incubator:mainfrom
RomanNikitenko:reduce-build-time

Conversation

@RomanNikitenko

@RomanNikitenko RomanNikitenko commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

  • Switches the build pipeline from the gulp + custom TypeScript mangler to the esbuild-based pipeline.
  • Removes custom TS mangler and its fragile workarounds
  • Build time: 53-62 min → ~16-21 min

Build steps (per Dockerfile):

  • gulp — compile extensions (codicons, non-native, copilot, media)
  • tsgo — type-check (no emit)
  • esbuild — bundle + minify + mangle-privates (server-web target)
  • gulp *-min-ci — package only

Before:
Screenshot 2026-07-22 at 11 55 10

After:
Screenshot 2026-07-22 at 11 57 01

What issues does this PR fix?

How to test this PR?

Testing any functionality is useful
I've tested basic functionality:

  • open a file
  • create a terminal
  • install an extension
  • change a theme
  • restart workspace
  • search
  • run a devfile command

Does this PR contain changes that override default upstream Code-OSS behavior?

  • the PR contains changes in the code folder (you can skip it if your changes are placed in a che extension )
  • the corresponding items were added to the CHANGELOG.md file
  • rules for automatic git rebase were added to the .rebase folder

Summary by CodeRabbit

  • Performance

    • Improved web asset delivery by serving pre-compressed gzip versions of JavaScript, CSS, HTML, and JSON when the client supports it.
    • Added proper cache negotiation via Vary: Accept-Encoding and ensured 304 responses include the expected headers.
    • Automatically falls back to uncompressed files when gzip variants aren’t available or suitable.
  • Build Improvements

    • Expanded Linux Docker build steps to run additional compilation, TypeScript validation, and Next.js server bundling for more consistent artifacts.
    • Added gzip pre-compression of eligible static assets during image builds to speed up HTTP delivery.

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@tolusha

tolusha commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Hi! I'm che-ai-assistant — I help with your pull requests.

Available commands:

  • /che-ai-assistant generate-che-doc — Generate a documentation PR based on this PR's changes
  • /che-ai-assistant ok-pr-review — Run a comprehensive PR review (summary, code review, deep review, impact analysis)
  • /che-ai-assistant check-pr-test-failures — Analyze failing CI checks, identify root causes, and suggest fixes
  • /che-ai-assistant update-che-e2e-tests — Update Eclipse Che e2e tests
  • /che-ai-assistant help — Show this help message

@github-actions

Copy link
Copy Markdown
Contributor

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Assisted-by: Cursor AI
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Assisted-by: Cursor AI
Copilot AI review requested due to automatic review settings July 21, 2026 10:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates Che-Code’s build and static-asset delivery pipeline by integrating the new esbuild-based bundling flow into container builds and adding Che-specific support for serving pre-compressed static assets.

Changes:

  • Adds Che-specific support to serve pre-compressed .gz static assets when the client supports gzip.
  • Updates container build Dockerfiles to run the new esbuild-based bundling pipeline and pre-compress static assets during image build.
  • Refreshes Che server helper code/header to support the new static serving behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
code/src/vs/server/node/webClientServer.ts Attempts to serve pre-compressed assets before falling back to the regular static file path.
code/src/vs/server/node/che/webClientServer.ts Introduces tryServeCompressedFile helper and updates Che copyright header.
build/dockerfiles/linux-musl.Dockerfile Switches Alpine build to the new esbuild-based bundling steps and adds gzip pre-compression of assets.
build/dockerfiles/linux-libc-ubi9.Dockerfile Switches UBI9 build to the new esbuild-based bundling steps and adds gzip pre-compression of assets.
build/dockerfiles/linux-libc-ubi8.Dockerfile Switches UBI8 build to the new esbuild-based bundling steps and adds gzip pre-compression of assets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread code/src/vs/server/node/che/webClientServer.ts
Comment thread code/src/vs/server/node/che/webClientServer.ts Outdated
Comment thread build/dockerfiles/linux-musl.Dockerfile
Comment thread build/dockerfiles/linux-libc-ubi8.Dockerfile
Comment thread build/dockerfiles/linux-libc-ubi9.Dockerfile
@github-actions

Copy link
Copy Markdown
Contributor

Ensure the Promise in tryServeCompressedFile settles when the client
disconnects or a stream error occurs after headers are sent. Previously
these scenarios left the Promise pending, which could hang the request
handler.

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Assisted-by: Cursor AI
@github-actions

Copy link
Copy Markdown
Contributor

@RomanNikitenko
RomanNikitenko marked this pull request as ready for review July 22, 2026 10:58
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@RomanNikitenko, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 08816535-ce8c-4e92-9051-cb5d418c822a

📥 Commits

Reviewing files that changed from the base of the PR and between 3832429 and 3bd8bde.

📒 Files selected for processing (2)
  • code/src/vs/server/node/che/webClientServer.ts
  • code/src/vs/server/node/webClientServer.ts
📝 Walkthrough

Walkthrough

Linux libc and musl image builds now perform expanded compilation, TypeScript validation, Next.js bundling, CI web packaging, and pre-compression of selected static assets. The web server adds gzip eligibility checks and streams matching .gz files with appropriate headers, while retaining uncompressed serving as a fallback.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DockerBuild
  participant CheOutput
  participant Client
  participant serveFile
  participant tryServeCompressedFile
  DockerBuild->>CheOutput: Build web artifacts and gzip eligible assets
  Client->>serveFile: Request static asset with Accept-Encoding
  serveFile->>tryServeCompressedFile: Attempt compressed response
  tryServeCompressedFile->>CheOutput: Read matching .gz file
  CheOutput-->>tryServeCompressedFile: Return gzip stream
  tryServeCompressedFile-->>Client: Send compressed asset with headers
Loading

Suggested reviewers: rgrunber, azatsarynnyy, vitaliy-guliy


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Rebase Rules For Upstream Changes ❌ Error Upstream code/src/vs/server/node/webClientServer.ts changed, but .rebase/CHANGELOG.md has no entry for that exact path. Add a .rebase/CHANGELOG.md entry for code/src/vs/server/node/webClientServer.ts; include any required .rebase/ rule/routing updates in the same PR.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the shift to an esbuild-based build pipeline.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@code/src/vs/server/node/che/webClientServer.ts`:
- Around line 48-50: Update the gzip negotiation logic around acceptEncoding so
it parses Accept-Encoding coding parameters and reads gzip’s effective quality
value. Return false when gzip is absent or explicitly assigned q=0, and only
enable gzip when its effective quality is greater than zero.

In `@code/src/vs/server/node/webClientServer.ts`:
- Around line 77-80: Update the response-header setup in the web client request
handler to add or append Vary: Accept-Encoding before the ETag/304 conditional,
ensuring both compressed and uncompressed responses advertise the encoding
variance. Pass responseHeaders when constructing the 304 response, while
preserving the existing conditional and file-serving behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b2049961-22e6-47d9-b360-bb7cedb11db7

📥 Commits

Reviewing files that changed from the base of the PR and between 4eadc7e and bf2c8b1.

📒 Files selected for processing (5)
  • build/dockerfiles/linux-libc-ubi8.Dockerfile
  • build/dockerfiles/linux-libc-ubi9.Dockerfile
  • build/dockerfiles/linux-musl.Dockerfile
  • code/src/vs/server/node/che/webClientServer.ts
  • code/src/vs/server/node/webClientServer.ts

Comment thread code/src/vs/server/node/che/webClientServer.ts
Comment thread code/src/vs/server/node/webClientServer.ts
RomanNikitenko and others added 2 commits July 22, 2026 15:12
Skip gzip serving when the client explicitly refuses gzip by setting
quality value to zero (e.g. Accept-Encoding: gzip;q=0).

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Add Vary header before ETag/304 conditional so shared caches correctly
distinguish compressed and uncompressed variants. Include responseHeaders
in 304 response to propagate Vary to the client.

Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

@rgrunber rgrunber left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Build went from taking about ~20min locally (with balanced performance) to ~5min using the compile instructions.

Comparing the contents of code/.build/extensions shows no major differences.

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.

4 participants