Skip to content

Commit

Permalink
revert: Recovery does not need to change
Browse files Browse the repository at this point in the history
  • Loading branch information
shulandmimi committed Nov 8, 2023
1 parent c987bc2 commit a6ce5e4
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 35 deletions.
14 changes: 5 additions & 9 deletions crates/plugin_partial_bundling/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
#![feature(is_some_and)]

use std::{collections::VecDeque, path::PathBuf, sync::Arc};
use std::{collections::VecDeque, sync::Arc};

use farmfe_core::{
config::{config_regex::ConfigRegex, Config},
config::Config,
context::CompilationContext,
farm_profile_function, farm_profile_scope,
hashbrown::{HashMap, HashSet},
hashbrown::HashSet,
module::{
module_graph::ModuleGraph,
module_group::{ModuleGroup, ModuleGroupGraph},
ModuleId, ModuleType,
ModuleId,
},
plugin::{Plugin, PluginHookContext},
resource::resource_pot::{ResourcePot, ResourcePotType},
resource::resource_pot::ResourcePot,
};
use generate_module_buckets::{generate_module_buckets_map, group_module_buckets_by_module_group};
use generate_resource_pots::generate_resource_pots;
use module_bucket::ModuleBucket;

// mod module_bucket;
mod generate_module_buckets;
Expand Down
3 changes: 0 additions & 3 deletions crates/plugin_partial_bundling/src/module_bucket.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
use std::mem::replace;

use farmfe_core::{
hashbrown::HashSet,
module::{Module, ModuleId, ModuleType},
resource::resource_pot::ResourcePotId,
};

/// A ModuleBucket is a collection of modules whose module_groups field is equal.
Expand Down
31 changes: 17 additions & 14 deletions examples/partial-bundling/farm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,31 @@ export default {
path: 'dist',
targetEnv: 'node',
format: 'cjs'
// entryFilename: '[entryName].mjs'
},
external: [
...builtinModules.map((m) => `^node:${m}$`),
...builtinModules.map((m) => `^${m}$`)
],
minify: false,
presetEnv: false,
sourcemap: false,
lazyCompilation: false,
partialBundling: {
moduleBuckets: [
{
name: 'common',
test: [],
minSize: 1024,
maxConcurrentRequests: 5
}
]
}
sourcemap: false
},
server: {
hmr: false
}
},
plugins: [
// If you comment, you will use the default partial bundling
[
'@farmfe/plugin-webpack-partial-bundling'
// {
// moduleBucket: [
// {
// name: 'common',
// test: [],
// // minSize: 1024
// }
// ]
// }
]
]
};
4 changes: 3 additions & 1 deletion examples/partial-bundling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
"build": "farm build",
"postinstall": "node bootstrap.js"
},
"devDependencies": {}
"devDependencies": {
"@farmfe/plugin-webpack-partial-bundling": "workspace:*"
}
}
4 changes: 2 additions & 2 deletions js-plugins/vue/farm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default {
},
output: {
path: 'build',
entryFilename: '[entryName].[ext]',
filename: '[resourceName].[ext]',
entryFilename: '[entryName].cjs',
filename: '[resourceName].cjs',
targetEnv: 'node',
format: 'cjs'
},
Expand Down
8 changes: 2 additions & 6 deletions packages/core/binding/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,16 +210,12 @@ export interface Config {
groups?: {
name: string;
test: string[];
groupType?: 'mutable' | 'immutable',
resourceType?: 'all' | 'initial' | 'async'
groupType?: 'mutable' | 'immutable';
resourceType?: 'all' | 'initial' | 'async';
}[];
enforceResources?: {
name: string;
test: string[];
reuseExistingResourcePot?: boolean,
maxConcurrentRequests?: number;
minSize?: number;
weight?: number;
}[];
enforceTargetConcurrentRequests?: boolean;
enforceTargetMinSize?: boolean;
Expand Down
4 changes: 4 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a6ce5e4

Please sign in to comment.