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

Ensure private API is not enumerable #2859

Merged
merged 1 commit into from
Mar 22, 2022
Merged

Ensure private API is not enumerable #2859

merged 1 commit into from
Mar 22, 2022

Conversation

natemoo-re
Copy link
Member

Changes

  • Previously, we created a privateRenderMarkdownDoNotUse on the Astro global.
  • This property was enumerable and showed up when users did console.log(Astro).
  • This PR makes this value non-enumerable and also makes the name __renderMarkdown.

Testing

Hoping CI doesn't break 🤞🏻

Docs

Internal change only

@changeset-bot
Copy link

changeset-bot bot commented Mar 22, 2022

🦋 Changeset detected

Latest commit: 25f2f2d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
astro Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 22, 2022
Copy link
Contributor

@bholmesdev bholmesdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For something mark "do not use," we sure made it easy to use huh?

@matthewp
Copy link
Contributor

It could also be a Symbol() and would be about as private as you can get (you could only get to it through Object.getOwnPropertySymbols). Or you could use a WeakMap to make it actually private. I don't particularly care, just throwing out options.

@natemoo-re natemoo-re merged commit c781b12 into main Mar 22, 2022
@natemoo-re natemoo-re deleted the fix/hide-render-md branch March 22, 2022 21:27
@github-actions github-actions bot mentioned this pull request Mar 22, 2022
@natemoo-re
Copy link
Member Author

Welp, I merged this as you were leaving that comment. Either would be fine, but I'm not too concerned about it actually being private. Just removing it from console.log(Astro) should be fine.

@github-actions github-actions bot mentioned this pull request Mar 25, 2022
SiriousHunter pushed a commit to SiriousHunter/astro that referenced this pull request Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants