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

fix: use Reflect API (2016) instead of Object.hasOwn (2021) #7958

Merged
merged 1 commit into from
Apr 25, 2024

Conversation

Mrazator
Copy link
Collaborator

@Mrazator Mrazator commented Apr 25, 2024

Use a more stable Reflect API (since 2016 in major browsers) for handling observedAppState, instead of Object.hasOwn (since 2021 in major browsers).

The next step is possibly polyfilling the APIs (such as Reflect) through @vitejs/plugin-legacy and it's specifiers https://www.npmjs.com/package/@vitejs/plugin-legacy#polyfill-specifiers.

Can I use Reflect? https://caniuse.com/mdn-javascript_builtins_reflect

Fixes #7957

Copy link

vercel bot commented Apr 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
excalidraw ✅ Ready (Inspect) Visit Preview Apr 25, 2024 0:43am
excalidraw-package-example ✅ Ready (Inspect) Visit Preview Apr 25, 2024 0:43am
excalidraw-package-example-with-nextjs ✅ Ready (Inspect) Visit Preview Apr 25, 2024 0:43am
1 Ignored Deployment
Name Status Preview Updated (UTC)
docs ⬜️ Ignored (Inspect) Apr 25, 2024 0:43am

@Mrazator Mrazator assigned Mrazator and unassigned Mrazator Apr 25, 2024
@Mrazator Mrazator requested a review from dwelle April 25, 2024 12:44
Copy link

Coverage Report

Status Category Percentage Covered / Total
🔴 Lines 65.42% (🎯 70%) 50879 / 77766
🔴 Statements 65.42% (🎯 70%) 50879 / 77766
🔴 Functions 66.55% (🎯 68%) 1558 / 2341
🟢 Branches 80.97% (🎯 70%) 6247 / 7715
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/excalidraw/store.ts 96.87% 96.2% 95.83% 96.87% 228-234, 262-263, 304-305, 332-333
Generated in workflow #2355

@Mrazator Mrazator merged commit 4d83d1c into master Apr 25, 2024
13 checks passed
@Mrazator Mrazator deleted the mrazator/use-stable-reflect-instead-of-hasown branch April 25, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeError: Object.hasOwn is not a function
2 participants