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

Cache task "generate" #580

Merged
merged 3 commits into from
Jul 15, 2024
Merged

Cache task "generate" #580

merged 3 commits into from
Jul 15, 2024

Conversation

joluj
Copy link
Contributor

@joluj joluj commented May 31, 2024

This PR introduces the caching of the task language-server:generate.

Current state (before this PR): Langium code is generated on every build of the language-server (and due to library dependencies on every build of the interpreter and other apps). This slows down development.

With changes: language-server:generate detects if relevant files are changed and only runs when necessary.

@joluj joluj requested review from rhazn and georg-schwarz May 31, 2024 11:55
@joluj
Copy link
Contributor Author

joluj commented May 31, 2024

I'm waiting for @georg-schwarz's feedback as well before merging.

Copy link
Member

@georg-schwarz georg-schwarz left a comment

Choose a reason for hiding this comment

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

Nice idea!

In an ideal world we'd define all elements in Jayvee itself, but we are not there yet. If you look into the stdlib generator you'll see that some parts of the stdlib are still generated from code, e.g.,

'builtin:///stdlib/io-types.jv': Object.values(IOType)
    .map((iotype) => `publish builtin iotype ${iotype};`)
    .join('\n\n'),

When changing the IOType enum, the caching should respect that as well. More difficult will be the built-in value types... Probably add the whole directory there.

If you add those things so that caching gets invalidated on their file changes, I'm fine with merging :)

@joluj
Copy link
Contributor Author

joluj commented Jun 17, 2024

If you change IOType or CSVExtractor.js (built-in Javee Block), the language-server lib is rebuilt / its cache is invalidated. This is how it should be right? So everything works as expected

@joluj joluj merged commit 1a1e9bb into main Jul 15, 2024
3 checks passed
@joluj joluj deleted the task-caching branch July 15, 2024 09:00
@github-actions github-actions bot locked and limited conversation to collaborators Jul 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants