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

Explicit dependency management #216

Merged
merged 80 commits into from
Feb 6, 2023
Merged

Explicit dependency management #216

merged 80 commits into from
Feb 6, 2023

Conversation

dphfox
Copy link
Owner

@dphfox dphfox commented Feb 5, 2023

Implements #111, #168, and #35. First steps towards #205.

  • :get() will now error when called.
  • Fusion.peek will retrieve the value of any state object without adding dependencies, or pass through constants.
  • Dependency providers will wrap peek in dependency management code to generate use callbacks for use by the API consumer. These should also pass through constants.

@dphfox dphfox self-assigned this Feb 5, 2023
@dphfox dphfox added enhancement New feature or request ready to work on Enhancements/changes ready to be made area: state labels Feb 5, 2023
@krypt102
Copy link
Contributor

krypt102 commented Feb 5, 2023

Lovely! I haven't read through the PR but I hope it contains the use function within computed! (nevermind it was like 6 lines changed)

Small thing, maybe use the term solves to make github detect that this PR will close the labeled issues. For a list you'll need to put the prefix before every issue (e.g. solves [a], solves [b])

@dphfox
Copy link
Owner Author

dphfox commented Feb 5, 2023

Lovely! I haven't read through the PR but I hope it contains the use function within computed! (nevermind it was like 6 lines changed)

Small thing, maybe use the term solves to make github detect that this PR will close the labeled issues. For a list you'll need to put the prefix before every issue (e.g. solves [a], solves [b])

Yeah, I'm only just starting work now that the prereq backlog is sorted, hence draft status. This won't take long to implement and should be an easy one-man job.

I'm currently focusing on public API work (docs, types, messages) before doing the simple private work.

@krypt102
Copy link
Contributor

krypt102 commented Feb 5, 2023

I'm currently focusing on public API work (docs, types, messages) before doing the simple private work.

nice! I might make a small PR which fixes all of the stuff on the docs unless you’ve already got that.

@dphfox
Copy link
Owner Author

dphfox commented Feb 5, 2023

I'm currently focusing on public API work (docs, types, messages) before doing the simple private work.

nice! I might make a small PR which fixes all of the stuff on the docs unless you’ve already got that.

I'll be fine - there's some nuance required for the tutorials.

@krypt102
Copy link
Contributor

krypt102 commented Feb 5, 2023

Also didn’t realise you could link prs and issues so that’s my bad!

@krypt102
Copy link
Contributor

krypt102 commented Feb 5, 2023

I'll be fine - there's some nuance required for the tutorials.

oh okay! I’ll find some other issues or things to work on in the meantime

@krypt102
Copy link
Contributor

krypt102 commented Feb 5, 2023

The most recent commit poses an interesting question. For the for* objects, will use now be the first parameter followed by the others (the key in ForKeys, the value in ForValues and both in ForPairs)?

@dphfox
Copy link
Owner Author

dphfox commented Feb 5, 2023

The most recent commit poses an interesting question. For the for* objects, will use now be the first parameter followed by the others (the key in ForKeys, the value in ForValues and both in ForPairs)?

Yes. Having the use callback in a stable position seems to be a good idea. This is a massively breaking change anyway, so better to do the right thing than the compatible thing.

@dphfox
Copy link
Owner Author

dphfox commented Feb 5, 2023

Probably done for the day at this point. I haven't yet tested any of this code, but this should roughly be along the right lines.

Will need to update tests and benchmarks too.

@krypt102
Copy link
Contributor

krypt102 commented Feb 5, 2023

Nice! If you need help lmk haha but it should be easy enough as u said. I’m gonna most likely work on some others today during class

@krypt102
Copy link
Contributor

krypt102 commented Feb 5, 2023

One small thing you probably forgot is to change Attributes to use isState instead of xtypeof, I didn’t notice that in the last commit that’s all, the rest looks amazing!

@dphfox
Copy link
Owner Author

dphfox commented Feb 6, 2023

This should be ready now. I know there's a few places where I could perhaps do more caching work, but we can do that in the future - it's more important to merge a working version than an optimal one, I think.

@dphfox dphfox marked this pull request as ready for review February 6, 2023 05:43
Copy link
Contributor

@krypt102 krypt102 left a comment

Choose a reason for hiding this comment

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

One small change I found here, if it's intentional please let me know!

@dphfox dphfox merged commit f889d0e into main Feb 6, 2023
@dphfox dphfox deleted the pr-explicit-dependencies branch February 6, 2023 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready to work on Enhancements/changes ready to be made
Projects
Status: Done
2 participants