Skip to content

Commit

Permalink
Merge branch 'canary' into update/turbo
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed May 19, 2022
2 parents ae808da + 9732463 commit 63f5828
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 27 deletions.
33 changes: 17 additions & 16 deletions packages/next-swc/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/next-swc/crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ swc_emotion = {path="../emotion"}
styled_components = {path="../styled_components"}
styled_jsx = {path="../styled_jsx"}
modularize_imports = {path="../modularize_imports"}
swc = "0.180.0"
swc = "0.181.0"
swc_atoms = "0.2.11"
swc_common = { version = "0.18.2", features = ["concurrent", "sourcemap"] }
swc_common = { version = "0.18.5", features = ["concurrent", "sourcemap"] }
swc_ecma_loader = { version = "0.30.1", features = ["node", "lru"] }
swc_ecmascript = { version = "0.157.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_cached = "0.1.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/emotion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ regex = "1.5"
serde = "1"
sourcemap = "6.0.1"
swc_atoms = "0.2.11"
swc_common = { version = "0.18.2", features = ["concurrent", "sourcemap"] }
swc_common = { version = "0.18.5", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.157.0", features = ["codegen", "utils", "visit"] }
swc_trace_macro = "0.1.1"
tracing = { version = "0.1.32", features = ["release_max_level_info"] }
Expand Down
4 changes: 2 additions & 2 deletions packages/next-swc/crates/napi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ next-swc = {version = "0.0.0", path = "../core"}
once_cell = "1.8.0"
serde = "1"
serde_json = "1"
swc = "0.180.0"
swc = "0.181.0"
swc_atoms = "0.2.11"
swc_bundler = { version = "0.147.0", features = ["concurrent"] }
swc_common = { version = "0.18.2", features = ["concurrent", "sourcemap"] }
swc_common = { version = "0.18.5", features = ["concurrent", "sourcemap"] }
swc_ecma_loader = { version = "0.30.1", features = ["node", "lru"] }
swc_ecmascript = { version = "0.157.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
swc_node_base = "0.5.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/styled_components/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ once_cell = "1.10.0"
regex = {version = "1.5.4", features = ["std", "perf"], default-features = false}
serde = {version = "1.0.130", features = ["derive"]}
swc_atoms = "0.2.11"
swc_common = { version = "0.18.2", features = ["concurrent"] }
swc_common = { version = "0.18.5", features = ["concurrent"] }
swc_ecmascript = { version = "0.157.0", features = ["utils", "visit"] }
tracing = "0.1.32"

Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/styled_jsx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version = "0.4.0"

[dependencies]
easy-error = "1.0.0"
swc_common = { version = "0.18.2", features = ["concurrent", "sourcemap"] }
swc_common = { version = "0.18.5", features = ["concurrent", "sourcemap"] }
swc_css = "0.105.0"
swc_css_prefixer = "0.101.0"
swc_ecmascript = { version = "0.157.0", features = ["parser", "minifier", "utils", "visit"] }
Expand Down
4 changes: 2 additions & 2 deletions packages/next-swc/crates/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ parking_lot_core = "=0.8.0"
path-clean = "0.1"
serde = {version = "1", features = ["derive"]}
serde_json = "1"
swc = "0.180.0"
swc_common = { version = "0.18.2", features = ["concurrent", "sourcemap"] }
swc = "0.181.0"
swc_common = { version = "0.18.5", features = ["concurrent", "sourcemap"] }
swc_ecmascript = { version = "0.157.0", features = ["codegen", "minifier", "optimization", "parser", "react", "transforms", "typescript", "utils", "visit"] }
tracing = { version = "0.1.32", features = ["release_max_level_off"] }
wasm-bindgen = {version = "0.2", features = ["serde-serialize"]}
Expand Down
9 changes: 7 additions & 2 deletions packages/next/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,13 @@ export class Head extends Component<
!script.src && (script.dangerouslySetInnerHTML || script.children)
)
.map((file: ScriptProps, index: number) => {
const { strategy, children, dangerouslySetInnerHTML, ...scriptProps } =
file
const {
strategy,
children,
dangerouslySetInnerHTML,
src,
...scriptProps
} = file
let html = ''

if (dangerouslySetInnerHTML && dangerouslySetInnerHTML.__html) {
Expand Down
15 changes: 15 additions & 0 deletions test/integration/script-loader/base/pages/page7.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Script from 'next/script'

const Page = () => {
return (
<div class="container">
<Script
id="beforeInteractiveInlineScript"
strategy="beforeInteractive"
>{`console.log('beforeInteractive inline script run')`}</Script>
<div>page7</div>
</div>
)
}

export default Page
18 changes: 18 additions & 0 deletions test/integration/script-loader/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,24 @@ describe('Next.js Script - Primary Strategies', () => {
).toBeGreaterThan(0)
})

it('priority beforeInteractive with inline script should execute', async () => {
let browser
try {
browser = await webdriver(appPort, '/page7')

await waitFor(1000)

const logs = await browser.log()
expect(
logs.some((log) =>
log.message.includes('beforeInteractive inline script run')
)
).toBe(true)
} finally {
if (browser) await browser.close()
}
})

it('Does not duplicate inline scripts', async () => {
let browser
try {
Expand Down

0 comments on commit 63f5828

Please sign in to comment.