FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: Emit correct sourcemap ranges for `JSXText` by liuxingbaoyu · Pull Request #15233 · babel/babel · GitHub

/ babel Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .js  (1) .json  (2) .mjs  (1) .ts  (1) All 4 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
      • input.js
      • options.json
      • output.mjs
      • source-map.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

export default function App() {
return (
<div className="App">
<h1>Welcome to my application!</h1>
This is my app!
<strong>MINE.</strong>
</div>
)
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sourceType": "module",
"plugins": [["transform-react-jsx", { "runtime": "classic" }]],
"sourceMap": true
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';
export default function App() {
return /*#__PURE__*/React.createElement("div", {
className: "App"
}, /*#__PURE__*/React.createElement("h1", null, "Welcome to my application!"), "This is my app!", /*#__PURE__*/React.createElement("strong", null, "MINE."));
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 3,
"names": [
"React",
"App"
],
"sources": [
"sourcemaps/JSXText/input.js"
],
"sourcesContent": [
"import React from 'react';\n\nexport default function App() {\n return (\n <div className=\"App\">\n <h1>Welcome to my application!</h1>\n This is my app!\n <strong>MINE.</strong>\n </div>\n )\n}"
],
"mappings": "AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,eAAe,SAASC,GAAG,GAAG;EAC5B,oBACE;IAAK,SAAS,EAAC;EAAK,gBAClB,gCAAI,4BAA0B,CAAK,mBAEnC,mDAAQ,OAAK,CAAS,CAClB;AAEV"
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { stringLiteral } from "../../builders/generated";
import type * as t from "../..";
import { inherits } from "../..";

export default function cleanJSXElementLiteralChild(
child: {
value: string;
},
child: t.JSXText,
args: Array<t.Node>,
) {
const lines = child.value.split(/\r\n|\n|\r/);
Expand Down Expand Up @@ -48,5 +47,5 @@ export default function cleanJSXElementLiteralChild(
}
}

if (str) args.push(stringLiteral(str));
if (str) args.push(inherits(stringLiteral(str), child));
}

Back | FazBrowse Home | New Git URL