Skip to content

Commit

Permalink
revert test changes and small perf
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Apr 5, 2022
1 parent a1eec4c commit a972952
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
Expand Up @@ -68,7 +68,6 @@ export default async function middlewareSSRLoader(this: any) {
reactLoadableManifest,
serverComponentManifest: ${isServerComponent} ? rscManifest : null,
appServerMod,
isServerComponent: ${isServerComponent},
config: ${stringifiedConfig},
buildId: ${JSON.stringify(buildId)},
})
Expand Down
Expand Up @@ -40,7 +40,6 @@ export function getRender({
reactLoadableManifest: ReactLoadableManifest
serverComponentManifest: any
appServerMod: any
isServerComponent: boolean
config: NextConfig
buildId: string
}) {
Expand Down
Expand Up @@ -64,20 +64,17 @@ export class FlightManifestPlugin {

createAsset(assets: any, compilation: any) {
const manifest: any = {}
const { pageExtensions } = this
const isClientComponent = createClientComponentFilter(this.pageExtensions)
compilation.chunkGroups.forEach((chunkGroup: any) => {
function recordModule(id: string, _chunk: any, mod: any) {
const resource = mod.resource?.replace(/\?__sc_client__$/, '')

// TODO: Hook into deps instead of the target module.
// That way we know by the type of dep whether to include.
// It also resolves conflicts when the same module is in multiple chunks.

const isClientComponent = createClientComponentFilter(pageExtensions)
if (!isClientComponent(resource)) {
return
}

const moduleExports: any = manifest[resource] || {}

const exportsInfo = compilation.moduleGraph.getExportsInfo(mod)
Expand Down
Expand Up @@ -18,7 +18,7 @@ export function getStaticProps() {
props: {
type: 'ISR',
},
revalidate: 1,
revalidate: 3,
}
}

Expand Down
Expand Up @@ -124,8 +124,8 @@ describe('Switchable runtime (prod)', () => {

expect(renderedAt1).toBe(renderedAt2)

// Trigger a revalidation after 2s.
await waitFor(3000)
// Trigger a revalidation after 3s.
await waitFor(4000)
await renderViaHTTP(context.appPort, '/node-rsc-isr')

await check(async () => {
Expand Down

0 comments on commit a972952

Please sign in to comment.