Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Aug 22, 2024
1 parent 27b1015 commit 1010c62
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,13 @@ function deduplicateCSSImportsForEntry(mergedCSSimports: CssImports) {
return dedupedCSSImports
}

// Collection of action module path and action names per runtime.
type UsedActionMap = {
node: Record<string, Set<string>>
edge: Record<string, Set<string>>
}
type UsedActionPerEntry = {
[entryPath: string]: UsedActionMap
[entryName: string]: UsedActionMap
}

export class FlightClientEntryPlugin {
Expand All @@ -179,6 +180,8 @@ export class FlightClientEntryPlugin {
isEdgeServer: boolean
assetPrefix: string
webpackRuntime: string

// Collect the used actions based on the entry name and runtime.
usedActions: UsedActionPerEntry

constructor(options: Options) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { useState } from 'react'
import { sharedClientLayerAction } from './actions'
import { sharedClientLayerAction } from './reexport-action'

export default function Page() {
const [text, setText] = useState('initial')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('actions-tree-shaking - reexport', () => {
rsc: 3,
},
'app/named-reexport/client/page': {
'action-browser': 1,
'action-browser': 3,
},
})
})
Expand Down

0 comments on commit 1010c62

Please sign in to comment.