Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Question and Suggestion #86

Closed
GimpMaster opened this issue Jun 12, 2024 · 1 comment
Closed

Question and Suggestion #86

GimpMaster opened this issue Jun 12, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@GimpMaster
Copy link

Change Type

Addition

Proposed Changes

I came to the github link directly from a post in the Svelte Discord. I tried looking at the readme but I couldn't find the documentation site. Finally I found runed.dev in some sample code. It would be great to add a link to that in the readme.md

Quick question, why is the naming of the runed utilities all over the place.

In some cases you use useXYZ in some cases you use PascalCasing like MediaQuery or ElementRect or some cases its camelCase isMounted()

Just curious the reasons.

@GimpMaster GimpMaster added the documentation Improvements or additions to documentation label Jun 12, 2024
@huntabyte
Copy link
Member

huntabyte commented Jun 12, 2024

Quick question, why is the naming of the runed utilities all over the place.

In some cases you use useXYZ in some cases you use PascalCasing like MediaQuery or ElementRect or some cases its camelCase isMounted()

Trust me, we exhausted bikeshedding the naming convention for the various utilities. It's not 100% set in stone, but here's the general idea behind it and how to think of the different casings:

  • PascalCase - reactive classes and must be instantiated with new Thing()
  • camelCase (activeElement) - reactive global objects that can be imported and whose value can be accessed with .current, no need to instantiate
  • useXYZ - usually wrap functions or use is prefixed to avoid conflicting with a DOM API (IntersectionObserver, ResizeObserver), etc.

These aren't hard-set and we're approaching each one on a case-by-case basis.

I'll also see if @TGlide wants to provide any additional mental models/context here to help justify.

@svecosystem svecosystem locked and limited conversation to collaborators Jun 12, 2024
@TGlide TGlide converted this issue into discussion #88 Jun 12, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants