Skip to content

fix: issue with explicit side effect modules not tracking downstream - #286

Merged
DylanPiercey merged 1 commit into
mainfrom
fix/side-effect-import-propagation
Jul 13, 2026
Merged

fix: issue with explicit side effect modules not tracking downstream#286
DylanPiercey merged 1 commit into
mainfrom
fix/side-effect-import-propagation

Conversation

@DylanPiercey

Copy link
Copy Markdown
Contributor

Carry a template's explicit bare import "x" side effect marking downstream to the modules x itself imports. Previously only x was exempt from the client build's side effect free default, so a package whose effect lives in a module it bare-imports (eg terser installing AST_Toplevel#resolve_defines from import "./global-defs.js") still had that module shaken out. Marko files, styles and assets remain non-propagating, so a template's own imports stay shakeable.

@changeset-bot

changeset-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 7beac39

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@marko/vite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@DylanPiercey
DylanPiercey merged commit 22a4f80 into main Jul 13, 2026
6 checks passed
@DylanPiercey
DylanPiercey deleted the fix/side-effect-import-propagation branch July 13, 2026 16:30
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 18346117-e727-4a98-b756-ce10cd8f14fb

📥 Commits

Reviewing files that changed from the base of the PR and between 0cf1546 and 7beac39.

⛔ Files ignored due to path filters (5)
  • src/__tests__/fixtures/browser-side-effects/__snapshots__/build.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/browser-side-effects/__snapshots__/dev.expected.md is excluded by !**/__snapshots__/** and included by **
  • src/__tests__/fixtures/browser-side-effects/node_modules/side-effect-lib/index.js is excluded by !**/node_modules/** and included by **
  • src/__tests__/fixtures/browser-side-effects/node_modules/side-effect-lib/package.json is excluded by !**/node_modules/** and included by **
  • src/__tests__/fixtures/browser-side-effects/node_modules/side-effect-lib/register.js is excluded by !**/node_modules/** and included by **
📒 Files selected for processing (6)
  • .changeset/side-effect-import-propagation.md
  • .gitignore
  • src/__tests__/fixtures/browser-side-effects/src/explicit-side-effect.js
  • src/__tests__/fixtures/browser-side-effects/src/nested-side-effect.js
  • src/__tests__/fixtures/browser-side-effects/src/template.marko
  • src/index.ts

Walkthrough

The client build now propagates side-effect import markings from tracked importers to eligible resolved modules. Marko files, styles, and Vite assets remain excluded from propagation. The browser-side-effects fixture adds a nested side-effect module and a side-effect-lib import, with corresponding ignore and changeset updates.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/side-effect-import-propagation

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

@github-actions github-actions Bot mentioned this pull request Jul 13, 2026
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.41%. Comparing base (750540c) to head (7beac39).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #286      +/-   ##
==========================================
- Coverage   77.53%   75.41%   -2.13%     
==========================================
  Files          14       16       +2     
  Lines         819     1212     +393     
  Branches      221      340     +119     
==========================================
+ Hits          635      914     +279     
- Misses        142      236      +94     
- Partials       42       62      +20     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-project-automation github-project-automation Bot moved this to Done in Roadmap Jul 14, 2026
@DylanPiercey DylanPiercey self-assigned this Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant