Skip to content

Conversation

@dcalhoun
Copy link
Member

What?

Speed up repeated make target runs that depend upon the make build target.

Why?

Address #253 (comment).

Ideally, the makefile serves as the de facto interface for project scripts. This avoids multiple sources of truth and simplifies project onboarding and documentation.

Previously, rerunning various make targets resulted in rerunning the expensive and slow make build target. It's important to ensure the build output exists for many targets, but is often unnecessary to rerun the build when running targets multiple times—e.g., Swift test targets.

How?

This introduces a caching mechanism. The make build target skips running and relies upon the cache unless one of the following is true.

  • dist doesn't exist
  • REFRESH_JS_BUILD is set to true or 1
  • build was invoked directly

This enables quicker reruns while also ensure the build is always recreated when important to do so—e.g., direct invocations, CI runs, releases.

Testing Instructions

Run the make test-swift-package target with/without the following:

  • A dist directory
  • REFRESH_JS_BUILD=1

If the dist exists and REFRESH_JS_BUILD is not enabled, the make build target should be skipped, much like the functionality found in the num-dependencies and prep-translations targets.

CI runs and the release script should always refresh the JavaScript build to avoid cryptic or unexpected outcomes.

Accessibility Testing Instructions

N/A, no user-facing changes.

Screenshots or screencast

N/A, no user-facing changes.

Ideally, the `makefile` serves as the de facto interface for project
scripts. This avoids multiple sources of truth and simplifies project
onboarding and documentation.

Previously, rerunning various `make` targets resulted in rerunning the
expensive and slow `make build` target. It's important to ensure the
build output exists for many targets, but is often unnecessary to rerun
the build when running targets multiple times--e.g., Swift test targets.

This introduces a caching mechanism. The `make build` target skips
running and relies upon the cache unless one of the following is true.

- dist doesn't exist
- REFRESH_JS_BUILD is set to true or 1
- build was invoked directly

This enables quicker reruns while also ensure the build is always
recreated when important to do so--e.g., direct invocations, CI runs,
releases.

See #253 (comment)
Follow project practice of using the `makefile` as the de facto script
interface.
@dcalhoun dcalhoun added the [Type] Task Issues or PRs that have been broken down into an individual action to take label Dec 19, 2025
steps:
- label: ':react: Build React App'
command: make build REFRESH_L10N=1
command: make build REFRESH_L10N=1 REFRESH_JS_BUILD=1
Copy link
Member Author

Choose a reason for hiding this comment

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

Ensure CI tasks always rebuild the JavaScript to avoid unexpectedly stale builds.

fi

make build REFRESH_DEPS=1 REFRESH_L10N=1 STRICT_L10N=1
make build REFRESH_DEPS=1 REFRESH_L10N=1 REFRESH_JS_BUILD=1 STRICT_L10N=1
Copy link
Member Author

Choose a reason for hiding this comment

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

Ensure the release script always creates fresh JavaScript builds.

Copy link
Member Author

Choose a reason for hiding this comment

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

This existing documentation was formatted via the projects' make format script.

```bash
# Build Swift package
swift build
make build-swift-package
Copy link
Member Author

Choose a reason for hiding this comment

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

Reinstates directives for Claude to prefer the make targets.

@dcalhoun dcalhoun marked this pull request as ready for review December 19, 2025 20:37
@dcalhoun dcalhoun enabled auto-merge (squash) December 19, 2025 20:37
@dcalhoun dcalhoun requested a review from jkmassel December 19, 2025 20:37
@dcalhoun dcalhoun changed the title task: make targets reuse JavaScript build task: Make targets reuse JavaScript builds Dec 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Task Issues or PRs that have been broken down into an individual action to take

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants