Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
fix: cleanup resolved feature flags (#1307)
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Jan 10, 2023
1 parent 40e5a58 commit d4327a3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 18 deletions.
9 changes: 0 additions & 9 deletions src/feature_flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,6 @@ export const defaultFlags: Record<string, boolean> = {

// Load configuration from per-function JSON files.
project_deploy_configuration_api_use_per_function_configuration_files: false,

// Enable runtime cache for NFT
zisi_nft_use_cache: false,

// Raise file IO limit for NFT
zisi_nft_higher_fileio_limit: false,

// Provide banner to esbuild which allows requires in ESM output
zisi_esbuild_require_banner: false,
}

export type FeatureFlag = keyof typeof defaultFlags
Expand Down
3 changes: 1 addition & 2 deletions src/runtimes/node/bundlers/esbuild/bundler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ export const bundleJsFile = async function ({

try {
const { metafile = { inputs: {}, outputs: {} }, warnings } = await build({
banner:
moduleFormat === ModuleFormat.ESM && featureFlags.zisi_esbuild_require_banner ? { js: esmJSBanner } : undefined,
banner: moduleFormat === ModuleFormat.ESM ? { js: esmJSBanner } : undefined,
bundle: true,
entryPoints: [srcFile],
external,
Expand Down
4 changes: 2 additions & 2 deletions src/runtimes/node/bundlers/nft/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ const traceFilesAndTranspile = async function ({
reasons,
} = await nodeFileTrace([mainFile], {
// Default is 1024. Allowing double the fileIO in parallel makes nft faster, but uses a little more memory.
fileIOConcurrency: featureFlags.zisi_nft_higher_fileio_limit ? 2048 : 1024,
fileIOConcurrency: 2048,
base: basePath,
cache: featureFlags.zisi_nft_use_cache ? cache.nftCache : undefined,
cache: cache.nftCache,
ignore: ignoreFunction,
readFile: async (path: string) => {
try {
Expand Down
5 changes: 0 additions & 5 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2253,7 +2253,6 @@ describe('zip-it-and-ship-it', () => {
const opts = merge(options, {
basePath: fixtureDir,
configFileDirectories: [fixtureDir],
featureFlags: { zisi_detect_esm: true },
})
const { files, tmpDir } = await zipFixture(fixtureName, {
length: 2,
Expand Down Expand Up @@ -2283,7 +2282,6 @@ describe('zip-it-and-ship-it', () => {
const opts = merge(options, {
basePath: fixtureDir,
configFileDirectories: [fixtureDir],
featureFlags: { zisi_detect_esm: true },
})
const { files, tmpDir } = await zipFixture(fixtureName, {
length: 2,
Expand Down Expand Up @@ -2431,9 +2429,6 @@ describe('zip-it-and-ship-it', () => {
nodeModuleFormat: ModuleFormat.ESM,
},
},
featureFlags: {
zisi_esbuild_require_banner: true,
},
}
const { files, tmpDir } = await zipFixture([join(fixtureName, 'functions')], {
opts,
Expand Down

1 comment on commit d4327a3

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⏱ Benchmark results

  • largeDepsEsbuild: 2.1s
  • largeDepsNft: 8s
  • largeDepsZisi: 15.8s

Please sign in to comment.