adobe / adobe/react-spectrum

Emit human-readable names for classes, functions, etc. in @internationalized/date package

Open
#6,808 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### Provide a general summary of the feature here

Hey everyone, thanks for the `@internationalized/date` package, I love it!

When inspecting varying class instances during debugging, e.g. by logging to the console, JS engines usually display the name of the class which helps with figuring out what kind of object I'm dealing with.

![Screenshot 2024-07-31 at 14 27 26](https://github.com/user-attachments/assets/75fd2369-d2bf-4851-b513-12894adae9a8)

However, when I inspect objects from the `@internationalized/date` package, the class names appear as an ID that isn't human-readable. That makes it more difficult to differentiate between object types, especially if their properties are similar like in the case of `CalendarDateTime` and `ZonedDateTime`.

![Screenshot 2024-07-31 at 14 31 56](https://github.com/user-attachments/assets/22d9fccc-3cd2-4873-bfd2-60cbbbd7d28c)

Would be awesome if it were possible to preserve the original class names in the bundle to keep them human-readable during runtime inspection.

### 🤔 Expected Behavior?

Emit human-readable class names in the bundle which leads to human-readable classes during runtime inspection.

### 😯 Current Behavior

Class names are replaced with long IDs that makes it difficult to differentiate between the different classes.

### 💁 Possible Solution

Didn't dig too much into it but there is probably an option to preserve names as much as possible in Parcel. I could also look into it deeper if this is desired.

### 🔦 Context

I use ZonedDateTime and CalendarDate in a codebase and sometimes log those objects to the console during debugging. That results in those IDs being logged and I have to either log additional info or click into every single object to figure out the class the object belongs to.

### 💻 Examples

_No response_

### 🧢 Your Company/Team

_No response_

### 🕷 Tracking Issue

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.