Comments (4)
Thanks for filing! Per @himself65’s comment this does appear to stem from Babel. We’ve noticed other issues with Babel incorrectly escaping JSX string attributes. However we can workaround this in the compiler by trying to detect when Babel would escape incorrectly and emit code differently. We’ll take a look!
from react.
@SukkaW yup JsxExpressionContainer is the workaround we’ve been using for these types of Babel escaping issues. We can’t depend on 8 yet just because of the need for backward compatibility.
from react.
@josephsavona IMHO the most efficient and straight forward workaround would be like this:
// React Compiler emitting
<div aria-label={'\u6211\u80FD\u541E\u4E0B\u73BB\u7483\u800C\u4E0D\u4F24\u8EAB\u4F53'} />
This works with all existing JSX transformers (Babel, SWC, ESBuild).
from react.
Thanks for filing! Per @himself65’s comment this does appear to stem from Babel. We’ve noticed other issues with Babel incorrectly escaping JSX string attributes. However we can workaround this in the compiler by trying to detect when Babel would escape incorrectly and emit code differently. We’ll take a look!
Yeah I think this from babel issue and here is a workaround for playground code
Subject: [PATCH] fix: files
---
Index: compiler/apps/playground/package.json
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/compiler/apps/playground/package.json b/compiler/apps/playground/package.json
--- a/compiler/apps/playground/package.json (revision 5ab54718a52d738dcbd03fcb43a556993b445ed4)
+++ b/compiler/apps/playground/package.json (date 1715928974123)
@@ -12,15 +12,15 @@
"test": "playwright test"
},
"dependencies": {
- "@babel/core": "^7.19.1",
- "@babel/parser": "^7.19.1",
- "@babel/plugin-syntax-typescript": "^7.18.6",
- "@babel/plugin-transform-block-scoping": "^7.18.9",
- "@babel/plugin-transform-modules-commonjs": "^7.18.6",
- "@babel/preset-react": "^7.18.6",
- "@babel/preset-typescript": "^7.18.6",
- "@babel/traverse": "^7.19.1",
- "@babel/types": "^7.19.0",
+ "@babel/core": "8.0.0-alpha.8",
+ "@babel/parser": "8.0.0-alpha.8",
+ "@babel/plugin-syntax-typescript": "8.0.0-alpha.8",
+ "@babel/plugin-transform-block-scoping": "8.0.0-alpha.8",
+ "@babel/plugin-transform-modules-commonjs": "8.0.0-alpha.8",
+ "@babel/preset-react": "8.0.0-alpha.8",
+ "@babel/preset-typescript": "8.0.0-alpha.8",
+ "@babel/traverse": "8.0.0-alpha.8",
+ "@babel/types": "8.0.0-alpha.8",
"@heroicons/react": "^1.0.6",
"@monaco-editor/react": "^4.4.6",
"@playwright/test": "^1.42.1",
@@ -52,10 +52,10 @@
"tailwindcss": "^3.2.4"
},
"resolutions": {
- "./**/@babel/parser": "7.7.4",
- "./**/@babel/types": "7.7.4",
- "@babel/core": "7.2.0",
- "@babel/traverse": "7.1.6",
- "@babel/generator": "7.2.0"
+ "./**/@babel/parser": "8.0.0-alpha.8",
+ "./**/@babel/types": "8.0.0-alpha.8",
+ "@babel/core": "8.0.0-alpha.8",
+ "@babel/traverse": "8.0.0-alpha.8",
+ "@babel/generator": "8.0.0-alpha.8"
}
}
![image](https://private-user-images.githubusercontent.com/14026360/331494517-83aeab8a-9ddc-4ab4-8d86-ebee856e9e49.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkyMDM2OTMsIm5iZiI6MTcxOTIwMzM5MywicGF0aCI6Ii8xNDAyNjM2MC8zMzE0OTQ1MTctODNhZWFiOGEtOWRkYy00YWI0LThkODYtZWJlZTg1NmU5ZTQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI0VDA0Mjk1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU2NjdhY2QyN2RmM2FhMzI0OTc3NWViZDkxMmNkZjRkMDJlMjU3MDg3OTFhODVkNjNjN2NlZmY5ZjFhMjY5MzUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.nThSVkZOUQ7_Rx0SRthEaVSFIFwTaEZO3tBkVxg4dwU)
from react.
Related Issues (20)
- [React 19] useEffect does not re-fire on hot reload with React 19 and vite HOT 5
- Bug: Hundreds render of Suspense child with hydration error HOT 6
- Bug: Receiving `Error: Should have a queue. This is likely a bug in React. Please file an issue` on usage of `next-safe-action`'s `useAction` hook HOT 1
- [React 19] infinite loop when using React lazy & functional formAction together. HOT 4
- The const array variable value populated in a function does not reflect the updated values when called in another function in Firefox HOT 2
- Bug: DoS vulnerability in ws dependency
- [React 19] Inconsistent "cache" api with Async Operations in react-server HOT 2
- [Compiler Bug]: Increment expression in for-loop loses assignment operation HOT 4
- Bug: TypeError: Cannot read properties of null (reading 'useState')
- Ensures role attribute has an appropriate value for the element (aria-allowed-role - https://dequeuniversity.com/rules/axe/4.7/aria-allowed-role?application=msftAI) HOT 1
- Ensures ARIA attributes are allowed for an element's role (aria-allowed-attr - https://accessibilityinsights.io/info-examples/web/aria-allowed-attr)Bug: HOT 1
- Bug: HOT 1
- [VLG]¿Cómo hablar con Vueling por teléfono? @telefono españa HOT 1
- hook invalid
- Feature request: Expose additional profiling tools for library testing HOT 6
- Bug: "Should have a queue. This is likely a bug in React" HOT 11
- [React 19]
- [React 19] requestFormReset reports TypeError Cannot read properties of null (reading 'queue') on repeated form submissions HOT 3
- [Compiler Bug]: healthcheck do not check next.js StrictMode HOT 5
- [React 19] Different behaviors with `preload` method HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react.