Skip to content

Commit

Permalink
chore(optimizer): remove is_dev again
Browse files Browse the repository at this point in the history
This mostly reverts commit 97676d1.
  • Loading branch information
wmertens committed Sep 18, 2024
1 parent b6ac7d3 commit 09ccf81
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 63 deletions.
2 changes: 1 addition & 1 deletion packages/docs/src/routes/api/qwik-optimizer/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@
}
],
"kind": "Interface",
"content": "```typescript\nexport interface TransformOptions \n```\n\n\n<table><thead><tr><th>\n\nProperty\n\n\n</th><th>\n\nModifiers\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[entryStrategy?](#)\n\n\n</td><td>\n\n\n</td><td>\n\n[EntryStrategy](#entrystrategy)\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[explicitExtensions?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[isDev?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[isServer?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[minify?](#)\n\n\n</td><td>\n\n\n</td><td>\n\n[MinifyMode](#minifymode)\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[mode?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nEmitMode\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[preserveFilenames?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[regCtxName?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\\[\\]\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[rootDir?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[scope?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[sourceMaps?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[srcDir](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\n\n\n</td><td>\n\n\n</td></tr>\n<tr><td>\n\n[stripCtxName?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\\[\\]\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[stripEventHandlers?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[stripExports?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\\[\\]\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[transpileJsx?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[transpileTs?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n</tbody></table>",
"content": "```typescript\nexport interface TransformOptions \n```\n\n\n<table><thead><tr><th>\n\nProperty\n\n\n</th><th>\n\nModifiers\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[entryStrategy?](#)\n\n\n</td><td>\n\n\n</td><td>\n\n[EntryStrategy](#entrystrategy)\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[explicitExtensions?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[isServer?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[minify?](#)\n\n\n</td><td>\n\n\n</td><td>\n\n[MinifyMode](#minifymode)\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[mode?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nEmitMode\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[preserveFilenames?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[regCtxName?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\\[\\]\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[rootDir?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[scope?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[sourceMaps?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[srcDir](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\n\n\n</td><td>\n\n\n</td></tr>\n<tr><td>\n\n[stripCtxName?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\\[\\]\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[stripEventHandlers?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[stripExports?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\\[\\]\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[transpileJsx?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[transpileTs?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n</tbody></table>",
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/optimizer/src/types.ts",
"mdFile": "qwik.transformoptions.md"
},
Expand Down
15 changes: 0 additions & 15 deletions packages/docs/src/routes/api/qwik-optimizer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3233,21 +3233,6 @@ _(Optional)_
</td></tr>
<tr><td>

[isDev?](#)

</td><td>

</td><td>

boolean

</td><td>

_(Optional)_

</td></tr>
<tr><td>

[isServer?](#)

</td><td>
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/src/routes/api/qwik/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -1718,7 +1718,7 @@
}
],
"kind": "Function",
"content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\nLoad the prefetch graph for the container.\n\nEach Qwik container needs to include its own prefetch graph.\n\n\n```typescript\nPrefetchGraph: (opts?: {\n base?: string;\n manifestHash?: string;\n manifestURL?: string;\n nonce?: string;\n}) => JSXNode<string>\n```\n\n\n<table><thead><tr><th>\n\nParameter\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n\n</td><td>\n\n{ base?: string; manifestHash?: string; manifestURL?: string; nonce?: string; }\n\n\n</td><td>\n\n_(Optional)_ Options for the loading prefetch graph.\n\n- `base` - Base of the graph. For a default installation this will default to the q:base value `/build/`<!-- -->. But if more than one MFE is installed on the page, then each MFE needs to have its own base. - `manifestHash` - Hash of the manifest file to load. If not provided the hash will be extracted from the container attribute `q:manifest-hash` and assume the default build file `${base}/q-bundle-graph-${manifestHash}.json`<!-- -->. - `manifestURL` - URL of the manifest file to load if non-standard bundle graph location name.\n\n\n</td></tr>\n</tbody></table>\n**Returns:**\n\nJSXNode&lt;string&gt;",
"content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\nLoad the prefetch graph for the container.\n\nEach Qwik container needs to include its own prefetch graph.\n\n\n```typescript\nPrefetchGraph: (opts?: {\n base?: string;\n manifestHash?: string;\n manifestURL?: string;\n nonce?: string;\n}) => JSXNode<string>\n```\n\n\n<table><thead><tr><th>\n\nParameter\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n\n</td><td>\n\n{ base?: string; manifestHash?: string; manifestURL?: string; nonce?: string; }\n\n\n</td><td>\n\n_(Optional)_ Options for the loading prefetch graph.\n\n- `base` - Base of the graph. For a default installation this will default to the q:base value `/build/`<!-- -->. But if more than one MFE is installed on the page, then each MFE needs to have its own base. - `manifestHash` - Hash of the manifest file to load. If not provided the hash will be extracted from the container attribute `q:manifest-hash` and assume the default build file `${base}/q-bundle-graph-${manifestHash}.json`<!-- -->. - `manifestURL` - URL of the manifest file to load if non-standard bundle graph location name.\n\n\n</td></tr>\n</tbody></table>\n**Returns:**\n\n[JSXNode](#jsxnode)<!-- -->&lt;string&gt;",
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts",
"mdFile": "qwik.prefetchgraph.md"
},
Expand All @@ -1732,7 +1732,7 @@
}
],
"kind": "Function",
"content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\nInstall a service worker which will prefetch the bundles.\n\nThere can only be one service worker per page. Because there can be many separate Qwik Containers on the page each container needs to load its prefetch graph using `PrefetchGraph` component.\n\n\n```typescript\nPrefetchServiceWorker: (opts: {\n base?: string;\n scope?: string;\n path?: string;\n verbose?: boolean;\n fetchBundleGraph?: boolean;\n nonce?: string;\n}) => JSXNode<'script'>\n```\n\n\n<table><thead><tr><th>\n\nParameter\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n\n</td><td>\n\n{ base?: string; scope?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; nonce?: string; }\n\n\n</td><td>\n\nOptions for the prefetch service worker.\n\n- `base` - Base URL for the service worker. Default is `import.meta.env.BASE_URL`<!-- -->, which is defined by Vite's `config.base` and defaults to `/`<!-- -->. - `scope` - Base URL for when the service-worker will activate. Default is `/` - `path` - Path to the service worker. Default is `qwik-prefetch-service-worker.js` unless you pass a path that starts with a `/` then the base is ignored. Default is `qwik-prefetch-service-worker.js` - `verbose` - Verbose logging for the service worker installation. Default is `false` - `nonce` - Optional nonce value for security purposes, defaults to `undefined`<!-- -->.\n\n\n</td></tr>\n</tbody></table>\n**Returns:**\n\nJSXNode&lt;'script'&gt;",
"content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\nInstall a service worker which will prefetch the bundles.\n\nThere can only be one service worker per page. Because there can be many separate Qwik Containers on the page each container needs to load its prefetch graph using `PrefetchGraph` component.\n\n\n```typescript\nPrefetchServiceWorker: (opts: {\n base?: string;\n scope?: string;\n path?: string;\n verbose?: boolean;\n fetchBundleGraph?: boolean;\n nonce?: string;\n}) => JSXNode<'script'>\n```\n\n\n<table><thead><tr><th>\n\nParameter\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\nopts\n\n\n</td><td>\n\n{ base?: string; scope?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; nonce?: string; }\n\n\n</td><td>\n\nOptions for the prefetch service worker.\n\n- `base` - Base URL for the service worker. Default is `import.meta.env.BASE_URL`<!-- -->, which is defined by Vite's `config.base` and defaults to `/`<!-- -->. - `scope` - Base URL for when the service-worker will activate. Default is `/` - `path` - Path to the service worker. Default is `qwik-prefetch-service-worker.js` unless you pass a path that starts with a `/` then the base is ignored. Default is `qwik-prefetch-service-worker.js` - `verbose` - Verbose logging for the service worker installation. Default is `false` - `nonce` - Optional nonce value for security purposes, defaults to `undefined`<!-- -->.\n\n\n</td></tr>\n</tbody></table>\n**Returns:**\n\n[JSXNode](#jsxnode)<!-- -->&lt;'script'&gt;",
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts",
"mdFile": "qwik.prefetchserviceworker.md"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/src/routes/api/qwik/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3515,7 +3515,7 @@ _(Optional)_ Options for the loading prefetch graph.
</tbody></table>
**Returns:**
JSXNode&lt;string&gt;
[JSXNode](#jsxnode)&lt;string&gt;
[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts)
Expand Down Expand Up @@ -3569,7 +3569,7 @@ Options for the prefetch service worker.
</tbody></table>
**Returns:**
JSXNode&lt;'script'&gt;
[JSXNode](#jsxnode)&lt;'script'&gt;
[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts)
Expand Down
1 change: 0 additions & 1 deletion packages/qwik/src/optimizer/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ fn optimize(
strip_event_handlers: false,
reg_ctx_name: None,
is_server: None,
is_dev: None,
})?;

result.write_to_fs(
Expand Down
4 changes: 0 additions & 4 deletions packages/qwik/src/optimizer/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ pub struct TransformFsOptions {
pub strip_event_handlers: bool,
pub reg_ctx_name: Option<Vec<JsWord>>,
pub is_server: Option<bool>,
pub is_dev: Option<bool>,
}

#[derive(Serialize, Debug, Deserialize)]
Expand Down Expand Up @@ -109,7 +108,6 @@ pub struct TransformModulesOptions {
pub strip_event_handlers: bool,
pub reg_ctx_name: Option<Vec<JsWord>>,
pub is_server: Option<bool>,
pub is_dev: Option<bool>,
}

#[cfg(feature = "fs")]
Expand Down Expand Up @@ -158,7 +156,6 @@ pub fn transform_fs(config: TransformFsOptions) -> Result<TransformOutput, Error
// If you don't specify is_server, the safe value is true
// For libraries, is_server has to be true because we neet to emit extra code
is_server: config.mode == EmitMode::Lib || config.is_server.unwrap_or(true),
is_dev: config.is_dev,
})
})
.reduce(|| Ok(TransformOutput::new()), |x, y| Ok(x?.append(&mut y?)))?;
Expand Down Expand Up @@ -205,7 +202,6 @@ pub fn transform_modules(config: TransformModulesOptions) -> Result<TransformOut
// If you don't specify is_server, the safe value is true
// For libraries, is_server has to be true because we neet to emit extra code
is_server: config.mode == EmitMode::Lib || config.is_server.unwrap_or(true),
is_dev: config.is_dev,
})
});

