mirror of
https://github.com/denoland/deno.git
synced 2025-09-28 13:14:48 +00:00
chore: reduce some allocations collecting unstable features (#29827)
Some checks are pending
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Some checks are pending
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Minor thing.
This commit is contained in:
parent
c538f44fa0
commit
2205ca5e4a
3 changed files with 12 additions and 8 deletions
|
@ -1030,19 +1030,20 @@ impl CliOptions {
|
||||||
|| self.workspace().has_unstable("sloppy-imports")
|
|| self.workspace().has_unstable("sloppy-imports")
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn unstable_features(&self) -> Vec<String> {
|
pub fn unstable_features(&self) -> Vec<&str> {
|
||||||
let from_config_file = self.workspace().unstable_features();
|
let from_config_file = self.workspace().unstable_features();
|
||||||
let unstable_features = from_config_file
|
let unstable_features = from_config_file
|
||||||
.iter()
|
.iter()
|
||||||
|
.map(|s| s.as_str())
|
||||||
.chain(
|
.chain(
|
||||||
self
|
self
|
||||||
.flags
|
.flags
|
||||||
.unstable_config
|
.unstable_config
|
||||||
.features
|
.features
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|f| !from_config_file.contains(f)),
|
.filter(|f| !from_config_file.contains(f))
|
||||||
|
.map(|s| s.as_str()),
|
||||||
)
|
)
|
||||||
.map(|f| f.to_owned())
|
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
if !unstable_features.is_empty() {
|
if !unstable_features.is_empty() {
|
||||||
|
@ -1055,9 +1056,7 @@ impl CliOptions {
|
||||||
// check and warn if the unstable flag of config file isn't supported, by
|
// check and warn if the unstable flag of config file isn't supported, by
|
||||||
// iterating through the vector holding the unstable flags
|
// iterating through the vector holding the unstable flags
|
||||||
for unstable_value_from_config_file in &unstable_features {
|
for unstable_value_from_config_file in &unstable_features {
|
||||||
if !all_valid_unstable_flags
|
if !all_valid_unstable_flags.contains(unstable_value_from_config_file) {
|
||||||
.contains(&unstable_value_from_config_file.as_str())
|
|
||||||
{
|
|
||||||
log::warn!(
|
log::warn!(
|
||||||
"{} '{}' isn't a valid unstable feature",
|
"{} '{}' isn't a valid unstable feature",
|
||||||
colors::yellow("Warning"),
|
colors::yellow("Warning"),
|
||||||
|
|
|
@ -944,7 +944,7 @@ impl CliFactory {
|
||||||
checker.set_exit_cb(Box::new(crate::unstable_exit_cb));
|
checker.set_exit_cb(Box::new(crate::unstable_exit_cb));
|
||||||
let unstable_features = cli_options.unstable_features();
|
let unstable_features = cli_options.unstable_features();
|
||||||
for feature in deno_runtime::UNSTABLE_FEATURES {
|
for feature in deno_runtime::UNSTABLE_FEATURES {
|
||||||
if unstable_features.contains(&feature.name.to_string()) {
|
if unstable_features.contains(&feature.name) {
|
||||||
checker.enable_feature(feature.name);
|
checker.enable_feature(feature.name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -712,7 +712,12 @@ impl<'a> DenoCompileBinaryWriter<'a> {
|
||||||
subdomain_wildcards: self.cli_options.unstable_subdomain_wildcards(),
|
subdomain_wildcards: self.cli_options.unstable_subdomain_wildcards(),
|
||||||
bare_node_builtins: self.cli_options.unstable_bare_node_builtins(),
|
bare_node_builtins: self.cli_options.unstable_bare_node_builtins(),
|
||||||
detect_cjs: self.cli_options.unstable_detect_cjs(),
|
detect_cjs: self.cli_options.unstable_detect_cjs(),
|
||||||
features: self.cli_options.unstable_features(),
|
features: self
|
||||||
|
.cli_options
|
||||||
|
.unstable_features()
|
||||||
|
.into_iter()
|
||||||
|
.map(|s| s.to_string())
|
||||||
|
.collect(),
|
||||||
lazy_dynamic_imports: self.cli_options.unstable_lazy_dynamic_imports(),
|
lazy_dynamic_imports: self.cli_options.unstable_lazy_dynamic_imports(),
|
||||||
npm_lazy_caching: self.cli_options.unstable_npm_lazy_caching(),
|
npm_lazy_caching: self.cli_options.unstable_npm_lazy_caching(),
|
||||||
sloppy_imports: self.cli_options.unstable_sloppy_imports(),
|
sloppy_imports: self.cli_options.unstable_sloppy_imports(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue