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
Imports in documentation for Signals #901
Comments
This at least has already been addressed in preactjs/signals#82, just haven't published since. |
Cool, and I think I figured out my misunderstanding here. It looks like And reading over the examples, I failed to even spot the fact that some places you're calling So the hooks are provided by Makes sense now, and I think you can close this issue. Though I would suggest maybe adding an explanation near the top of the page to clarify the roles of the two packages, because it's really easy to confuse |
I guess you could also side step any confusion by avoiding imports from Since the symbols from It's probably a larger package, but it looks like it's tree-shakeable - using |
(I see this is old, but figured I'd answer some of this anyways)
Yup. They are sorta different, as wiith
Agree, that's probably something we want to draw attention to.
No, using |
In that case, they definitely shouldn't be used in Preact examples, should they? |
Indeed. But as far as I can tell they're not, at least not anymore. Might've gotten fixed at some point if you were seeing that in the past. (Let me know if you are seeing them somewhere though, possible I'm being an idiot and reading over an example) |
Currently 3 in-page search-results for |
None of those 3 are using signals in Preact. Those are standalone examples, so using the core lib there is correct. |
Okay, that's a bit confusing. But yes, I understand now that these examples are not in fact about Preact - they're about using Signals independently of Preact. Perhaps this section should be migrated to a separate page under "Advanced"? With a link from where it is now. The title "Advanced signals usage" does make it seem out of place in the "Essentials" section, I think. |
Perhaps that's some poor naming, indeed. I'm not a huge fan of splitting up the content (we don't really do that for any other topic) but maybe that's what we need to do. There's also the question of whether Will definitely be thinking about this though, maybe there's a way to restructure some of our content that'll fit this sort of situation better. I think our current set up does make it a bit difficult to differentiate what's from the team and what's meant to be used with Preact itself. |
I noticed a possible minor issue with the documentation for Signals.
In some examples on the page, imports look like this:
In some later examples on the same page, instead imports look like this:
The switch from
@preact/signals
to@preact/signals-core
doesn't seem to be explained in the text.Presumably
@preact/signals-core
is the stuff that's generic and shared with the React implementation?And
@preact/signals
is the Preact-specific implementation?So I'm not grasping why you would switch between these in the examples.
(note also that
@preact/signals-core
was published without a README.)The text was updated successfully, but these errors were encountered: