-
Notifications
You must be signed in to change notification settings - Fork 228
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
build: Refactor Taskfile.yml #3445
Conversation
…their product: - run website - run playground - run book The new install-playground-dependencies-all task forces the full "npm install..." with all its options All the other tasks rely on "install-playground-dependencies" that check if packages.json have been modified Breaking change: tasks "run-web" and "run-playground-cached" are no longer needed and commented out
I think this is overall very good, but I think it has one distinct large disadvantage: that changing the rust code and running |
The comment & footnote in #2907 (comment) references an approach using (But I don't know this well, I'm very green in JS) |
If we cause a syntax error in |
On reconsideration, I deleted my earlier comment and am replacing with this...
I think I understand your concern, which also is part of the reason that the It sounds as if this is the desired workflow:
If that's the case, it seems that the
Thanks. |
I don't think that folks will expect two commands after editing a rust file. So either we need to either a) give that task knowledge of all the files it should check (probably I think the latter would be great but would require redesigning the JS build with something like webpack. The former is possible — if it provides a great speed-up then we could add it in. If it's only marginal, I would vote against, since if paths change and those become incorrect, it could be quite a confusing development experience. |
I see your concern and need to understand your workflow better, but don't have time now. I'm marking this a draft and will come back next week. |
I've thought about this some more. Can we go over the motivating case for the main part of this code? (TBC, some of this is just better than the old code, so keen on it overall) Currently when developing the playground
I'm very up for speeding up dev loops. But what's the thing we're trying to speed up here — the first of these? How often are we running that? |
I have been thinking about workflows as well. I came to this PR to speed the second of your points: I only work on the Book or the Playground (or website, but I haven't touched that in a long time.) This PR resolves my personal use case: run-book, run-playground, run-website now check to see if npm dependencies have changed and only run npm install when required. Changes to the pages of the Book/Playground/Web source don't require this since they rely on hot reloading, etc. But it doesn't address your concern: making changes to the prql compiler code and then trying the changes in the Playground.
Never having worked on the rust code, I need to ask a naive question: What command(s) do you use with the current Taskfile.yml to edit a rust file and check it in the Playground? I'm wondering if there's some condition that could be added to the |
OK, so the current commands work OK for you, it's just that the structure could use a refactor — is that right?
That would be this option, quoting from above:
|
Slowly, slowly my knowledge about the project expands... You said:
I think you mean that you edit the rust code, then compile it, and then need to run If so, what would the Thanks for your help |
Yes, thanks for being more explicit than me!
The Then make a change like adding |
Ahah! I understand now. (I had not realized that the wasm rebuild was part of the And in fact |
@max-sixty I also see the new commit that removes |
Yes you can always merge main in to yours |
…changes; Remove `--install-links` from `npm install` since `main` no longer uses it.
# Conflicts: # Taskfile.yml
I think I have it. Any changes to It remains true that the |
Actually, I missed out the changes for the "check brew dependencies" - I will add those back tomorrow morning |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Almost there...
generates: | ||
- node_modules/* | ||
|
||
install-playground-dependencies-all: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just combine this with the previous? Passing --force
can override the sources
check if we ever want to force an install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd like to leave it like this. I factored it out when --install-links=false
was necessary (only wanted to have that magic invocation in one place).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between calling one vs the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the thrust of this question: "combine with the previous"? Which two are you suggesting could be combined?
Here's my understanding of the situation: In the original Taskfile.yaml there were several invocations of npm install --install-links=false
which I factored into a single install-playground-dependencies-all
task so the magic --install-links...
wouldn't be screwed up in one of the multiple places. I also described that option in the comments (again, in one place). Additionally, I changed all the places that called npm install...
to use the install-playground-dependencies
task so they could take advantage of caching prior results.
Now that the --install-links=false
is no longer required, we certainly could get rid of the (single) call to install-playground-dependencies-all
and replace it with a simple npm install
But I'll also point out the "documentation advantage" of having a named task that unconditionally runs the proper npm install
command in the case that the logic behind the install-playground-dependences
gets screwed up. Instead of needing to remember where the --force
option might be used, people can just task install-playground-dependencies-all
to un-screw it.
I hope that addresses your question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between install-playground-dependencies-all
and install-playground-dependencies
? I think one just checks the sources. So can we combine them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we combine these though? I don't see why we have a task that seems to just wrap another task?
I tested this locally and it works well! |
Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com>
…e ":" but adding it is more correct)
I didn't want to delay the excellent changes, and I didn't think I was being clear on one point — so merging and will open a quick PR for your review! |
- Combine task which wraps another - Rename `install-` to `build-` for things which create artifacts internally (vs. installing something to the system)
Refactor Taskfile.yml to provide these commands that build and serve their product:
The new
install-playground-dependencies-all
task forces the full "npm install..." with all its options All the other tasks rely oninstall-playground-dependencies
that checks if packages.json has been modified and re-runs the full "npm install..." as neededBreaking change: tasks
run-web
andrun-playground-cached
are no longer needed and commented out