file_path
stringlengths
3
280
file_language
stringclasses
66 values
content
stringlengths
1
1.04M
repo_name
stringlengths
5
92
repo_stars
int64
0
154k
repo_description
stringlengths
0
402
repo_primary_language
stringclasses
108 values
developer_username
stringlengths
1
25
developer_name
stringlengths
0
30
developer_company
stringlengths
0
82
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_display_name_export_default.js
JavaScript
export default React.createClass({ render: function render() { return null; }, displayName: "input" });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_display_name_if_missing.js
JavaScript
var Whateva = React.createClass({ displayName: "Whatever", render: function render() { return null; } }); var Bar = React.createClass({ "displayName": "Ba", render: function render() { return null; } });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_display_name_object_declaration.js
JavaScript
exports = { Component: React.createClass({ render: function render() { return null; }, displayName: "Component" }) };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_display_name_property_assignment.js
JavaScript
exports.Component = React.createClass({ render: function render() { return null; }, displayName: "Component" });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_display_name_variable_declaration.js
JavaScript
var Component = React.createClass({ render: function render() { return null; }, displayName: "Component" });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_dont_coerce_expression_containers.js
JavaScript
/*#__PURE__*/ React.createElement(Text, null, "To get started, edit index.ios.js!!!", "\n", "Press Cmd+R to reload");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_honor_custom_jsx_comment.js
JavaScript
/** @jsx dom */ /*#__PURE__*/ dom(Foo, null); var profile = /*#__PURE__*/ dom("div", null, /*#__PURE__*/ dom("img", { src: "avatar.png", className: "profile" }), /*#__PURE__*/ dom("h3", null, [ user.firstName, user.lastName ].join(" ")));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_honor_custom_jsx_comment_if_jsx_pragma_option_set.js
JavaScript
/** @jsx dom */ /*#__PURE__*/ dom(Foo, null); var profile = /*#__PURE__*/ dom("div", null, /*#__PURE__*/ dom("img", { src: "avatar.png", className: "profile" }), /*#__PURE__*/ dom("h3", null, [ user.firstName, user.lastName ].join(" ")));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_honor_custom_jsx_pragma_option.js
JavaScript
/*#__PURE__*/ dom(Foo, null); var profile = /*#__PURE__*/ dom("div", null, /*#__PURE__*/ dom("img", { src: "avatar.png", className: "profile" }), /*#__PURE__*/ dom("h3", null, [ user.firstName, user.lastName ].join(" ")));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_jsx_with_retainlines_option.js
JavaScript
var div = /*#__PURE__*/ React.createElement("div", null, "test");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_jsx_without_retainlines_option.js
JavaScript
var div = /*#__PURE__*/ React.createElement("div", null, "test");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_add_quotes_es3.js
JavaScript
var es3 = /*#__PURE__*/ React.createElement(F, { aaa: true, "new": true, "const": true, "var": true, "default": true, "foo-bar": true });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_allow_constructor_as_prop.js
JavaScript
/*#__PURE__*/ React.createElement(Component, { constructor: "foo" });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_allow_deeper_js_namespacing.js
JavaScript
/*#__PURE__*/ React.createElement(Namespace.DeepNamespace.Component, null);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_allow_elements_as_attributes.js
JavaScript
/*#__PURE__*/ React.createElement("div", { attr: /*#__PURE__*/ React.createElement("div", null) });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_allow_js_namespacing.js
JavaScript
/*#__PURE__*/ React.createElement(Namespace.Component, null);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_allow_nested_fragments.js
JavaScript
/*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("span", null, "Hello"), /*#__PURE__*/ React.createElement("span", null, "world")), /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("span", null, "Goodbye"), /*#__PURE__*/ React.createElement("span", null, "world"))));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_allow_no_pragmafrag_if_frag_unused.js
JavaScript
/** @jsx dom */ /*#__PURE__*/ dom("div", null, "no fragment is used");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_allow_pragmafrag_and_frag.js
JavaScript
/** @jsx dom */ /** @jsxFrag DomFrag */ /*#__PURE__*/ dom(DomFrag, null);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_avoid_wrapping_in_extra_parens_if_not_needed.js
JavaScript
var x = /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement(Component, null)); var x = /*#__PURE__*/ React.createElement("div", null, props.children); var x = /*#__PURE__*/ React.createElement(Composite, null, props.children); var x = /*#__PURE__*/ React.createElement(Composite, null, /*#__PURE__*/ React.createElement(Composite2, null));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_convert_simple_tags.js
JavaScript
var x = /*#__PURE__*/ React.createElement("div", null);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_convert_simple_text.js
JavaScript
var x = /*#__PURE__*/ React.createElement("div", null, "text");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_escape_unicode_chars_in_attribute.js
JavaScript
/*#__PURE__*/ React.createElement(Bla, { title: "Ú" });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_escape_xhtml_jsxattribute.js
JavaScript
/*#__PURE__*/ React.createElement("div", { id: "wôw" }); /*#__PURE__*/ React.createElement("div", { id: "\\w" }); /*#__PURE__*/ React.createElement("div", { id: "w < w" });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_escape_xhtml_jsxtext_1.js
JavaScript
/*#__PURE__*/ React.createElement("div", null, "wow"); /*#__PURE__*/ React.createElement("div", null, "wôw"); /*#__PURE__*/ React.createElement("div", null, "w & w"); /*#__PURE__*/ React.createElement("div", null, "w & w"); /*#__PURE__*/ React.createElement("div", null, "w   w"); /*#__PURE__*/ React.createElement("div", null, "this should parse as unicode: ", '\u00a0 '); /*#__PURE__*/ React.createElement("div", null, "w < w");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_escape_xhtml_jsxtext_2.js
JavaScript
/*#__PURE__*/ React.createElement("div", null, "this should not parse as unicode: \\u00a0");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_handle_attributed_elements.js
JavaScript
var HelloMessage = React.createClass({ render: function() { return /*#__PURE__*/ React.createElement("div", null, "Hello ", this.props.name); }, displayName: "HelloMessage" }); React.render(/*#__PURE__*/ React.createElement(HelloMessage, { name: /*#__PURE__*/ React.createElement("span", null, "Sebastian") }), mountNode);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_handle_has_own_property_correctly.js
JavaScript
/*#__PURE__*/ React.createElement("hasOwnProperty", null, "testing");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_have_correct_comma_in_nested_children.js
JavaScript
var x = /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("br", null)), /*#__PURE__*/ React.createElement(Component, null, foo, /*#__PURE__*/ React.createElement("br", null), bar), /*#__PURE__*/ React.createElement("br", null));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_insert_commas_after_expressions_before_whitespace.js
JavaScript
var x = /*#__PURE__*/ React.createElement("div", { attr1: "foo" + "bar", attr2: "foo" + "bar" + "baz" + "bug", attr3: "foo" + "bar" + "baz" + "bug", attr4: "baz" });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_not_add_quotes_to_identifier_names.js
JavaScript
var e = /*#__PURE__*/ React.createElement(F, { aaa: true, new: true, const: true, var: true, default: true, "foo-bar": true });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_not_mangle_expressioncontainer_attribute_values.js
JavaScript
/*#__PURE__*/ React.createElement("button", { "data-value": "a value\n with\nnewlines\n and spaces" }, "Button");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_not_strip_nbsp_even_coupled_with_other_whitespace.js
JavaScript
/*#__PURE__*/ React.createElement("div", null, "  ");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_not_strip_tags_with_a_single_child_of_nbsp.js
JavaScript
/*#__PURE__*/ React.createElement("div", null, " ");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_properly_handle_comments_between_props.js
JavaScript
var x = /*#__PURE__*/ React.createElement("div", { /* a multi-line comment */ attr1: "foo" }, /*#__PURE__*/ React.createElement("span" // a double-slash comment , { attr2: "bar" }));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_quote_jsx_attributes.js
JavaScript
/*#__PURE__*/ React.createElement("button", { "data-value": "a value" }, "Button");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_support_xml_namespaces_if_flag.js
JavaScript
/*#__PURE__*/ h("f:image", { "n:attr": true });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_should_transform_known_hyphenated_tags.js
JavaScript
/*#__PURE__*/ React.createElement("font-face", null);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_wraps_props_in_react_spread_for_first_spread_attributes.js
JavaScript
/*#__PURE__*/ React.createElement(Component, { ...x, y: 2, z: true });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_wraps_props_in_react_spread_for_last_spread_attributes.js
JavaScript
/*#__PURE__*/ React.createElement(Component, { y: 2, z: true, ...x });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/react_wraps_props_in_react_spread_for_middle_spread_attributes.js
JavaScript
/*#__PURE__*/ React.createElement(Component, { y: 2, ...x, z: true });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/use_builtins_assignment.js
JavaScript
var div = /*#__PURE__*/ React.createElement(Component, { ...props, foo: "bar" });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx/tests.rs/use_spread_assignment.js
JavaScript
/*#__PURE__*/ React.createElement(Component, { y: 2, ...x, z: true });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx_self/tests.rs/arrow_function.js
JavaScript
var _this = this; <div __self={this}/>; (function() { return <div __self={_this}/>; }); function fn() { var _this = this; <div __self={this}/>; (function() { return <div __self={_this}/>; }); }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx_self/tests.rs/basic_sample.js
JavaScript
var x = <sometag __self={this}/>;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx_self/tests.rs/disable_with_super.js
JavaScript
class A { } class B extends A { constructor(){ <sometag1/>; super(<sometag2/>); <sometag3/>; } } class C { constructor(){ <sometag4 __self={this}/>; class D extends A { constructor(){ super(); } } const E = class extends A { constructor(){ super(); } }; } } class E extends A { constructor(){ this.x = ()=><sometag5/>; this.y = function() { return <sometag6 __self={this}/>; }; function z() { return <sometag7 __self={this}/>; } { <sometag8/>; } super(); } } class F { constructor(){ <sometag9 __self={this}/>; } } class G extends A { constructor(){ return <sometag10/>; } }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/jsx_src/tests.rs/no_jsx.js
JavaScript
var x = 42;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/anonymous_function_expressions_declaration.js
JavaScript
let Hello = function() { function handleClick() {} return <h1 onClick={handleClick}>Hi</h1>; }; _c = Hello; const Bar = function Baz() { return <Hello/>; }; _c1 = Bar; function sum() {} let Baz = 10; var Qux; var _c, _c1; $RefreshReg$(_c, "Hello"); $RefreshReg$(_c1, "Bar");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/custom_identifier.js
JavaScript
var _s = import_meta_refreshSig(); export default function Bar() { _s(); useContext(X); return <Foo/>; } _s(Bar, "useContext{}"); _c = Bar; var _c; import_meta_refreshReg(_c, "Bar");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/dont_consider_iife_as_hoc.js
JavaScript
while(item){ var _s = $RefreshSig$(); _s((item1)=>{ _s(); useFoo(); }, "useFoo{}", true)(item); }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/dont_consider_require_as_hoc.js
JavaScript
const A = require('A'); const B = foo ? require('X') : require('Y'); const C = requireCond(gk, 'C'); const D = import('D'); import E = require('E'); export default function App() { return <div> <A/> <B/> <C/> <D/> <E/> </div>; } _c = App; var _c; $RefreshReg$(_c, "App");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/export_function.js
JavaScript
export function Hello() { function handleClick() {} return <h1 onClick={handleClick}>Hi</h1>; } _c = Hello; export default function Bar() { return <Hello/>; } _c1 = Bar; function Baz() { return <h1>OK</h1>; } _c2 = Baz; const NotAComp = 'hi'; export { Baz, NotAComp }; export function sum() {} export const Bad = 42; var _c, _c1, _c2; $RefreshReg$(_c, "Hello"); $RefreshReg$(_c1, "Bar"); $RefreshReg$(_c2, "Baz");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/export_named_arrow_function.js
JavaScript
export const Hello = ()=>{ function handleClick() {} return <h1 onClick={handleClick}>Hi</h1>; }; _c = Hello; export let Bar = (props)=><Hello/>; _c1 = Bar; export default (()=>{ // This one should be ignored. // You should name your components. return <Hello/>; }); var _c, _c1; $RefreshReg$(_c, "Hello"); $RefreshReg$(_c1, "Bar");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/gen_valid_hook_signatures_for_exotic_hooks.js
JavaScript
var _s = $RefreshSig$(); import FancyHook from 'fancy'; export default function App() { _s(); var _s1 = $RefreshSig$(); function useFancyState() { _s1(); const [foo, setFoo] = React.useState(0); useFancyEffect(); return foo; } _s1(useFancyState, "useState{[foo, setFoo](0)}\nuseFancyEffect{}", true); const bar = useFancyState(); const baz = FancyHook.useThing(); React.useState(); useThePlatform(); return <h1>{bar}{baz}</h1>; } _s(App, "useFancyState{bar}\nuseThing{baz}\nuseState{}\nuseThePlatform{}", true, function() { return [ FancyHook.useThing ]; }); _c = App; var _c; $RefreshReg$(_c, "App");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/hook_signatures_should_include_custom_hook.js
JavaScript
var _s = $RefreshSig$(), _s1 = $RefreshSig$(), _s2 = $RefreshSig$(); function useFancyState() { _s(); const [foo, setFoo] = React.useState(0); useFancyEffect(); return foo; } _s(useFancyState, "useState{[foo, setFoo](0)}\nuseFancyEffect{}", false, function() { return [ useFancyEffect ]; }); const useFancyEffect = ()=>{ _s1(); React.useEffect(()=>{}); }; _s1(useFancyEffect, "useEffect{}"); export default function App() { _s2(); const bar = useFancyState(); return <h1>{bar}</h1>; } _s2(App, "useFancyState{bar}", false, function() { return [ useFancyState ]; }); _c = App; var _c; $RefreshReg$(_c, "App");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/ignore_complex_definition.js
JavaScript
let A = foo ? ()=>{ return <h1>Hi</h1>; } : null; const B = function Foo() { return <h1>Hi</h1>; }(); let C = ()=>()=>{ return <h1>Hi</h1>; }; let D = bar && (()=>{ return <h1>Hi</h1>; });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/ignore_hoc.js
JavaScript
let connect = ()=>{ function Comp() { const handleClick = ()=>{}; return <h1 onClick={handleClick}>Hi</h1>; } return Comp; }; function withRouter() { return function Child() { const handleClick = ()=>{}; return <h1 onClick={handleClick}>Hi</h1>; }; } ;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/ignore_not_hoc.js
JavaScript
const throttledAlert = throttle(function() { alert('Hi'); }); const TooComplex = function() { return hello; }(()=>{}); if (cond) { const Foo = thing(()=>{}); }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/ignore_unnamed_function_declarations.js
JavaScript
export default function() {}
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/include_hook_signature_in_commonjs.js
JavaScript
var _s = $RefreshSig$(); import { useFancyState } from './hooks'; import useFoo from './foo'; export default function App() { _s(); const bar = useFancyState(); const foo = useFoo(); return /*#__PURE__*/ React.createElement("h1", null, bar); } _s(App, "useFancyState{bar}\nuseFoo{foo}", false, function() { return [ useFancyState, useFoo ]; }); _c = App; var _c; $RefreshReg$(_c, "App");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/issue_1865.js
JavaScript
var _s = $RefreshSig$(); function useHooks() { _s(); return useMemo(()=>1); } _s(useHooks, "useMemo{}"); declare module 'x' { }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/issue_2261.js
JavaScript
var _s = $RefreshSig$(); export function App() { _s(); console.log(useState()); return null; } _s(App, "useState{}"); _c = App; var _c; $RefreshReg$(_c, "App");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/issue_6022.js
JavaScript
/* @refresh reset */ var _s = $RefreshSig$(); import { useState } from 'react'; function Counter() { _s(); const [count, setCount] = useState(0); return <button type="button" onClick={()=>setCount((c)=>c + 1)}>{count}</button>; } _s(Counter, "useState{[count, setCount](0)}", true); _c = Counter; var _c; $RefreshReg$(_c, "Counter");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/named_arrow_function_expressions_declaration.js
JavaScript
let Hello = ()=>{ const handleClick = ()=>{}; return <h1 onClick={handleClick}>Hi</h1>; }; _c = Hello; const Bar = ()=>{ return <Hello/>; }; _c1 = Bar; var Baz = ()=><div/>; _c2 = Baz; var sum = ()=>{}; var _c, _c1, _c2; $RefreshReg$(_c, "Hello"); $RefreshReg$(_c1, "Bar"); $RefreshReg$(_c2, "Baz");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/nested_hook.js
JavaScript
const a = (a)=>{ var _s = $RefreshSig$(); const useE = useEffect; return _s(function useFoo() { _s(); useE(()=>console.log(a), []); return useState(123); }, "useE{}\nuseState{(123)}", false, function() { return [ useE ]; }); };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/next_001.js
JavaScript
import dynamic from 'next/dynamic'; export const Comp = dynamic(_c = ()=>import('../Content'), { ssr: false }); _c1 = Comp; var _c, _c1; $RefreshReg$(_c, "Comp$dynamic"); $RefreshReg$(_c1, "Comp");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/normal_function.js
JavaScript
function Hello() { function handleClick() {} return <h1 onClick={handleClick}>Hi</h1>; } _c = Hello; function Bar() { return <Hello/>; } _c1 = Bar; var _c, _c1; $RefreshReg$(_c, "Hello"); $RefreshReg$(_c1, "Bar");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/pascal_case_only.js
JavaScript
function hello() { return 2 * 2; }
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/reassigned_function.js
JavaScript
function Hello() { return <h1>Hi</h1>; } _c = Hello; Hello = connect(Hello); var _c; $RefreshReg$(_c, "Hello");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/register_capitalized_identifiers_in_hoc.js
JavaScript
function Foo() { return <h1>Hi</h1>; } _c = Foo; export default _c1 = hoc(Foo); export const A = hoc(Foo); _c2 = A; const B = hoc(Foo); _c3 = B; var _c, _c1, _c2, _c3; $RefreshReg$(_c, "Foo"); $RefreshReg$(_c1, "%default%"); $RefreshReg$(_c2, "A"); $RefreshReg$(_c3, "B");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/register_fn_expr_with_hooks.js
JavaScript
var _s = $RefreshSig$(), _s1 = $RefreshSig$(); export const A = _s(React.memo(_c1 = _s(React.forwardRef(_c = _s((props, ref1)=>{ _s(); const [foo, setFoo] = useState(0); React.useEffect(()=>{}); return <h1 ref={ref1}>{foo}</h1>; }, "useState{[foo, setFoo](0)}\nuseEffect{}")), "useState{[foo, setFoo](0)}\nuseEffect{}")), "useState{[foo, setFoo](0)}\nuseEffect{}"); _c2 = A; export const B = _s1(React.memo(_c4 = _s1(React.forwardRef(_c3 = _s1(function(props, ref1) { _s1(); const [foo, setFoo] = useState(0); React.useEffect(()=>{}); return <h1 ref={ref1}>{foo}</h1>; }, "useState{[foo, setFoo](0)}\nuseEffect{}")), "useState{[foo, setFoo](0)}\nuseEffect{}")), "useState{[foo, setFoo](0)}\nuseEffect{}"); _c5 = B; function hoc() { var _s = $RefreshSig$(); return _s(function Inner() { _s(); const [foo, setFoo] = useState(0); React.useEffect(()=>{}); return <h1 ref={ref}>{foo}</h1>; }, "useState{[foo, setFoo](0)}\nuseEffect{}"); } export let C = hoc(); var _c, _c1, _c2, _c3, _c4, _c5; $RefreshReg$(_c, "A$React.memo$React.forwardRef"); $RefreshReg$(_c1, "A$React.memo"); $RefreshReg$(_c2, "A"); $RefreshReg$(_c3, "B$React.memo$React.forwardRef"); $RefreshReg$(_c4, "B$React.memo"); $RefreshReg$(_c5, "B");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/register_fn_expr_with_hooks_2.js
JavaScript
var _s = $RefreshSig$(), _s1 = $RefreshSig$(); const A = function() { _s(); const [foo, setFoo] = useState(0); }, B = ()=>{ _s1(); const [foo, setFoo] = useState(0); }; _s(A, "useState{[foo, setFoo](0)}"); _s1(B, "useState{[foo, setFoo](0)}");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/register_fn_with_hooks.js
JavaScript
var _s = $RefreshSig$(); export default function App() { _s(); const [foo, setFoo] = useState(0); React.useEffect(()=>{}); return <h1>{foo}</h1>; } _s(App, "useState{[foo, setFoo](0)}\nuseEffect{}"); _c = App; var _c; $RefreshReg$(_c, "App");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/register_fn_with_hooks_2.js
JavaScript
var _s = $RefreshSig$(), _s1 = $RefreshSig$(), _s2 = $RefreshSig$(); export function Foo() { _s(); const [foo, setFoo] = useState(0); React.useEffect(()=>{}); return <h1>{foo}</h1>; } _s(Foo, "useState{[foo, setFoo](0)}\nuseEffect{}"); _c = Foo; function Bar() { _s1(); const [foo, setFoo] = useState(0); React.useEffect(()=>{}); return <h1>{foo}</h1>; } _s1(Bar, "useState{[foo, setFoo](0)}\nuseEffect{}"); _c1 = Bar; function baz() { _s2(); return useState(), useState(); } _s2(baz, "useState{}\nuseState{}"); var _c, _c1; $RefreshReg$(_c, "Foo"); $RefreshReg$(_c1, "Bar");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/register_identifiers_used_in_create_element.js
JavaScript
import A from './A'; import Store from './Store'; Store.subscribe(); const Header = styled.div`color: red`; _c = Header; const StyledFactory1 = styled('div')`color: hotpink`; _c1 = StyledFactory1; const StyledFactory2 = styled('div')({ color: 'hotpink' }); _c2 = StyledFactory2; const StyledFactory3 = styled(A)({ color: 'hotpink' }); _c3 = StyledFactory3; const FunnyFactory = funny.factory``; let Alias1 = A; let Alias2 = A.Foo; const Dict = {}; function Foo() { return [ React.createElement(A), React.createElement(B), React.createElement(StyledFactory1), React.createElement(StyledFactory2), React.createElement(StyledFactory3), React.createElement(Alias1), React.createElement(Alias2), jsx(Header), React.createElement(Dict.X) ]; } _c4 = Foo; React.createContext(Store); const B = hoc(A); _c5 = B; // This is currently registered as a false positive: const NotAComponent = wow(A); // We could avoid it but it also doesn't hurt. _c6 = NotAComponent; var _c, _c1, _c2, _c3, _c4, _c5, _c6; $RefreshReg$(_c, "Header"); $RefreshReg$(_c1, "StyledFactory1"); $RefreshReg$(_c2, "StyledFactory2"); $RefreshReg$(_c3, "StyledFactory3"); $RefreshReg$(_c4, "Foo"); $RefreshReg$(_c5, "B"); $RefreshReg$(_c6, "NotAComponent");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/register_identifiers_used_in_jsx.js
JavaScript
import A from './A'; import Store from './Store'; Store.subscribe(); const Header = styled.div`color: red`; _c = Header; const StyledFactory1 = styled('div')`color: hotpink`; _c1 = StyledFactory1; const StyledFactory2 = styled('div')({ color: 'hotpink' }); _c2 = StyledFactory2; const StyledFactory3 = styled(A)({ color: 'hotpink' }); _c3 = StyledFactory3; const FunnyFactory = funny.factory``; let Alias1 = A; let Alias2 = A.Foo; const Dict = {}; function Foo() { return <div><A/><B/><StyledFactory1/><StyledFactory2/><StyledFactory3/><Alias1/><Alias2/><Header/><Dict.X/></div>; } _c4 = Foo; const B = hoc(A); _c5 = B; // This is currently registered as a false positive: const NotAComponent = wow(A); // We could avoid it but it also doesn't hurt. _c6 = NotAComponent; var _c, _c1, _c2, _c3, _c4, _c5, _c6; $RefreshReg$(_c, "Header"); $RefreshReg$(_c1, "StyledFactory1"); $RefreshReg$(_c2, "StyledFactory2"); $RefreshReg$(_c3, "StyledFactory3"); $RefreshReg$(_c4, "Foo"); $RefreshReg$(_c5, "B"); $RefreshReg$(_c6, "NotAComponent");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/register_implicit_arrow_returns.js
JavaScript
var _s = $RefreshSig$(), _s1 = $RefreshSig$(), _s2 = $RefreshSig$(), _s3 = $RefreshSig$(), _s4 = $RefreshSig$(), _s5 = $RefreshSig$(); export default _s(()=>{ _s(); return useContext(X); }, "useContext{}"); export const Foo = ()=>{ _s1(); return useContext(X); }; _s1(Foo, "useContext{}"); _c = Foo; module.exports = _s2(()=>{ _s2(); return useContext(X); }, "useContext{}"); const Bar = ()=>{ _s3(); return useContext(X); }; _s3(Bar, "useContext{}"); _c1 = Bar; const Baz = _s4(memo(_c2 = _s4(()=>{ _s4(); return useContext(X); }, "useContext{}")), "useContext{}"); _c3 = Baz; const Qux = ()=>{ _s5(); return 0, useContext(X); }; _s5(Qux, "useContext{}"); _c4 = Qux; var _c, _c1, _c2, _c3, _c4; $RefreshReg$(_c, "Foo"); $RefreshReg$(_c1, "Bar"); $RefreshReg$(_c2, "Baz$memo"); $RefreshReg$(_c3, "Baz"); $RefreshReg$(_c4, "Qux");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/register_likely_hoc_1.js
JavaScript
const A = forwardRef(_c = function() { return <h1>Foo</h1>; }); _c1 = A; export const B = memo(_c3 = React.forwardRef(_c2 = ()=>{ return <h1>Foo</h1>; })); _c4 = B; export default _c7 = React.memo(_c6 = forwardRef(_c5 = (props, ref)=>{ return <h1>Foo</h1>; })); var _c, _c1, _c2, _c3, _c4, _c5, _c6, _c7; $RefreshReg$(_c, "A$forwardRef"); $RefreshReg$(_c1, "A"); $RefreshReg$(_c2, "B$memo$React.forwardRef"); $RefreshReg$(_c3, "B$memo"); $RefreshReg$(_c4, "B"); $RefreshReg$(_c5, "%default%$React.memo$forwardRef"); $RefreshReg$(_c6, "%default%$React.memo"); $RefreshReg$(_c7, "%default%");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/register_likely_hoc_2.js
JavaScript
export default _c2 = React.memo(_c1 = forwardRef(_c = function(props, ref) { return <h1>Foo</h1>; })); var _c, _c1, _c2; $RefreshReg$(_c, "%default%$React.memo$forwardRef"); $RefreshReg$(_c1, "%default%$React.memo"); $RefreshReg$(_c2, "%default%");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/register_likely_hoc_3.js
JavaScript
export default _c2 = React.memo(_c1 = forwardRef(_c = function Named(props, ref) { return <h1>Foo</h1>; })); var _c, _c1, _c2; $RefreshReg$(_c, "%default%$React.memo$forwardRef"); $RefreshReg$(_c1, "%default%$React.memo"); $RefreshReg$(_c2, "%default%");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/register_likely_hoc_4.js
JavaScript
function Foo() { return <div>123</div>; } _c = Foo; export default _c1 = memo(Foo); var _c, _c1; $RefreshReg$(_c, "Foo"); $RefreshReg$(_c1, "%default%");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/__swc_snapshots__/src/refresh/tests.rs/should_refresh_when_has_comment.js
JavaScript
var _s = $RefreshSig$(), _s1 = $RefreshSig$(); export function Foo() { _s(); const [foo, setFoo] = useState(0); React.useEffect(()=>{}); return <h1>{foo}</h1>; } _s(Foo, "useState{[foo, setFoo](0)}\nuseEffect{}", true); _c = Foo; function Bar() { _s1(); const [foo, setFoo] = useState(0); React.useEffect(()=>{ // @refresh reset }); return <h1>{foo}</h1>; } _s1(Bar, "useState{[foo, setFoo](0)}\nuseEffect{}", true); _c1 = Bar; var _c, _c1; $RefreshReg$(_c, "Foo"); $RefreshReg$(_c1, "Bar");
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/integration/fixture/jsx-dev-transform/input.js
JavaScript
const App = ( <div> <div /> <> <div key={1}>hoge</div> </> </div> );
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/integration/fixture/jsx-dev-transform/output.mjs
JavaScript
import { jsxDEV as _jsxDEV, Fragment as _Fragment } from "react/jsx-dev-runtime"; const App = /*#__PURE__*/ _jsxDEV("div", { children: [ /*#__PURE__*/ _jsxDEV("div", {}, void 0, false, { fileName: "input.js", lineNumber: 3, columnNumber: 9 }, this), /*#__PURE__*/ _jsxDEV(_Fragment, { children: /*#__PURE__*/ _jsxDEV("div", { children: "hoge" }, 1, false, { fileName: "input.js", lineNumber: 5, columnNumber: 13 }, this) }, void 0, false) ] }, void 0, true, { fileName: "input.js", lineNumber: 2, columnNumber: 5 }, this);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/integration/fixture/jsx-transform/input.js
JavaScript
const App = ( <div> <div /> <> <div key={1}>hoge</div> </> </div> );
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/integration/fixture/jsx-transform/output.mjs
JavaScript
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; const App = /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", {}), /*#__PURE__*/ _jsx(_Fragment, { children: /*#__PURE__*/ _jsx("div", { children: "hoge" }, 1) }) ] });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/integration/fixture/jsxdev-args-with-fragment/input.js
JavaScript
var x = ( <> <div>hoge</div> <div>fuga</div> </> );
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/integration/fixture/jsxdev-args-with-fragment/output.js
JavaScript
import { jsxDEV as _jsxDEV, Fragment as _Fragment } from "react/jsx-dev-runtime"; var x = /*#__PURE__*/_jsxDEV(_Fragment, { children: [/*#__PURE__*/_jsxDEV("div", { children: "hoge" }, void 0, false, { fileName: "input.js", lineNumber: 3, columnNumber: 9 }, this), /*#__PURE__*/_jsxDEV("div", { children: "fuga" }, void 0, false, { fileName: "input.js", lineNumber: 4, columnNumber: 9 }, this)] }, void 0, true);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/integration/fixture/jsxdev-fragment/input.js
JavaScript
const App = ( <> <div>hoge</div> <div>fuga</div> </> );
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/integration/fixture/jsxdev-fragment/output.mjs
JavaScript
import { jsxDEV as _jsxDEV, Fragment as _Fragment } from "react/jsx-dev-runtime"; const App = /*#__PURE__*/_jsxDEV(_Fragment, { children: [/*#__PURE__*/_jsxDEV("div", { children: "hoge" }, void 0, false, { fileName: "input.js", lineNumber: 3, columnNumber: 9 }, this), /*#__PURE__*/_jsxDEV("div", { children: "fuga" }, void 0, false, { fileName: "input.js", lineNumber: 4, columnNumber: 9 }, this)] }, void 0, true);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/integration/fixture/with-pragma/input.js
JavaScript
/**@jsxRuntime automatic */ const App = ( <div> <div /> <> <div>hoge</div> </> </div> );
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/integration/fixture/with-pragma/output.mjs
JavaScript
/**@jsxRuntime automatic */ import { jsxDEV as _jsxDEV, Fragment as _Fragment } from "react/jsx-dev-runtime"; const App = /*#__PURE__*/ _jsxDEV("div", { children: [ /*#__PURE__*/ _jsxDEV("div", {}, void 0, false, { fileName: "input.js", lineNumber: 4, columnNumber: 9 }, this), /*#__PURE__*/ _jsxDEV(_Fragment, { children: /*#__PURE__*/ _jsxDEV("div", { children: "hoge" }, void 0, false, { fileName: "input.js", lineNumber: 6, columnNumber: 13 }, this) }, void 0, false) ] }, void 0, true, { fileName: "input.js", lineNumber: 3, columnNumber: 5 }, this);
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/jsx/fixture/3/input.js
JavaScript
import _JSXStyle from "styled-jsx/style"; const WithSidebar = ({ right = false, top = false, sidebar, sidebarWidth = 230, hideOnMobile = false, breakpoint = 730, children, }) => ( <main className={_JSXStyle.dynamic([ [ "4507deac72c40d6c", [ right ? "row-reverse" : "row", sidebarWidth, breakpoint, top ? "column" : "column-reverse", ], ], ])} > <Sidebar width={sidebarWidth} right={right} hide={hideOnMobile} breakpoint={breakpoint} > {sidebar} </Sidebar> <div className={_JSXStyle.dynamic([ [ "4507deac72c40d6c", [ right ? "row-reverse" : "row", sidebarWidth, breakpoint, top ? "column" : "column-reverse", ], ], ])} > {children} </div> <_JSXStyle id={"4507deac72c40d6c"} dynamic={[ right ? "row-reverse" : "row", sidebarWidth, breakpoint, top ? "column" : "column-reverse", ]} >{`main.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-flex-direction:${ right ? "row-reverse" : "row" };-ms-flex-direction:${right ? "row-reverse" : "row"};flex-direction:${ right ? "row-reverse" : "row" };-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:var(--geist-gap-double)}div.__jsx-style-dynamic-selector{width:100%;max-width:-webkit-calc(100% - ${sidebarWidth}px - var(--geist-gap-double));max-width:-moz-calc(100% - ${sidebarWidth}px - var(--geist-gap-double));max-width:calc(100% - ${sidebarWidth}px - var(--geist-gap-double))}@media(max-width:${breakpoint}px){main.__jsx-style-dynamic-selector{-webkit-flex-direction:${ top ? "column" : "column-reverse" };-ms-flex-direction:${ top ? "column" : "column-reverse" };flex-direction:${ top ? "column" : "column-reverse" }}div.__jsx-style-dynamic-selector{max-width:unset}}`}</_JSXStyle> </main> );
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/jsx/fixture/3/output.mjs
JavaScript
import _JSXStyle from "styled-jsx/style"; const WithSidebar = ({ right =false , top =false , sidebar , sidebarWidth =230 , hideOnMobile =false , breakpoint =730 , children , })=>/*#__PURE__*/ React.createElement("main", { className: _JSXStyle.dynamic([ [ "4507deac72c40d6c", [ right ? "row-reverse" : "row", sidebarWidth, breakpoint, top ? "column" : "column-reverse", ], ], ]) }, /*#__PURE__*/ React.createElement(Sidebar, { width: sidebarWidth, right: right, hide: hideOnMobile, breakpoint: breakpoint }, sidebar), /*#__PURE__*/ React.createElement("div", { className: _JSXStyle.dynamic([ [ "4507deac72c40d6c", [ right ? "row-reverse" : "row", sidebarWidth, breakpoint, top ? "column" : "column-reverse", ], ], ]) }, children), /*#__PURE__*/ React.createElement(_JSXStyle, { id: "4507deac72c40d6c", dynamic: [ right ? "row-reverse" : "row", sidebarWidth, breakpoint, top ? "column" : "column-reverse", ] }, `main.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-webkit-flex-direction:${right ? "row-reverse" : "row"};-ms-flex-direction:${right ? "row-reverse" : "row"};flex-direction:${right ? "row-reverse" : "row"};-webkit-box-pack:justify;-webkit-justify-content:space-between;-moz-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;margin-bottom:var(--geist-gap-double)}div.__jsx-style-dynamic-selector{width:100%;max-width:-webkit-calc(100% - ${sidebarWidth}px - var(--geist-gap-double));max-width:-moz-calc(100% - ${sidebarWidth}px - var(--geist-gap-double));max-width:calc(100% - ${sidebarWidth}px - var(--geist-gap-double))}@media(max-width:${breakpoint}px){main.__jsx-style-dynamic-selector{-webkit-flex-direction:${top ? "column" : "column-reverse"};-ms-flex-direction:${top ? "column" : "column-reverse"};flex-direction:${top ? "column" : "column-reverse"}}div.__jsx-style-dynamic-selector{max-width:unset}}`)) ;
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/jsx/fixture/autoImport/.after-polyfills-script-not-supported/input.js
JavaScript
// https://github.com/babel/babel/issues/12522 require("react-app-polyfill/ie11"); require("react-app-polyfill/stable"); const ReactDOM = require("react-dom"); ReactDOM.render(<p>Hello, World!</p>, document.getElementById("root"));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/jsx/fixture/autoImport/.after-polyfills-script-not-supported/output.js
JavaScript
var _reactJsxRuntime = require("react/jsx-runtime"); // https://github.com/babel/babel/issues/12522 require('react-app-polyfill/ie11'); require('react-app-polyfill/stable'); const ReactDOM = require('react-dom'); ReactDOM.render( /*#__PURE__*/_reactJsxRuntime.jsx("p", { children: "Hello, World!" }), document.getElementById('root'));
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/jsx/fixture/autoImport/.auto-import-react-source-type-script/input.js
JavaScript
var x = ( <> <div> <div key="1" /> <div key="2" meow="wolf" /> <div key="3" /> <div {...props} key="4" /> </div> </> );
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/jsx/fixture/autoImport/.auto-import-react-source-type-script/output.js
JavaScript
var _react = require("react"); var _reactJsxRuntime = require("react/jsx-runtime"); var x = /*#__PURE__*/_reactJsxRuntime.jsx(_reactJsxRuntime.Fragment, { children: /*#__PURE__*/_reactJsxRuntime.jsxs("div", { children: [/*#__PURE__*/_reactJsxRuntime.jsx("div", {}, "1"), /*#__PURE__*/_reactJsxRuntime.jsx("div", { meow: "wolf" }, "2"), /*#__PURE__*/_reactJsxRuntime.jsx("div", {}, "3"), /*#__PURE__*/_react.createElement("div", { ...props, key: "4" })] }) });
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/jsx/fixture/autoImport/.complicated-scope-script/input.js
JavaScript
const Bar = () => { const Foo = () => { const Component = ({ thing, ..._react }) => { if (!thing) { var _react2 = "something useless"; var b = _react3(); var c = _react5(); var jsx = 1; var _jsx = 2; return <div />; } return <span />; }; }; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University
crates/swc_ecma_transforms_react/tests/jsx/fixture/autoImport/.complicated-scope-script/output.js
JavaScript
var _reactJsxRuntime = require("react/jsx-runtime"); const Bar = () => { const Foo = () => { const Component = ({ thing, ..._react }) => { if (!thing) { var _react2 = "something useless"; var b = _react3(); var c = _react5(); var jsx = 1; var _jsx = 2; return /*#__PURE__*/_reactJsxRuntime.jsx("div", {}); } ; return /*#__PURE__*/_reactJsxRuntime.jsx("span", {}); }; }; };
willcrichton/ilc-swc
1
Rust
willcrichton
Will Crichton
Brown University