Expand Down
10 changes: 3 additions & 7 deletions packages/qwik/src/optimizer/core/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ pub struct TransformCodeOptions<'a> {
pub strip_ctx_name: Option<&'a [JsWord]>,
pub strip_event_handlers: bool,
pub is_server: bool,
pub is_dev: Option<bool>,
}

#[derive(Debug, Serialize, Deserialize, Default)]
Expand Down Expand Up @@ -212,8 +211,6 @@ impl Emitter for ErrorBuffer {
}

pub fn transform_code(config: TransformCodeOptions) -> Result<TransformOutput, anyhow::Error> {
let is_dev = config.is_dev.unwrap_or(config.mode == EmitMode::Dev);
let is_lib = config.mode == EmitMode::Lib;
let source_map = Lrc::new(SourceMap::default());
let path_data = parse_path(
config.relative_path.replace('\\', "/").as_str(),
Expand Down Expand Up @@ -300,7 +297,8 @@ pub fn transform_code(config: TransformCodeOptions) -> Result<TransformOutput, a
transform_props_destructuring(&mut program, &mut collect, &config.core_module);

// Replace const values
if !is_lib {
if config.mode != EmitMode::Lib {
let is_dev = config.mode == EmitMode::Dev;
let mut const_replacer =
ConstReplacerVisitor::new(config.is_server, is_dev, &collect);
program.visit_mut_with(&mut const_replacer);
Expand All @@ -313,16 +311,14 @@ pub fn transform_code(config: TransformCodeOptions) -> Result<TransformOutput, a
comments: Some(&comments),
global_collect: collect,
scope: config.scope,
mode: config.mode,
core_module: config.core_module,
entry_strategy: config.entry_strategy,
reg_ctx_name: config.reg_ctx_name,
strip_ctx_name: config.strip_ctx_name,
strip_event_handlers: config.strip_event_handlers,
is_server: config.is_server,
cm: Lrc::clone(&source_map),
// The transform should always respect the emit mode
is_dev: config.mode == EmitMode::Dev,
is_lib,
});

// print before transform, for debugging
Expand Down
6 changes: 0 additions & 6 deletions packages/qwik/src/optimizer/core/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ fn test_input_fn(input: TestInput) -> Result<TransformOutput, anyhow::Error> {
reg_ctx_name,
strip_event_handlers: input.strip_event_handlers,
is_server: input.is_server,
is_dev: input.is_dev,
})
}

Expand Down Expand Up @@ -3410,7 +3409,6 @@ export const Local = component$(() => {
strip_event_handlers: false,
reg_ctx_name: None,
is_server: None,
is_dev: None,
});
snapshot_res!(&res, "".into());
}
Expand Down Expand Up @@ -3491,7 +3489,6 @@ export const Greeter = component$(() => {
strip_ctx_name: None,
strip_event_handlers: false,
is_server: None,
is_dev: None,
});
let ref_segments: Vec<_> = res
.unwrap()
Expand Down Expand Up @@ -3530,7 +3527,6 @@ export const Greeter = component$(() => {
strip_event_handlers: false,
reg_ctx_name: None,
is_server: None,
is_dev: None,
});

