Skip to content

Commit

Permalink
remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Jul 20, 2022
1 parent 19f24a9 commit 129495b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 24 deletions.
15 changes: 0 additions & 15 deletions packages/next/client/components/app-router.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@ import {
// LayoutSegmentsContext,
} from './hooks-client-context'

async function loadCss(cssChunkInfoJson: string) {
const data = JSON.parse(cssChunkInfoJson)
await Promise.all(
data.chunks.map((chunkId: string) => {
// load css related chunks
return (self as any).__next_chunk_load__(chunkId)
})
)
// In development mode, import css in dev when it's wrapped by style loader.
// In production mode, css are standalone chunk that doesn't need to be imported.
if (data.id) {
;(self as any).__next_require__(data.id)
}
}

function fetchFlight(url: URL, flightRouterStateData: string): ReadableStream {
const flightUrl = new URL(url)
const searchParams = flightUrl.searchParams
Expand Down
8 changes: 2 additions & 6 deletions packages/next/server/app-render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
renderToInitialStream,
createBufferedTransformStream,
continueFromInitialStream,
createPrefixStream,
} from './node-web-streams-helper'
import { isDynamicRoute } from '../shared/lib/router/utils'
import { tryGetPreviewData } from './api-utils/node'
Expand Down Expand Up @@ -173,8 +172,7 @@ function createServerComponentRenderer(
transformStream: TransformStream<Uint8Array, Uint8Array>
serverComponentManifest: NonNullable<RenderOpts['serverComponentManifest']>
serverContexts: Array<[ServerContextName: string, JSONValue: any]>
},
dev: boolean
}
) {
// We need to expose the `__webpack_require__` API globally for
// react-server-dom-webpack. This is a hack until we find a better way.
Expand Down Expand Up @@ -864,8 +862,7 @@ export async function renderToHTML(
transformStream: serverComponentsInlinedTransformStream,
serverComponentManifest,
serverContexts,
},
dev
}
)

const jsxStyleRegistry = createStyleRegistry()
Expand Down Expand Up @@ -915,7 +912,6 @@ export async function renderToHTML(
}

return await continueFromInitialStream(renderStream, {
dev,
dataStream: serverComponentsInlinedTransformStream?.readable,
generateStaticHTML: generateStaticHTML || !hasConcurrentFeatures,
flushEffectHandler,
Expand Down
2 changes: 0 additions & 2 deletions packages/next/server/node-web-streams-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,12 @@ export function renderToInitialStream({
export async function continueFromInitialStream(
renderStream: ReactReadableStream,
{
dev,
suffix,
dataStream,
generateStaticHTML,
flushEffectHandler,
initialStylesheets,
}: {
dev?: boolean
suffix?: string
dataStream?: ReadableStream<Uint8Array>
generateStaticHTML: boolean
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/app-dir/app/app/dashboard/global.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.dangerous-text {
color: #ff6fee;
color: red;
}

0 comments on commit 129495b

Please sign in to comment.