-
Notifications
You must be signed in to change notification settings - Fork 27.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inject swc helpers (vercel/turborepo#4060)
### Description This fixed the `_extends` is not defined issue.
- Loading branch information
Showing
4 changed files
with
32 additions
and
2 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
crates/next-dev-tests/tests/integration/next/basic/swc-helpers/input/pages/index.js
This file contains 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,25 @@ | ||
import { useEffect } from "react"; | ||
|
||
export default function Page() { | ||
useEffect(() => { | ||
// Only run on client | ||
import("@turbo/pack-test-harness").then(runTests); | ||
}); | ||
|
||
const props1 = { className: "foo" }; | ||
const props2 = { style: { color: "red" } }; | ||
// this will require the `_extends` helper on SSR | ||
return ( | ||
<div id="test" {...props1} {...props2}> | ||
Hello World | ||
</div> | ||
); | ||
} | ||
|
||
function runTests() { | ||
it("should render the #test element in red and with class foo", () => { | ||
const el = document.getElementById("test"); | ||
expect(el.style.color).toBe("red"); | ||
expect(el.className).toBe("foo"); | ||
}); | ||
} |
This file contains 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
1 change: 1 addition & 0 deletions
1
...tput/79fb1_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_097653.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
.../79fb1_turbopack-tests_tests_snapshot_swc_transforms_preset_env_input_index_097653.js.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.