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

Usage of Object.hasOwn breaks web pages on iPad OS (iPad Air, Safari & Chrome) #804

Closed
4 tasks done
grisha87 opened this issue Dec 21, 2023 · 6 comments
Closed
4 tasks done
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on

Comments

@grisha87
Copy link

grisha87 commented Dec 21, 2023

Initial checklist

Affected packages and versions

react-markdown

Link to runnable example

No response

Steps to reproduce

You would need to create a web page using react-markdown and open it on an iPad Air. Both Safari and Chrome for iOS crash on this particular ssie

Expected behavior

The react based page should load correctly.

Actual behavior

The react app gets broken (displays a white page instead of any content) and the logs point out to the fact that Object.hasOwn is not defined.

AS per https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn, it's supported from Safari 15. I'd like to make use of react-markdown, but it's not usable for my users that would run Safari 14 as a browser.

Runtime

Other (please specify in steps to reproduce)

Package manager

No response

OS

macOS

Build and bundle tools

No response


I could contribute the relevant change from Object.hasOwn to Objet.prototype.hasOwnProperty if that's OK with the maintainers.

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Dec 21, 2023
@wooorm
Copy link
Member

wooorm commented Dec 21, 2023

Hey! Modern tools can indeed not be usable in older browsers depending on what you choose to target.
Our target (Node 16) is made clear in the docs. A major release is used to update it.

Use tools such as esbuild or babel to target your particular users. Or use older versions.

@wooorm wooorm closed this as completed Dec 21, 2023
@wooorm wooorm added the 🙅 no/wontfix This is not (enough of) an issue for this project label Dec 21, 2023

This comment has been minimized.

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Dec 21, 2023
@ktalebian
Copy link

@wooorm what does "older browser" mean here? What browsers/OS versions are considered old?

@ChristianMurphy
Copy link
Member

ChristianMurphy commented Apr 11, 2024

Again @ktalebian this project targets Node 16.

The closest browser equivalent is Chrome version 90+.
All browsers will need some build tools.
The older the browser the more polyfills you will need.

Nitpicking at the definition of "new" versus "old" for platforms we don't offer a support matrix for is a waste of time.
You can make it work on practically any JS runtime with the right compiler target and polyfills.
If you have a question on usage ask it in a Q&A discussion post https://github.com/orgs/remarkjs/discussions/new?category=q-a

@joebnb
Copy link

joebnb commented May 19, 2024

same issue happened,is any progress about it?

@ChristianMurphy
Copy link
Member

@joebnb see the comment before yours.
There's nothing to fix at the library level, configure your build tool to work for your browser matrix.

If you have a question on usage ask it in a Q&A discussion post https://github.com/orgs/remarkjs/discussions/new?category=q-a

@remarkjs remarkjs locked as resolved and limited conversation to collaborators May 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🙅 no/wontfix This is not (enough of) an issue for this project 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

5 participants