Skip to content

refactor(core): detect if codegen should quote property without using eval()#8045

Merged
Josh-Cena merged 1 commit into
mainfrom
jc/no-eval
Sep 2, 2022
Merged

refactor(core): detect if codegen should quote property without using eval()#8045
Josh-Cena merged 1 commit into
mainfrom
jc/no-eval

Conversation

@Josh-Cena
Copy link
Copy Markdown
Collaborator

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Split out from #7993

Test Plan

Test links

Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/

Related issues/PRs

@Josh-Cena Josh-Cena added the pr: ignore This PR is not meaningful enough to appear in the changelog. label Sep 2, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Sep 2, 2022
@Josh-Cena Josh-Cena changed the title refactor(core): detect if should quote property when codegen without using eval() refactor(core): detect if codegen should quote property without using eval() Sep 2, 2022
@netlify
Copy link
Copy Markdown

netlify Bot commented Sep 2, 2022

[V2]

Name Link
🔨 Latest commit f3333d3
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/631283d039ad200008ecde78
😎 Deploy Preview https://deploy-preview-8045--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 2, 2022

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 76 🟢 98 🟢 100 🟢 100 🟠 80 Report
/docs/installation 🟠 76 🟢 100 🟢 100 🟢 100 🟢 90 Report

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 2, 2022

Size Change: 0 B

Total Size: 813 kB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 52.1 kB
website/build/assets/css/styles.********.css 111 kB
website/build/assets/js/main.********.js 609 kB
website/build/index.html 40.8 kB

compressed-size-action

@Josh-Cena Josh-Cena merged commit 46d705a into main Sep 2, 2022
@Josh-Cena Josh-Cena deleted the jc/no-eval branch September 2, 2022 23:52
})(propName);
// Escape quotes as well
const key = shouldQuote ? JSON.stringify(propName) : propName;
const isIdentifier =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what about the test 😅 not really confident it works here, but it looks like it does

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We already have decent tests for this, plus this is a direct translation of the spec, so I won't worry about it too much.

slorber pushed a commit that referenced this pull request Sep 7, 2022
… eval() (#8045)

refactor(core): detect if should quote property when codegen without using eval()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: ignore This PR is not meaningful enough to appear in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants