Skip to content

Keep JavaScript source visible in Dart projects - #4949

Open
SSuva4 wants to merge 1 commit into
github:mainfrom
SSuva4:dart-track-javascript
Open

SSuva4 wants to merge 1 commit into
github:mainfrom
SSuva4:dart-track-javascript

Conversation

@SSuva4

@SSuva4 SSuva4 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Link to the application or project's homepage

Dart

Reasons for making this change

In a Dart web project, a new hand-written file such as web/interop.js disappears from git status when this template is used. Remove the blanket JavaScript rule. The existing rules still cover output under build/ and files ending in .dart.js. Projects that generate JavaScript under a custom filename outside the build directory can ignore that output path locally.

I checked the original and modified templates with git check-ignore in a fresh repository. The original ignored web/interop.js. With this change that path is visible, while both web/main.dart.js and build/web/app.js are still ignored.

Links to documentation supporting these rule changes

Dart's guidance on files to keep out of source control includes the build directory. Dart's JavaScript interop guide describes using JavaScript alongside Dart. A broader update discussed this rule in #3163. This PR only removes the blanket rule and its comment.

Merge and Approval Steps

@SSuva4
SSuva4 requested a review from a team as a code owner November 25, 2026 17:23
Copilot AI adaptive review requested due to automatic review settings November 25, 2026 17:23

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.

🟢 Approval recommended

The change is narrowly scoped to expose hand-written JavaScript while preserving ignores for generated Dart JavaScript and build artifacts, with no active review issues identified.

No open issues 🎉

What changed in this PR

This pull request updates the Dart .gitignore template so hand-written JavaScript files remain visible to Git while generated Dart JavaScript and build output continue to be ignored.

Changes:

  • Removes the blanket *.js ignore rule and its associated comment.
  • Preserves targeted ignores for *.dart.js, build/, source maps, dependency metadata, and other generated artifacts.
  • Keeps the change limited to the Dart template.
File Description
Dart.gitignore Removes the broad JavaScript ignore pattern while preserving exclusions for generated Dart and build output.

Review effort: Lite (adaptive)

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.

2 participants