let segments: Vec<_> = res
Expand Down Expand Up @@ -3860,7 +3856,6 @@ struct TestInput {
pub strip_ctx_name: Option<Vec<String>>,
pub strip_event_handlers: bool,
pub is_server: Option<bool>,
pub is_dev: Option<bool>,
}

impl TestInput {
Expand All @@ -3886,7 +3881,6 @@ impl TestInput {
strip_ctx_name: None,
strip_event_handlers: false,
is_server: None,
is_dev: None,
}
}
}
20 changes: 11 additions & 9 deletions packages/qwik/src/optimizer/core/src/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::entry_strategy::EntryPolicy;
use crate::has_branches::{is_conditional_jsx, is_conditional_jsx_block};
use crate::inlined_fn::{convert_inlined_fn, render_expr};
use crate::is_const::is_const_expr;
use crate::parse::PathData;
use crate::parse::{EmitMode, PathData};
use crate::words::*;
use crate::{errors, EntryStrategy};
use base64::Engine;
Expand Down Expand Up @@ -125,12 +125,11 @@ pub struct QwikTransformOptions<'a> {
pub comments: Option<&'a SingleThreadedComments>,
pub global_collect: GlobalCollect,
pub scope: Option<&'a String>,
pub mode: EmitMode,
pub entry_strategy: EntryStrategy,
pub reg_ctx_name: Option<&'a [JsWord]>,
pub strip_ctx_name: Option<&'a [JsWord]>,
pub strip_event_handlers: bool,
pub is_dev: bool,
pub is_lib: bool,
pub is_server: bool,
pub cm: Lrc<SourceMap>,
}
Expand Down Expand Up @@ -334,7 +333,7 @@ impl<'a> QwikTransform<'a> {
let hash = hasher.finish();
let hash64 = base64(hash);

let symbol_name = if self.options.is_dev || self.options.is_lib {
let symbol_name = if matches!(self.options.mode, EmitMode::Dev | EmitMode::Lib) {
format!("{}_{}", display_name, hash64)
} else {
format!("s_{}", hash64)
Expand Down Expand Up @@ -383,7 +382,10 @@ impl<'a> QwikTransform<'a> {
ast::Expr::Lit(ast::Lit::Str(string)) => string.value,
_ => panic!("dfd"),
};
parse_symbol_name(symbol_name, self.options.is_dev || self.options.is_lib)
parse_symbol_name(
symbol_name,
matches!(self.options.mode, EmitMode::Dev | EmitMode::Lib),
)
};

self.segment_stack.push(symbol_name.clone());
Expand Down Expand Up @@ -855,7 +857,7 @@ impl<'a> QwikTransform<'a> {
vec![node_type, var_props, const_props, children, flags, key],
)
};
if self.options.is_dev {
if self.options.mode == EmitMode::Dev {
args.push(self.get_dev_location(node.span));
}

Expand Down Expand Up @@ -960,7 +962,7 @@ impl<'a> QwikTransform<'a> {
raw: None,
})),
];
let fn_callee = if self.options.is_dev {
let fn_callee = if self.options.mode == EmitMode::Dev {
args.push(get_qrl_dev_obj(
&self.options.path_data.abs_path,
segment_data,
Expand Down Expand Up @@ -1025,7 +1027,7 @@ impl<'a> QwikTransform<'a> {
})),
];

let fn_callee = if self.options.is_dev {
let fn_callee = if self.options.mode == EmitMode::Dev {
args.push(get_qrl_dev_obj(
&self.options.path_data.abs_path,
&segment_data,
Expand Down Expand Up @@ -1619,7 +1621,7 @@ impl<'a> QwikTransform<'a> {
}))];

let mut fn_name: &JsWord = &_NOOP_QRL;
if self.options.is_dev {
if self.options.mode == EmitMode::Dev {
args.push(get_qrl_dev_obj(
&self.options.path_data.abs_path,
&segment_data,
Expand Down
2 changes: 0 additions & 2 deletions packages/qwik/src/optimizer/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,6 @@ export interface TransformOptions {
// (undocumented)
explicitExtensions?: boolean;
// (undocumented)
isDev?: boolean;
// (undocumented)
isServer?: boolean;
// (undocumented)
minify?: MinifyMode;
Expand Down
2 changes: 0 additions & 2 deletions packages/qwik/src/optimizer/src/optimizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ const transformFsAsync = async (
stripCtxName: fsOpts.stripCtxName!,
stripExports: fsOpts.stripExports!,
isServer: fsOpts.isServer!,
// slight hack, it's actually undefined most of the time
isDev: fsOpts.isDev!,
};
return binding.transform_modules(convertOptions(modulesOpts));
}
Expand Down
Loading

0 comments on commit 09ccf81

Please sign in to comment.