Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: annotate ISC errors and split into to separate errors (#1146)
* fix: annotate ISC errors and split into to separate errors * chore: refactor all other places * chore: remove unused function and fix types Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b0048a4
commit ca005ba
Showing
23 changed files
with
185 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import type { Message } from '@netlify/esbuild' | ||
|
||
import type { FunctionConfig } from '../../../config.js' | ||
import type { FeatureFlag, FeatureFlags } from '../../../feature_flags.js' | ||
import type { FunctionSource } from '../../../function.js' | ||
import type { ModuleFormat } from '../utils/module_format.js' | ||
|
||
export type NodeBundlerName = 'esbuild' | 'esbuild_zisi' | 'nft' | 'zisi' | ||
|
||
// TODO: Create a generic warning type | ||
type BundlerWarning = Message | ||
|
||
type CleanupFunction = () => Promise<void> | ||
|
||
export type NativeNodeModules = Record<string, Record<string, string | undefined>> | ||
|
||
export type BundleFunction = ( | ||
args: { | ||
basePath?: string | ||
config: FunctionConfig | ||
featureFlags: Record<FeatureFlag, boolean> | ||
pluginsModulesPath?: string | ||
repositoryRoot?: string | ||
} & FunctionSource, | ||
) => Promise<{ | ||
// Aliases are used to change the path that a file should take inside the | ||
// generated archive. For example: | ||
// | ||
// "/my-transpiled-function.js" => "/my-function.js" | ||
// | ||
// When "/my-transpiled-function.js" is found in the list of files, it will | ||
// be added to the archive with the "/my-function.js" path. | ||
aliases?: Map<string, string> | ||
|
||
// Rewrites are used to change the source file associated with a given path. | ||
// For example: | ||
// | ||
// "/my-function.js" => "console.log(`Hello!`)" | ||
// | ||
// When "/my-function.js" is found in the list of files, it will be added to | ||
// the archive with "console.log(`Hello!`)" as its source, replacing whatever | ||
// the file at "/my-function.js" contains. | ||
rewrites?: Map<string, string> | ||
|
||
basePath: string | ||
bundlerWarnings?: BundlerWarning[] | ||
cleanupFunction?: CleanupFunction | ||
includedFiles: string[] | ||
inputs: string[] | ||
mainFile: string | ||
moduleFormat: ModuleFormat | ||
nativeNodeModules?: NativeNodeModules | ||
nodeModulesWithDynamicImports?: string[] | ||
srcFiles: string[] | ||
}> | ||
|
||
export type GetSrcFilesFunction = ( | ||
args: { | ||
basePath?: string | ||
config: FunctionConfig | ||
featureFlags: FeatureFlags | ||
pluginsModulesPath?: string | ||
repositoryRoot?: string | ||
} & FunctionSource, | ||
) => Promise<{ srcFiles: string[]; includedFiles: string[] }> | ||
|
||
export interface NodeBundler { | ||
bundle: BundleFunction | ||
getSrcFiles: GetSrcFilesFunction | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
ca005ba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⏱ Benchmark results
largeDepsEsbuild: 6s
largeDepsNft: 29.8s
largeDepsZisi: 44.2s