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

Skip sourcemap generation when unaffected by changes in watch mode #800

Merged
merged 4 commits into from
Oct 13, 2023
Merged

Skip sourcemap generation when unaffected by changes in watch mode #800

merged 4 commits into from
Oct 13, 2023

Conversation

filiptibell
Copy link
Contributor

This PR implements a mechanism for avoiding unnecessary sourcemap re-creation in rojo sourcemap --watch.

Consumers of rojo sourcemap --watch will no longer see new sourcemaps when changes to script sources and other properties occur, or when instances that have been ignored are changed, neither of which would actually make for changes in the sourcemap JSON body itself.
This massively benefits tools such as luau-lsp and rojo-viewer that would previously need to parse sourcemaps every time the user makes changes to the contents of a script or other source file, which tend to be the most common operations.

The approach taken here is intentionally conservative - we could reasonably track refs and be even more granular, but I feel like that is out of scope for this initial PR and could lead to hard-to-find bugs if we're not careful. It is something that may be worth exploring in the future, though.

Copy link
Member

@Dekkonot Dekkonot left a comment

Choose a reason for hiding this comment

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

Nitpicks but the code itself looks fine!

src/cli/sourcemap.rs Outdated Show resolved Hide resolved
src/cli/sourcemap.rs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@filiptibell filiptibell requested a review from Dekkonot October 13, 2023 00:41
@Dekkonot Dekkonot merged commit e897f52 into rojo-rbx:master Oct 13, 2023
Dekkonot pushed a commit to UpliftGames/rojo that referenced this pull request Jan 11, 2024
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