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

Support incremental code transpilation #8928

Open
matgis opened this issue May 15, 2024 · 1 comment
Open

Support incremental code transpilation #8928

matgis opened this issue May 15, 2024 · 1 comment
Labels
editor Issues related to the Defold editor pipeline Issue related to the asset build pipeline task A task that needs to be performed

Comments

@matgis
Copy link
Contributor

matgis commented May 15, 2024

Task (REQUIRED):
Some code transpilers, like extension-teal, can skip over already transpiled files if it determines they do not need to be re-transpiled. In the case of extension-teal, the timestamp of the source file is compared against the timestamp of the existing output file. The file will be re-transpiled only if the source file is newer than the output file. This, however, does not work in the following situation:

  1. User edits a .tl file and builds the project. The unsaved edits mark the file as dirty, prompting the editor to copy the in-memory state of all the .tl files in the project into a temporary directory that it then runs the transpiler on.
  2. User undoes their edits and builds the project again. Since the undo brought the project back to a non-dirty state, the editor decides it can use the project directory itself as the input to the transpiler. However, the timestamp of the unedited source file on disk is now earlier than the timestamp of the transpiled output file, so extension-teal skips it and yields the previous output which contained the undone edits.

It is likely other transpilers will use a similar strategy to determine if a file needs to be re-transpiled, so we want to address this issue in the editor code.

One way to solve this would be to always copy the relevant source files into a persistent directory, and not bother with the project directory at all. If we instead focus on not overwriting the source files unless their contents differ from the previous build, their timestamps would be in line with what the transpiler can use to determine if they need to be re-transpiled or not.

Expected outcome (REQUIRED):
Transpilers such as extension-teal can run quicker since they can re-use the output from the previous build. We would also save time on the copying step when preparing the source directory for the transpiler.

@matgis matgis added the task A task that needs to be performed label May 15, 2024
@vlaaad vlaaad added editor Issues related to the Defold editor pipeline Issue related to the asset build pipeline labels May 15, 2024
@vlaaad
Copy link
Contributor

vlaaad commented May 15, 2024

It does not affect bob, right? We have a similar behavior there with temporary directories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Issues related to the Defold editor pipeline Issue related to the asset build pipeline task A task that needs to be performed
Projects
None yet
Development

No branches or pull requests

2 participants