Skip to content

Commit

Permalink
Merge branch 'canary' into feat/forbid-middleware-response-body
Browse files Browse the repository at this point in the history
  • Loading branch information
feugy committed May 19, 2022
2 parents 265d02e + 8dd4bc4 commit 0ed490f
Show file tree
Hide file tree
Showing 15 changed files with 152 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: Build, test, and deploy

env:
NAPI_CLI_VERSION: 2.7.0
TURBO_VERSION: 1.2.6
TURBO_VERSION: 1.2.9
RUST_TOOLCHAIN: nightly-2022-02-23

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request_stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
# since the repo's dependencies aren't installed we need
# to install napi globally
- run: npm i -g @napi-rs/cli@2.7.0
- run: npm i -g turbo@1.2.6
- run: npm i -g turbo@1.2.9

- name: Build
if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
"taskr": "1.1.0",
"tree-kill": "1.2.2",
"tsec": "0.2.1",
"turbo": "1.0.28",
"turbo": "1.2.9",
"typescript": "4.6.3",
"wait-port": "0.2.2",
"web-streams-polyfill": "2.1.1",
Expand Down
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
2 changes: 1 addition & 1 deletion test/integration/pnpm-support/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ async function usingPnpmCreateNextApp(appDir, fn) {

await fs.copy(
path.join(__dirname, '../../../../packages/next-swc/native'),
path.join(tempAppDir, 'node_modules/next-swc/native')
path.join(tempAppDir, 'node_modules/@next/swc/native')
)

await fn(tempAppDir)
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
Loading

0 comments on commit 0ed490f

Please sign in to comment.