diff --git a/package.json b/package.json index 01f958bfb85..981605c0913 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "qwik-monorepo", - "version": "0.0.23", + "version": "0.0.24", "scripts": { "build": "yarn node scripts --tsc --build --api --platform-binding-wasm-copy", "build.full": "yarn node scripts --tsc --build --api --eslint --qwikcity --platform-binding --wasm", diff --git a/packages/create-qwik/package.json b/packages/create-qwik/package.json index 9ddba85d67e..86965cdde57 100644 --- a/packages/create-qwik/package.json +++ b/packages/create-qwik/package.json @@ -1,6 +1,6 @@ { "name": "create-qwik", - "version": "0.0.23", + "version": "0.0.24", "description": "Interactive CLI and API for generating Qwik projects.", "bin": "create-qwik", "main": "index.js", diff --git a/packages/eslint-plugin-qwik/package.json b/packages/eslint-plugin-qwik/package.json index a60a26970cc..889c1268272 100644 --- a/packages/eslint-plugin-qwik/package.json +++ b/packages/eslint-plugin-qwik/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-qwik", - "version": "0.0.23", + "version": "0.0.24", "description": "An Open-Source sub-framework designed with a focus on server-side-rendering, lazy-loading, and styling/animation.", "main": "index.js", "author": "Builder Team", diff --git a/packages/qwik/package.json b/packages/qwik/package.json index 23cdc524623..f39983a71c0 100644 --- a/packages/qwik/package.json +++ b/packages/qwik/package.json @@ -1,11 +1,12 @@ { "name": "@builder.io/qwik", - "version": "0.0.23", + "version": "0.0.24", "description": "An Open-Source sub-framework designed with a focus on server-side-rendering, lazy-loading, and styling/animation.", "main": "./dist/core.cjs", "module": "./dist/core.mjs", "types": "./dist/core.d.ts", "type": "module", + "sideEffects": false, "exports": { ".": { "import": "./dist/core.mjs", diff --git a/packages/qwik/src/optimizer/core/src/code_move.rs b/packages/qwik/src/optimizer/core/src/code_move.rs index 13f2fe32597..7308fb286d8 100644 --- a/packages/qwik/src/optimizer/core/src/code_move.rs +++ b/packages/qwik/src/optimizer/core/src/code_move.rs @@ -1,6 +1,9 @@ use crate::collector::{new_ident_from_id, GlobalCollect, Id, ImportKind}; -use crate::parse::{emit_source_code, HookAnalysis, PathData, TransformModule, TransformOutput}; -use crate::transform::{add_handle_watch, create_internal_call, create_synthetic_wildcard_import}; +use crate::parse::{ + emit_source_code, might_need_handle_watch, HookAnalysis, PathData, TransformModule, + TransformOutput, +}; +use crate::transform::{add_handle_watch, create_synthetic_named_import}; use crate::words::*; use std::collections::BTreeMap; @@ -12,6 +15,13 @@ use swc_atoms::JsWord; use swc_common::comments::{SingleThreadedComments, SingleThreadedCommentsMap}; use swc_common::{sync::Lrc, SourceMap, DUMMY_SP}; use swc_ecmascript::ast; +use swc_ecmascript::utils::private_ident; + +macro_rules! id { + ($ident: expr) => { + ($ident.sym.clone(), $ident.span.ctxt()) + }; +} pub struct NewModuleCtx<'a> { pub expr: Box, @@ -21,8 +31,8 @@ pub struct NewModuleCtx<'a> { pub local_idents: &'a [Id], pub scoped_idents: &'a [Id], pub global: &'a GlobalCollect, - pub qwik_ident: &'a Id, pub is_entry: bool, + pub need_handle_watch: bool, pub leading_comments: SingleThreadedCommentsMap, pub trailing_comments: SingleThreadedCommentsMap, } @@ -39,11 +49,15 @@ pub fn new_module(ctx: NewModuleCtx) -> Result<(ast::Module, SingleThreadedComme shebang: None, }; - // Inject qwik internal import - module.body.push(create_synthetic_wildcard_import( - ctx.qwik_ident, - &BUILDER_IO_QWIK, - )); + let use_lexical_scope = if !ctx.scoped_idents.is_empty() { + let new_local = id!(private_ident!(&USE_LEXICAL_SCOPE.clone())); + module + .body + .push(create_synthetic_named_import(&new_local, &BUILDER_IO_QWIK)); + Some(new_local) + } else { + None + }; for id in ctx.local_idents { if let Some(import) = ctx.global.imports.get(id) { @@ -112,10 +126,10 @@ pub fn new_module(ctx: NewModuleCtx) -> Result<(ast::Module, SingleThreadedComme } } - let expr = if !ctx.scoped_idents.is_empty() { + let expr = if let Some(use_lexical_scope) = use_lexical_scope { Box::new(transform_function_expr( *ctx.expr, - ctx.qwik_ident, + &use_lexical_scope, ctx.scoped_idents, )) } else { @@ -123,7 +137,7 @@ pub fn new_module(ctx: NewModuleCtx) -> Result<(ast::Module, SingleThreadedComme }; module.body.push(create_named_export(expr, ctx.name)); - if ctx.is_entry { + if ctx.need_handle_watch { // Inject qwik internal import add_handle_watch(&mut module.body, true); } @@ -258,11 +272,15 @@ fn new_entry_module(hooks: &[&HookAnalysis], explicity_extensions: bool) -> ast: body: Vec::with_capacity(hooks.len()), shebang: None, }; + let mut need_handle_watch = false; for hook in hooks { let mut src = ["./", &hook.canonical_filename].concat(); if explicity_extensions { src = src + "." + hook.extension.as_ref(); } + if might_need_handle_watch(&hook.ctx_kind, &hook.ctx_name) { + need_handle_watch = true; + } module .body .push(ast::ModuleItem::ModuleDecl(ast::ModuleDecl::ExportNamed( @@ -287,36 +305,35 @@ fn new_entry_module(hooks: &[&HookAnalysis], explicity_extensions: bool) -> ast: }, ))); } - - add_handle_watch(&mut module.body, false); + if need_handle_watch { + add_handle_watch(&mut module.body, false); + } module } pub fn transform_function_expr( expr: ast::Expr, - qwik_ident: &Id, + use_lexical_scope: &Id, scoped_idents: &[Id], ) -> ast::Expr { match expr { ast::Expr::Arrow(node) => { - ast::Expr::Arrow(transform_arrow_fn(node, qwik_ident, scoped_idents)) + ast::Expr::Arrow(transform_arrow_fn(node, use_lexical_scope, scoped_idents)) } - ast::Expr::Fn(node) => ast::Expr::Fn(transform_fn(node, qwik_ident, scoped_idents)), + ast::Expr::Fn(node) => ast::Expr::Fn(transform_fn(node, use_lexical_scope, scoped_idents)), _ => expr, } } -pub fn transform_arrow_fn( +fn transform_arrow_fn( arrow: ast::ArrowExpr, - qwik_ident: &Id, + use_lexical_scope: &Id, scoped_idents: &[Id], ) -> ast::ArrowExpr { match arrow.body { ast::BlockStmtOrExpr::BlockStmt(mut block) => { let mut stmts = Vec::with_capacity(1 + block.stmts.len()); - if !scoped_idents.is_empty() { - stmts.push(create_use_lexical_scope(qwik_ident, scoped_idents)); - } + stmts.push(create_use_lexical_scope(use_lexical_scope, scoped_idents)); stmts.append(&mut block.stmts); ast::ArrowExpr { body: ast::BlockStmtOrExpr::BlockStmt(ast::BlockStmt { @@ -329,7 +346,7 @@ pub fn transform_arrow_fn( ast::BlockStmtOrExpr::Expr(expr) => { let mut stmts = Vec::with_capacity(2); if !scoped_idents.is_empty() { - stmts.push(create_use_lexical_scope(qwik_ident, scoped_idents)); + stmts.push(create_use_lexical_scope(use_lexical_scope, scoped_idents)); } stmts.push(create_return_stmt(expr)); ast::ArrowExpr { @@ -343,7 +360,7 @@ pub fn transform_arrow_fn( } } -pub fn transform_fn(node: ast::FnExpr, qwik_ident: &Id, scoped_idents: &[Id]) -> ast::FnExpr { +fn transform_fn(node: ast::FnExpr, use_lexical_scope: &Id, scoped_idents: &[Id]) -> ast::FnExpr { let mut stmts = Vec::with_capacity( 1 + node .function @@ -352,7 +369,7 @@ pub fn transform_fn(node: ast::FnExpr, qwik_ident: &Id, scoped_idents: &[Id]) -> .map_or(0, |body| body.stmts.len()), ); if !scoped_idents.is_empty() { - stmts.push(create_use_lexical_scope(qwik_ident, scoped_idents)); + stmts.push(create_use_lexical_scope(use_lexical_scope, scoped_idents)); } if let Some(mut body) = node.function.body { stmts.append(&mut body.stmts); @@ -376,7 +393,7 @@ const fn create_return_stmt(expr: Box) -> ast::Stmt { }) } -fn create_use_lexical_scope(qwik_ident: &Id, scoped_idents: &[Id]) -> ast::Stmt { +fn create_use_lexical_scope(use_lexical_scope: &Id, scoped_idents: &[Id]) -> ast::Stmt { ast::Stmt::Decl(ast::Decl::Var(ast::VarDecl { span: DUMMY_SP, declare: false, @@ -384,12 +401,14 @@ fn create_use_lexical_scope(qwik_ident: &Id, scoped_idents: &[Id]) -> ast::Stmt decls: vec![ast::VarDeclarator { definite: false, span: DUMMY_SP, - init: Some(Box::new(ast::Expr::Call(create_internal_call( - qwik_ident, - &USE_LEXICAL_SCOPE, - vec![], - None, - )))), + init: Some(Box::new(ast::Expr::Call(ast::CallExpr { + callee: ast::Callee::Expr(Box::new(ast::Expr::Ident(new_ident_from_id( + use_lexical_scope, + )))), + span: DUMMY_SP, + type_args: None, + args: vec![], + }))), name: ast::Pat::Array(ast::ArrayPat { span: DUMMY_SP, optional: false, diff --git a/packages/qwik/src/optimizer/core/src/parse.rs b/packages/qwik/src/optimizer/core/src/parse.rs index 313c2dc404b..464596a332d 100644 --- a/packages/qwik/src/optimizer/core/src/parse.rs +++ b/packages/qwik/src/optimizer/core/src/parse.rs @@ -286,6 +286,8 @@ pub fn transform_code(config: TransformCodeOptions) -> Result Result Result { file_prefix: file_prefix.into(), }) } + +pub fn might_need_handle_watch(ctx_kind: &HookKind, ctx_name: &str) -> bool { + if matches!(ctx_kind, HookKind::Event) { + return false; + } + matches!(ctx_name, "useClientEffect$" | "$") +} diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_1.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_1.snap index 2ff9817fb80..272b9a43fd7 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_1.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_1.snap @@ -19,13 +19,13 @@ const renderHeader = component($(() => { ============================= renderheader_zbbhwn4e8cg.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const renderHeader_zBbHWn4e8Cg = ()=>{ - return
import("./renderheader_div_onclick_fv2uzal99u4") + return
import("./renderheader_div_onclick_fv2uzal99u4") , "renderHeader_div_onClick_fV2uzAL99u4")}/>; }; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* @@ -49,13 +49,12 @@ export { hW as handleWatch }; */ ============================= renderheader_1_cpyr0uahiik.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const renderHeader_1_cPyr0uAhiIk = ()=>{ console.log("mount"); return render; }; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* @@ -79,20 +78,19 @@ export { hW as handleWatch }; */ ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; import { component } from '@builder.io/qwik'; -export const renderHeader = qwik.qrl(()=>import("./renderheader_zbbhwn4e8cg") +export const renderHeader = qrl(()=>import("./renderheader_zbbhwn4e8cg") , "renderHeader_zBbHWn4e8Cg"); -component(qwik.qrl(()=>import("./renderheader_1_cpyr0uahiik") +component(qrl(()=>import("./renderheader_1_cpyr0uahiik") , "renderHeader_1_cPyr0uAhiIk")); ============================= renderheader_div_onclick_fv2uzal99u4.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const renderHeader_div_onClick_fV2uzAL99u4 = (ctx)=>console.log(ctx) ; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_10.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_10.snap index 47acc1bab60..66085143ccb 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_10.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_10.snap @@ -27,7 +27,6 @@ const Header = $((decl1, {decl2}, [decl3]) => { ============================= header_wlr3xni6u38.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Header_WlR3xnI6u38 = (decl1, { decl2 }, [decl3])=>{ const hola = ident1.no; ident2; @@ -50,7 +49,7 @@ export const Header_WlR3xnI6u38 = (decl1, { decl2 }, [decl3])=>{ } required={false}/>; }; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* @@ -74,8 +73,8 @@ export { hW as handleWatch }; */ ============================= project/test.tsx == -import * as qwik from "@builder.io/qwik"; -qwik.qrl(()=>import("../header_wlr3xni6u38") +import { qrl } from "@builder.io/qwik"; +qrl(()=>import("../header_wlr3xni6u38") , "Header_WlR3xnI6u38"); == DIAGNOSTICS == diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_11.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_11.snap index 99f13936f8d..289cf05fd86 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_11.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_11.snap @@ -26,7 +26,6 @@ export const App = component$(() => { ============================= header_component_header_onclick_kjd9tcnknxy.tsx == -import * as qwik from "@builder.io/qwik"; import dep3 from "dep3/something"; export const Header_component_Header_onClick_KjD9TCNkNxY = (ev)=>dep3(ev) ; @@ -52,12 +51,12 @@ export const Header_component_Header_onClick_KjD9TCNkNxY = (ev)=>dep3(ev) */ ============================= header_component_uvbjufyfvdo.tsx == -import * as qwik from "@builder.io/qwik"; import { Header } from "./project/test"; import { bar as bbar } from "./state"; import * as dep2 from "dep2"; +import { qrl } from "@builder.io/qwik"; export const Header_component_UVBJuFYfvDo = ()=>{ - return
import("./entry_hooks") + return
import("./entry_hooks") , "Header_component_Header_onClick_KjD9TCNkNxY")}> {dep2.stuff()}{bbar()} @@ -86,7 +85,6 @@ export const Header_component_UVBJuFYfvDo = ()=>{ */ ============================= app_component_wgkrhwxaqjs.tsx == -import * as qwik from "@builder.io/qwik"; import { Header } from "./project/test"; import { foo } from "./state"; export const App_component_wGkRHWXaqjs = ()=>{ @@ -114,11 +112,11 @@ export const App_component_wGkRHWXaqjs = ()=>{ */ ============================= project/test.tsx == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const Header = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("../entry_hooks") +import { qrl } from "@builder.io/qwik"; +export const Header = /*#__PURE__*/ componentQrl(qrl(()=>import("../entry_hooks") , "Header_component_UVBJuFYfvDo")); -export const App = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("../entry_hooks") +export const App = /*#__PURE__*/ componentQrl(qrl(()=>import("../entry_hooks") , "App_component_wGkRHWXaqjs")); ============================= entry_hooks.js (ENTRY POINT)== @@ -127,7 +125,7 @@ export { Header_component_Header_onClick_KjD9TCNkNxY } from "./header_component_ export { Header_component_UVBJuFYfvDo } from "./header_component_uvbjufyfvdo"; export { App_component_wGkRHWXaqjs } from "./app_component_wgkrhwxaqjs"; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; == DIAGNOSTICS == diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_2.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_2.snap index 1614ecbfe50..d3e716a7200 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_2.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_2.snap @@ -15,15 +15,12 @@ export const Header = component$(() => { ============================= header_component_j4uyihabnr4.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const Header_component_J4uyIhaBNR4 = ()=>{ console.log("mount"); - return
import("./header_component_div_onclick_i7ekvwh3674") + return
import("./header_component_div_onclick_i7ekvwh3674") , "Header_component_div_onClick_i7ekvWH3674")}/>; }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -46,18 +43,17 @@ export { hW as handleWatch }; */ ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const Header = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./header_component_j4uyihabnr4") +import { qrl } from "@builder.io/qwik"; +export const Header = /*#__PURE__*/ componentQrl(qrl(()=>import("./header_component_j4uyihabnr4") , "Header_component_J4uyIhaBNR4")); ============================= header_component_div_onclick_i7ekvwh3674.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Header_component_div_onClick_i7ekvWH3674 = (ctx)=>console.log(ctx) ; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_3.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_3.snap index 92aa54c27af..1009e8408fd 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_3.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_3.snap @@ -18,15 +18,12 @@ export const App = () => { ============================= app_header_component_b9f3yeqco1w.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const App_Header_component_B9F3YeqcO1w = ()=>{ console.log("mount"); - return
import("./app_header_component_div_onclick_ao7ui7iw6oq") + return
import("./app_header_component_div_onclick_ao7ui7iw6oq") , "App_Header_component_div_onClick_aO7uI7Iw6oQ")}/>; }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -49,11 +46,10 @@ export { hW as handleWatch }; */ ============================= app_header_component_div_onclick_ao7ui7iw6oq.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const App_Header_component_div_onClick_aO7uI7Iw6oQ = (ctx)=>console.log(ctx) ; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* @@ -77,10 +73,10 @@ export { hW as handleWatch }; */ ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const App = ()=>{ - const Header = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./app_header_component_b9f3yeqco1w") + const Header = /*#__PURE__*/ componentQrl(qrl(()=>import("./app_header_component_b9f3yeqco1w") , "App_Header_component_B9F3YeqcO1w")); return Header; }; diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_4.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_4.snap index c83f043f0b1..9d7f5c9e798 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_4.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_4.snap @@ -18,15 +18,12 @@ export function App() { ============================= app_header_component_b9f3yeqco1w.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const App_Header_component_B9F3YeqcO1w = ()=>{ console.log("mount"); - return
import("./app_header_component_div_onclick_ao7ui7iw6oq") + return
import("./app_header_component_div_onclick_ao7ui7iw6oq") , "App_Header_component_div_onClick_aO7uI7Iw6oQ")}/>; }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -49,11 +46,10 @@ export { hW as handleWatch }; */ ============================= app_header_component_div_onclick_ao7ui7iw6oq.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const App_Header_component_div_onClick_aO7uI7Iw6oQ = (ctx)=>console.log(ctx) ; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* @@ -77,10 +73,10 @@ export { hW as handleWatch }; */ ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export function App() { - const Header = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./app_header_component_b9f3yeqco1w") + const Header = /*#__PURE__*/ componentQrl(qrl(()=>import("./app_header_component_b9f3yeqco1w") , "App_Header_component_B9F3YeqcO1w")); return Header; } diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_5.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_5.snap index 08e7d943f0c..2dead43ac5e 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_5.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_5.snap @@ -17,21 +17,18 @@ export const Header = component$(() => { ============================= header_component_j4uyihabnr4.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const Header_component_J4uyIhaBNR4 = ()=>{ return <>
console.log("1") }/> -
import("./header_component_div_onclick_i7ekvwh3674") +
import("./header_component_div_onclick_i7ekvwh3674") , "Header_component_div_onClick_i7ekvWH3674")}/> ; }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -54,18 +51,17 @@ export { hW as handleWatch }; */ ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const Header = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./header_component_j4uyihabnr4") +import { qrl } from "@builder.io/qwik"; +export const Header = /*#__PURE__*/ componentQrl(qrl(()=>import("./header_component_j4uyihabnr4") , "Header_component_J4uyIhaBNR4")); ============================= header_component_div_onclick_i7ekvwh3674.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Header_component_div_onClick_i7ekvWH3674 = (ctx)=>console.log("2") ; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_6.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_6.snap index 9cd204655c1..8647d899929 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_6.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_6.snap @@ -10,11 +10,10 @@ export const sym1 = $((ctx) => console.log("1")); ============================= sym1_axurpxx5lak.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const sym1_aXUrPXX5Lak = (ctx)=>console.log("1") ; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* @@ -38,8 +37,8 @@ export { hW as handleWatch }; */ ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; -export const sym1 = qwik.qrl(()=>import("./sym1_axurpxx5lak") +import { qrl } from "@builder.io/qwik"; +export const sym1 = qrl(()=>import("./sym1_axurpxx5lak") , "sym1_aXUrPXX5Lak"); == DIAGNOSTICS == diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_7.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_7.snap index bf6b1a41f31..f226fc6a58d 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_7.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_7.snap @@ -22,15 +22,12 @@ const App = component$(() => { ============================= header_component_j4uyihabnr4.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const Header_component_J4uyIhaBNR4 = ()=>{ console.log("mount"); - return
import("./header_component_div_onclick_i7ekvwh3674") + return
import("./header_component_div_onclick_i7ekvwh3674") , "Header_component_div_onClick_i7ekvWH3674")}/>; }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -53,23 +50,19 @@ export { hW as handleWatch }; */ ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const Header = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./header_component_j4uyihabnr4") +import { qrl } from "@builder.io/qwik"; +export const Header = /*#__PURE__*/ componentQrl(qrl(()=>import("./header_component_j4uyihabnr4") , "Header_component_J4uyIhaBNR4")); -/*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./app_component_ckepmxzlub0") +/*#__PURE__*/ componentQrl(qrl(()=>import("./app_component_ckepmxzlub0") , "App_component_ckEPmXZlub0")); ============================= app_component_ckepmxzlub0.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import { Header } from "./test"; export const App_component_ckEPmXZlub0 = ()=>{ return
; }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -92,11 +85,10 @@ export { hW as handleWatch }; */ ============================= header_component_div_onclick_i7ekvwh3674.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Header_component_div_onClick_i7ekvWH3674 = (ctx)=>console.log(ctx) ; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_8.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_8.snap index 1d3fcce0121..d8c718d687e 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_8.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_8.snap @@ -20,14 +20,11 @@ export const Header = component$(() => { ============================= header_component_j4uyihabnr4.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const Header_component_J4uyIhaBNR4 = ()=>{ - return qwik.qrl(()=>import("./header_component_1_2b8d0oh9zwc") + return qrl(()=>import("./header_component_1_2b8d0oh9zwc") , "Header_component_1_2B8d0oH9ZWc"); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -50,7 +47,6 @@ export { hW as handleWatch }; */ ============================= header_component_1_2b8d0oh9zwc.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import { Header } from "./test"; export const Header_component_1_2B8d0oH9ZWc = (hola)=>{ const hola = this; @@ -59,7 +55,7 @@ export const Header_component_1_2B8d0oH9ZWc = (hola)=>{ return
; }; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* @@ -83,9 +79,9 @@ export { hW as handleWatch }; */ ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const Header = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./header_component_j4uyihabnr4") +import { qrl } from "@builder.io/qwik"; +export const Header = /*#__PURE__*/ componentQrl(qrl(()=>import("./header_component_j4uyihabnr4") , "Header_component_J4uyIhaBNR4")); == DIAGNOSTICS == diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_9.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_9.snap index cc5d2137573..0b85cf112a1 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_9.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_9.snap @@ -20,7 +20,6 @@ const Header = $((decl1, {decl2}, [decl3]) => { ============================= header_wjuauqn7oxg.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Header_WjUaUQN7Oxg = (decl1, { decl2 }, [decl3])=>{ const { decl4 , key: decl5 } = this; let [decl6, ...decl7] = stuff; @@ -33,7 +32,7 @@ export const Header_WjUaUQN7Oxg = (decl1, { decl2 }, [decl3])=>{ try {} catch ({ decl19 }) {} }; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* @@ -57,8 +56,8 @@ export { hW as handleWatch }; */ ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; -qwik.qrl(()=>import("./header_wjuauqn7oxg") +import { qrl } from "@builder.io/qwik"; +qrl(()=>import("./header_wjuauqn7oxg") , "Header_WjUaUQN7Oxg"); == DIAGNOSTICS == diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_capture_imports.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_capture_imports.snap index 66a1dc7c0cd..f6fa7d629b8 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_capture_imports.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_capture_imports.snap @@ -17,20 +17,16 @@ export const App = component$(() => { ============================= test.js == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const App = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./app_component_ckepmxzlub0") +import { qrl } from "@builder.io/qwik"; +export const App = /*#__PURE__*/ componentQrl(qrl(()=>import("./app_component_ckepmxzlub0") , "App_component_ckEPmXZlub0")); ============================= app_component_usestyles_t35nsa5uv7u.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import css1 from "./global.css"; import css2 from "./style.css"; export const App_component_useStyles_t35nSa5UV7U = `${css1}${css2}`; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -53,17 +49,14 @@ export { hW as handleWatch }; */ ============================= app_component_ckepmxzlub0.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; import { useStylesQrl } from "@builder.io/qwik"; export const App_component_ckEPmXZlub0 = ()=>{ - useStylesQrl(qwik.qrl(()=>import("./app_component_usestyles_t35nsa5uv7u") + useStylesQrl(qrl(()=>import("./app_component_usestyles_t35nsa5uv7u") , "App_component_useStyles_t35nSa5UV7U")); - useStylesQrl(qwik.qrl(()=>import("./app_component_usestyles_1_xbk4w0zkwe8") + useStylesQrl(qrl(()=>import("./app_component_usestyles_1_xbk4w0zkwe8") , "App_component_useStyles_1_xBK4W0ZKWe8")); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -86,12 +79,8 @@ export { hW as handleWatch }; */ ============================= app_component_usestyles_1_xbk4w0zkwe8.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import css3 from "./style.css"; export const App_component_useStyles_1_xBK4W0ZKWe8 = css3; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_capturing_fn_class.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_capturing_fn_class.snap index a6d2f89e8e5..82315355b66 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_capturing_fn_class.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_capturing_fn_class.snap @@ -25,14 +25,14 @@ export const App = component$(() => { ============================= test.js == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const App = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./app_component_ckepmxzlub0") +import { qrl } from "@builder.io/qwik"; +export const App = /*#__PURE__*/ componentQrl(qrl(()=>import("./app_component_ckepmxzlub0") , "App_component_ckEPmXZlub0")); ============================= app_component_ckepmxzlub0.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const App_component_ckEPmXZlub0 = ()=>{ function hola() { console.log('hola'); @@ -41,12 +41,9 @@ export const App_component_ckEPmXZlub0 = ()=>{ } class Other { } - return qwik.qrl(()=>import("./app_component_1_w0t0o3qmovu") + return qrl(()=>import("./app_component_1_w0t0o3qmovu") , "App_component_1_w0t0o3QMovU"); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -69,7 +66,6 @@ export { hW as handleWatch }; */ ============================= app_component_1_w0t0o3qmovu.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import { jsx as _jsx } from "@builder.io/qwik/jsx-runtime"; export const App_component_1_w0t0o3QMovU = ()=>{ hola(); @@ -77,7 +73,7 @@ export const App_component_1_w0t0o3QMovU = ()=>{ return /*#__PURE__*/ _jsx("div", {}); }; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_custom_inlined_functions.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_custom_inlined_functions.snap index 789cd5f3865..c00c8e14f86 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_custom_inlined_functions.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_custom_inlined_functions.snap @@ -31,30 +31,27 @@ export const Lightweight = (props) => { ============================= test.js == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; import { wrap, useEffect } from '@builder.io/qwik'; export const useMemoQrl = (qrt)=>{ useEffect(qrt); }; export const useMemo$ = wrap(useMemoQrl); -export const App = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./app_component_ckepmxzlub0") +export const App = /*#__PURE__*/ componentQrl(qrl(()=>import("./app_component_ckepmxzlub0") , "App_component_ckEPmXZlub0")); export const Lightweight = (props)=>{ - useMemoQrl(qwik.qrl(()=>import("./lightweight_usememo_uicxvtqf1a8") + useMemoQrl(qrl(()=>import("./lightweight_usememo_uicxvtqf1a8") , "Lightweight_useMemo_UIcxVTQF1a8")); }; ============================= app_component_usememo_6sc9kvki3y0.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { useLexicalScope } from "@builder.io/qwik"; export const App_component_useMemo_6Sc9KVki3Y0 = ()=>{ - const [state] = qwik.useLexicalScope(); + const [state] = useLexicalScope(); console.log(state.count); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -77,13 +74,9 @@ export { hW as handleWatch }; */ ============================= lightweight_usememo_uicxvtqf1a8.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Lightweight_useMemo_UIcxVTQF1a8 = ()=>{ console.log(state.count); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -106,25 +99,22 @@ export { hW as handleWatch }; */ ============================= app_component_ckepmxzlub0.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; import { useMemoQrl } from "./test"; import { useStore } from "@builder.io/qwik"; export const App_component_ckEPmXZlub0 = (props)=>{ const state = useStore({ count: 0 }); - useMemoQrl(qwik.qrl(()=>import("./app_component_usememo_6sc9kvki3y0") + useMemoQrl(qrl(()=>import("./app_component_usememo_6sc9kvki3y0") , "App_component_useMemo_6Sc9KVki3Y0", [ state ])); - return qwik.qrl(()=>import("./app_component_1_w0t0o3qmovu") + return qrl(()=>import("./app_component_1_w0t0o3qmovu") , "App_component_1_w0t0o3QMovU", [ state ]); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -147,16 +137,16 @@ export { hW as handleWatch }; */ ============================= app_component_1_w0t0o3qmovu.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { useLexicalScope } from "@builder.io/qwik"; import { jsx as _jsx } from "@builder.io/qwik/jsx-runtime"; export const App_component_1_w0t0o3QMovU = ()=>{ - const [state] = qwik.useLexicalScope(); + const [state] = useLexicalScope(); return /*#__PURE__*/ _jsx("div", { children: state.count }); }; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_explicit_ext_no_transpile.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_explicit_ext_no_transpile.snap index 370f25b0ec3..ce8aad25353 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_explicit_ext_no_transpile.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_explicit_ext_no_transpile.snap @@ -16,14 +16,13 @@ export const App = component$((props) => { ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const App = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./entry_hooks.tsx") +import { qrl } from "@builder.io/qwik"; +export const App = /*#__PURE__*/ componentQrl(qrl(()=>import("./entry_hooks.tsx") , "App_component_ckEPmXZlub0")); ============================= app_component_usestyles_t35nsa5uv7u.tsx == -import * as qwik from "@builder.io/qwik"; export const App_component_useStyles_t35nSa5UV7U = 'hola'; /* @@ -47,12 +46,12 @@ export const App_component_useStyles_t35nSa5UV7U = 'hola'; */ ============================= app_component_ckepmxzlub0.tsx == -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; import { useStylesQrl } from "@builder.io/qwik"; export const App_component_ckEPmXZlub0 = (props)=>{ - useStylesQrl(qwik.qrl(()=>import("./entry_hooks.tsx") + useStylesQrl(qrl(()=>import("./entry_hooks.tsx") , "App_component_useStyles_t35nSa5UV7U")); - return qwik.qrl(()=>import("./entry_hooks.tsx") + return qrl(()=>import("./entry_hooks.tsx") , "App_component_1_w0t0o3QMovU"); }; @@ -77,7 +76,6 @@ export const App_component_ckEPmXZlub0 = (props)=>{ */ ============================= app_component_1_w0t0o3qmovu.tsx == -import * as qwik from "@builder.io/qwik"; export const App_component_1_w0t0o3QMovU = ()=>
; @@ -106,7 +104,7 @@ export { App_component_useStyles_t35nSa5UV7U } from "./app_component_usestyles_t export { App_component_ckEPmXZlub0 } from "./app_component_ckepmxzlub0.tsx"; export { App_component_1_w0t0o3QMovU } from "./app_component_1_w0t0o3qmovu.tsx"; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; == DIAGNOSTICS == diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_explicit_ext_transpile.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_explicit_ext_transpile.snap index 25de84cf431..6fec0d756a0 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_explicit_ext_transpile.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_explicit_ext_transpile.snap @@ -16,18 +16,14 @@ export const App = component$((props) => { ============================= test.js == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const App = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./app_component_ckepmxzlub0.js") +import { qrl } from "@builder.io/qwik"; +export const App = /*#__PURE__*/ componentQrl(qrl(()=>import("./app_component_ckepmxzlub0.js") , "App_component_ckEPmXZlub0")); ============================= app_component_usestyles_t35nsa5uv7u.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const App_component_useStyles_t35nSa5UV7U = 'hola'; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -50,17 +46,14 @@ export { hW as handleWatch }; */ ============================= app_component_ckepmxzlub0.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; import { useStylesQrl } from "@builder.io/qwik"; export const App_component_ckEPmXZlub0 = (props)=>{ - useStylesQrl(qwik.qrl(()=>import("./app_component_usestyles_t35nsa5uv7u.js") + useStylesQrl(qrl(()=>import("./app_component_usestyles_t35nsa5uv7u.js") , "App_component_useStyles_t35nSa5UV7U")); - return qwik.qrl(()=>import("./app_component_1_w0t0o3qmovu.js") + return qrl(()=>import("./app_component_1_w0t0o3qmovu.js") , "App_component_1_w0t0o3QMovU"); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -83,12 +76,11 @@ export { hW as handleWatch }; */ ============================= app_component_1_w0t0o3qmovu.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import { jsx as _jsx } from "@builder.io/qwik/jsx-runtime"; export const App_component_1_w0t0o3QMovU = ()=>/*#__PURE__*/ _jsx("div", {}) ; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_exports.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_exports.snap index 52dc1a20c4a..b4f7195bd8f 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_exports.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_exports.snap @@ -31,14 +31,11 @@ export const Footer = component$(); ============================= header_component_uvbjufyfvdo.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const Header_component_UVBJuFYfvDo = ()=>{ - return qwik.qrl(()=>import("./header_component_1_uwm1kg0igo0") + return qrl(()=>import("./header_component_1_uwm1kg0igo0") , "Header_component_1_uWM1kg0IGO0"); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -61,8 +58,8 @@ export { hW as handleWatch }; */ ============================= project/test.tsx == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const [a, { b , v1: [c] , d =v2 , ...e }, f = v3, ...g] = obj; const exp1 = 1; const internal = 2; @@ -71,13 +68,12 @@ export function foo() {} export class bar { } export default function DefaultFn() {}; -export const Header = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("../header_component_uvbjufyfvdo") +export const Header = /*#__PURE__*/ componentQrl(qrl(()=>import("../header_component_uvbjufyfvdo") , "Header_component_UVBJuFYfvDo")); export const Footer = /*#__PURE__*/ componentQrl(); ============================= header_component_1_uwm1kg0igo0.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import { default as DefaultFn } from "./project/test"; import { Footer } from "./project/test"; import { a } from "./project/test"; @@ -99,7 +95,7 @@ export const Header_component_1_uWM1kg0IGO0 = ()=>
; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component.snap index d85fd03f701..37fa2ee5ca2 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component.snap @@ -17,16 +17,12 @@ const Header = component$(() => { ============================= header_component_j4uyihabnr4.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import { useStore } from "@builder.io/qwik"; export const Header_component_J4uyIhaBNR4 = ()=>{ const thing = useStore(); const { foo , bar } = foo(); return
{thing}
; }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -49,10 +45,10 @@ export { hW as handleWatch }; */ ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; import { $, component$, useStore } from '@builder.io/qwik'; -const Header = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./header_component_j4uyihabnr4") +const Header = /*#__PURE__*/ componentQrl(qrl(()=>import("./header_component_j4uyihabnr4") , "Header_component_J4uyIhaBNR4")); == DIAGNOSTICS == diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component_2.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component_2.snap index c5f179df91a..26af53e4b29 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component_2.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component_2.snap @@ -36,8 +36,8 @@ export const App = component$((props) => { ============================= test.js == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; import { useStore } from '@builder.io/qwik'; export const useCounter = ()=>{ return useStore({ @@ -45,19 +45,16 @@ export const useCounter = ()=>{ }); }; export const STEP = 1; -export const App = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./app_component_ckepmxzlub0") +export const App = /*#__PURE__*/ componentQrl(qrl(()=>import("./app_component_ckepmxzlub0") , "App_component_ckEPmXZlub0")); ============================= app_component_div_onclick_1cgetmfzx0g.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { useLexicalScope } from "@builder.io/qwik"; export const App_component_div_onClick_1CGetmFZx0g = ()=>{ - const [count2, state] = qwik.useLexicalScope(); + const [count2, state] = useLexicalScope(); return state.count += count2; }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -80,15 +77,12 @@ export { hW as handleWatch }; */ ============================= app_component_div_button_onclick_f5nww9e63a4.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { useLexicalScope } from "@builder.io/qwik"; import { STEP } from "./test"; export const App_component_div_button_onClick_f5NwW9e63a4 = ()=>{ - const [STEP_2, btn, props, state, thing] = qwik.useLexicalScope(); + const [STEP_2, btn, props, state, thing] = useLexicalScope(); return state.count += btn.offset + thing + STEP + STEP_2 + props.step; }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -111,9 +105,9 @@ export { hW as handleWatch }; */ ============================= app_component_ckepmxzlub0.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import { jsx as _jsx } from "@builder.io/qwik/jsx-runtime"; import { jsxs as _jsxs } from "@builder.io/qwik/jsx-runtime"; +import { qrl } from "@builder.io/qwik"; import { useCounter } from "./test"; import { useStore } from "@builder.io/qwik"; export const App_component_ckEPmXZlub0 = (props)=>{ @@ -124,7 +118,7 @@ export const App_component_ckEPmXZlub0 = (props)=>{ const STEP_2 = 2; const count2 = state.count * 2; return /*#__PURE__*/ _jsxs("div", { - onClickQrl: qwik.qrl(()=>import("./app_component_div_onclick_1cgetmfzx0g") + onClickQrl: qrl(()=>import("./app_component_div_onclick_1cgetmfzx0g") , "App_component_div_onClick_1CGetmFZx0g", [ count2, state @@ -134,7 +128,7 @@ export const App_component_ckEPmXZlub0 = (props)=>{ children: state.count }), buttons.map((btn)=>/*#__PURE__*/ _jsx("button", { - onClickQrl: qwik.qrl(()=>import("./app_component_div_button_onclick_f5nww9e63a4") + onClickQrl: qrl(()=>import("./app_component_div_button_onclick_f5nww9e63a4") , "App_component_div_button_onClick_f5NwW9e63a4", [ STEP_2, btn, @@ -148,9 +142,6 @@ export const App_component_ckEPmXZlub0 = (props)=>{ ] }); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component_capture_props.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component_capture_props.snap index 1d2f6cca633..918df1a1c9a 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component_capture_props.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_functional_component_capture_props.snap @@ -23,21 +23,18 @@ export const App = component$(({count, rest: [I2, {I3, v1: [I4], I5=v2, ...I6}, ============================= test.js == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const App = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./app_component_ckepmxzlub0") +import { qrl } from "@builder.io/qwik"; +export const App = /*#__PURE__*/ componentQrl(qrl(()=>import("./app_component_ckepmxzlub0") , "App_component_ckEPmXZlub0")); ============================= app_component_div_onclick_1cgetmfzx0g.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { useLexicalScope } from "@builder.io/qwik"; export const App_component_div_onClick_1CGetmFZx0g = ()=>{ - const [count, state] = qwik.useLexicalScope(); + const [count, state] = useLexicalScope(); return state.count += count + total; }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -60,14 +57,14 @@ export { hW as handleWatch }; */ ============================= app_component_ckepmxzlub0.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; import { useStore } from "@builder.io/qwik"; export const App_component_ckEPmXZlub0 = ({ count , rest: [I2, { I3 , v1: [I4] , I5 =v2 , ...I6 }, I7 = v3, ...I8] })=>{ const state = useStore({ count: 0 }); const { rest: [C2, { C3 , v1: [C4] , C5 =v2 , ...C6 }, C7 = v3, ...C8] } = foo(); - return qwik.qrl(()=>import("./app_component_1_w0t0o3qmovu") + return qrl(()=>import("./app_component_1_w0t0o3qmovu") , "App_component_1_w0t0o3QMovU", [ C2, C3, @@ -87,9 +84,6 @@ export const App_component_ckEPmXZlub0 = ({ count , rest: [I2, { I3 , v1: [I4] , state ]); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -112,12 +106,13 @@ export { hW as handleWatch }; */ ============================= app_component_1_w0t0o3qmovu.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { useLexicalScope } from "@builder.io/qwik"; import { jsxs as _jsxs } from "@builder.io/qwik/jsx-runtime"; +import { qrl } from "@builder.io/qwik"; export const App_component_1_w0t0o3QMovU = ()=>{ - const [C2, C3, C4, C5, C6, C7, C8, I2, I3, I4, I5, I6, I7, I8, count, state] = qwik.useLexicalScope(); + const [C2, C3, C4, C5, C6, C7, C8, I2, I3, I4, I5, I6, I7, I8, count, state] = useLexicalScope(); return /*#__PURE__*/ _jsxs("div", { - onClickQrl: qwik.qrl(()=>import("./app_component_div_onclick_1cgetmfzx0g") + onClickQrl: qrl(()=>import("./app_component_div_onclick_1cgetmfzx0g") , "App_component_div_onClick_1CGetmFZx0g", [ count, state @@ -144,7 +139,7 @@ export const App_component_1_w0t0o3QMovU = ()=>{ }); }; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_inlined_entry_strategy.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_inlined_entry_strategy.snap index 6de4f30ff55..ef0da5f1567 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_inlined_entry_strategy.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_inlined_entry_strategy.snap @@ -30,28 +30,28 @@ export const Child = component$(() => { ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; +import { inlinedQrl } from "@builder.io/qwik"; import { useClientEffectQrl } from "@builder.io/qwik"; +import { useLexicalScope } from "@builder.io/qwik"; import { useStylesQrl } from "@builder.io/qwik"; import { useStore } from '@builder.io/qwik'; import { thing } from 'dependency'; import mongodb from 'mongodb'; -export const Child = /*#__PURE__*/ componentQrl(qwik.inlinedQrl(()=>{ - useStylesQrl(qwik.inlinedQrl('somestring', "Child_component_useStyles_qBZTuFM0160")); +export const Child = /*#__PURE__*/ componentQrl(inlinedQrl(()=>{ + useStylesQrl(inlinedQrl('somestring', "Child_component_useStyles_qBZTuFM0160")); const state = useStore({ count: 0 }); // Double count watch - useClientEffectQrl(qwik.inlinedQrl(()=>{ - const [state] = qwik.useLexicalScope(); + useClientEffectQrl(inlinedQrl(()=>{ + const [state] = useLexicalScope(); state.count = thing.doStuff(); }, "Child_component_useClientEffect_kYRT1iERt9g", [ state ])); - return
{ - return console.log(mongodb); - }, "Child_component_div_onClick_elliVSnAiOQ")}> + return
console.log(mongodb) + , "Child_component_div_onClick_elliVSnAiOQ")}>
; }, "Child_component_9GyF01GDKqw")); diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_invalid_hook_expr1.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_invalid_hook_expr1.snap index ac7f3f4b0ed..d8f90fa42b5 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_invalid_hook_expr1.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_invalid_hook_expr1.snap @@ -22,18 +22,14 @@ export const App = component$(() => { ============================= test.js == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const App = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./app_component_ckepmxzlub0") +import { qrl } from "@builder.io/qwik"; +export const App = /*#__PURE__*/ componentQrl(qrl(()=>import("./app_component_ckepmxzlub0") , "App_component_ckEPmXZlub0")); ============================= app_component_usestyles_t35nsa5uv7u.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const App_component_useStyles_t35nSa5UV7U = style; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -56,24 +52,21 @@ export { hW as handleWatch }; */ ============================= app_component_ckepmxzlub0.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import { jsx as _jsx } from "@builder.io/qwik/jsx-runtime"; import css1 from "./global.css"; import css2 from "./style.css"; +import { qrl } from "@builder.io/qwik"; import { useStylesQrl } from "@builder.io/qwik"; export const App_component_ckEPmXZlub0 = ()=>{ const style = `${css1}${css2}`; - useStylesQrl(qwik.qrl(()=>import("./app_component_usestyles_t35nsa5uv7u") + useStylesQrl(qrl(()=>import("./app_component_usestyles_t35nsa5uv7u") , "App_component_useStyles_t35nSa5UV7U")); const render = ()=>{ return /*#__PURE__*/ _jsx("div", {}); }; - return qwik.qrl(()=>import("./app_component_1_w0t0o3qmovu") + return qrl(()=>import("./app_component_1_w0t0o3qmovu") , "App_component_1_w0t0o3QMovU"); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -96,10 +89,9 @@ export { hW as handleWatch }; */ ============================= app_component_1_w0t0o3qmovu.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const App_component_1_w0t0o3QMovU = render; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_invalid_references.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_invalid_references.snap index 0d8a5b67f4d..43c3b8aafbf 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_invalid_references.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_invalid_references.snap @@ -24,24 +24,21 @@ export const App = component$(({count}) => { ============================= test.js == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; const [I2, { I3 , v1: [I4] , I5 =v2 , ...I6 }, I7 = v3, ...I8] = obj; -export const App = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./app_component_ckepmxzlub0") +export const App = /*#__PURE__*/ componentQrl(qrl(()=>import("./app_component_ckepmxzlub0") , "App_component_ckEPmXZlub0")); ============================= app_component_ckepmxzlub0.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const App_component_ckEPmXZlub0 = ({ count })=>{ console.log(I1, I2, I3, I4, I5, I6, I7, I8, I9); console.log(itsok, v1, v2, v3, obj); - return qwik.qrl(()=>import("./app_component_1_w0t0o3qmovu") + return qrl(()=>import("./app_component_1_w0t0o3qmovu") , "App_component_1_w0t0o3QMovU"); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -64,13 +61,12 @@ export { hW as handleWatch }; */ ============================= app_component_1_w0t0o3qmovu.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import { jsx as _jsx } from "@builder.io/qwik/jsx-runtime"; export const App_component_1_w0t0o3QMovU = ()=>{ return /*#__PURE__*/ _jsx(I10, {}); }; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx.snap index c343f0a7a4b..af3fe2cba62 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx.snap @@ -47,8 +47,8 @@ export const Foo = component$((props) => { ============================= test.js == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@builder.io/qwik/jsx-runtime"; export const Lightweight = (props)=>{ return /*#__PURE__*/ _jsx("div", { @@ -62,23 +62,20 @@ export const Lightweight = (props)=>{ }) }); }; -export const Foo = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./foo_component_htdrsvublie") +export const Foo = /*#__PURE__*/ componentQrl(qrl(()=>import("./foo_component_htdrsvublie") , "Foo_component_HTDRsvUbLiE"), { tagName: "my-foo" }); ============================= foo_component_htdrsvublie.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const Foo_component_HTDRsvUbLiE = (props)=>{ - return qwik.qrl(()=>import("./foo_component_1_dvu6fitwgly") + return qrl(()=>import("./foo_component_1_dvu6fitwgly") , "Foo_component_1_DvU6FitWglY", [ props ]); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -101,13 +98,13 @@ export { hW as handleWatch }; */ ============================= foo_component_1_dvu6fitwgly.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { useLexicalScope } from "@builder.io/qwik"; import { Lightweight } from "./test"; import { Fragment as _Fragment } from "@builder.io/qwik/jsx-runtime"; import { jsx as _jsx } from "@builder.io/qwik/jsx-runtime"; import { jsxs as _jsxs } from "@builder.io/qwik/jsx-runtime"; export const Foo_component_1_DvU6FitWglY = ()=>{ - const [props] = qwik.useLexicalScope(); + const [props] = useLexicalScope(); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs(_Fragment, { @@ -146,7 +143,7 @@ export const Foo_component_1_DvU6FitWglY = ()=>{ }); }; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx_import_source.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx_import_source.snap index 8ce58903103..18bc467688b 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx_import_source.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx_import_source.snap @@ -19,27 +19,23 @@ export const App2 = qwikify$(() => ( ============================= test.js == -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; import { qwikifyQrl } from "./qwikfy"; import { jsx as _jsx } from "react/jsx-runtime"; export const App = ()=>/*#__PURE__*/ _jsx("div", { onClick$: ()=>console.log('App') }) ; -export const App2 = qwikifyQrl(qwik.qrl(()=>import("./app2_qwikify_rkjw7ocmds4.js") +export const App2 = qwikifyQrl(qrl(()=>import("./app2_qwikify_rkjw7ocmds4.js") , "App2_qwikify_RKJW7oCMdS4")); ============================= app2_qwikify_rkjw7ocmds4.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import { jsx as _jsx } from "react/jsx-runtime"; export const App2_qwikify_RKJW7oCMdS4 = ()=>/*#__PURE__*/ _jsx("div", { onClick$: ()=>console.log('App2') }) ; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx_listeners.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx_listeners.snap index d299a2443f0..5362fe40d5e 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx_listeners.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_jsx_listeners.snap @@ -39,12 +39,8 @@ export const Foo = component$(() => { ============================= foo_component_div_host_ondocumentscroll_zip7mifsjry.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Foo_component_div_host_onDocumentScroll_Zip7mifsjRY = ()=>console.log('host:onDocument:scroll') ; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -67,23 +63,20 @@ export { hW as handleWatch }; */ ============================= test.js == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const Foo = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./foo_component_htdrsvublie") +import { qrl } from "@builder.io/qwik"; +export const Foo = /*#__PURE__*/ componentQrl(qrl(()=>import("./foo_component_htdrsvublie") , "Foo_component_HTDRsvUbLiE"), { tagName: "my-foo" }); ============================= foo_component_htdrsvublie.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { qrl } from "@builder.io/qwik"; export const Foo_component_HTDRsvUbLiE = ()=>{ - return qwik.qrl(()=>import("./foo_component_1_dvu6fitwgly") + return qrl(()=>import("./foo_component_1_dvu6fitwgly") , "Foo_component_1_DvU6FitWglY"); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -106,12 +99,8 @@ export { hW as handleWatch }; */ ============================= foo_component_div_host_onclick_cpeh970jbey.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Foo_component_div_host_onClick_cPEH970JbEY = ()=>console.log('host:onClick$') ; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -134,39 +123,39 @@ export { hW as handleWatch }; */ ============================= foo_component_1_dvu6fitwgly.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import { jsx as _jsx } from "@builder.io/qwik/jsx-runtime"; +import { qrl } from "@builder.io/qwik"; export const Foo_component_1_DvU6FitWglY = ()=>{ - const handler = qwik.qrl(()=>import("./foo_component_handler_h10xztd0e7w") + const handler = qrl(()=>import("./foo_component_handler_h10xztd0e7w") , "Foo_component_handler_H10xZtD0e7w"); return /*#__PURE__*/ _jsx("div", { - onClickQrl: qwik.qrl(()=>import("./foo_component_div_onclick_m48dyiidsjw") + onClickQrl: qrl(()=>import("./foo_component_div_onclick_m48dyiidsjw") , "Foo_component_div_onClick_M48DYiidSJw"), - onDocumentScrollQrl: qwik.qrl(()=>import("./foo_component_div_ondocumentscroll_rwfftfivukc") + onDocumentScrollQrl: qrl(()=>import("./foo_component_div_ondocumentscroll_rwfftfivukc") , "Foo_component_div_onDocumentScroll_rwFFtFiVuKc"), - onDocumentScrollQrl: qwik.qrl(()=>import("./foo_component_div_ondocumentscroll_1_cwneogpmtzi") + onDocumentScrollQrl: qrl(()=>import("./foo_component_div_ondocumentscroll_1_cwneogpmtzi") , "Foo_component_div_onDocumentScroll_1_CwneoGpmTZI"), - "on-cLickQrl": qwik.qrl(()=>import("./foo_component_div_on_click_ioasjw8vyjc") + "on-cLickQrl": qrl(()=>import("./foo_component_div_on_click_ioasjw8vyjc") , "Foo_component_div_on_cLick_IoAsJW8vYJc"), - "onDocument-sCrollQrl": qwik.qrl(()=>import("./foo_component_div_ondocument_scroll_5vnik61pzom") + "onDocument-sCrollQrl": qrl(()=>import("./foo_component_div_ondocument_scroll_5vnik61pzom") , "Foo_component_div_onDocument_sCroll_5VNik61PZOM"), - "onDocument-scroLLQrl": qwik.qrl(()=>import("./foo_component_div_ondocument_scroll_1q0sgr8te3g") + "onDocument-scroLLQrl": qrl(()=>import("./foo_component_div_ondocument_scroll_1q0sgr8te3g") , "Foo_component_div_onDocument_scroLL_1q0Sgr8te3g"), - "host:onClickQrl": qwik.qrl(()=>import("./foo_component_div_host_onclick_cpeh970jbey") + "host:onClickQrl": qrl(()=>import("./foo_component_div_host_onclick_cpeh970jbey") , "Foo_component_div_host_onClick_cPEH970JbEY"), - "host:onDocumentScrollQrl": qwik.qrl(()=>import("./foo_component_div_host_ondocumentscroll_zip7mifsjry") + "host:onDocumentScrollQrl": qrl(()=>import("./foo_component_div_host_ondocumentscroll_zip7mifsjry") , "Foo_component_div_host_onDocumentScroll_Zip7mifsjRY"), - "host:onDocumentScrollQrl": qwik.qrl(()=>import("./foo_component_div_host_ondocumentscroll_1_em1lspk7jvg") + "host:onDocumentScrollQrl": qrl(()=>import("./foo_component_div_host_ondocumentscroll_1_em1lspk7jvg") , "Foo_component_div_host_onDocumentScroll_1_Em1LspK7JVg"), onKeyup: handler, "onDocument:keyup": handler, "onWindow:keyup": handler, - customQrl: qwik.qrl(()=>import("./foo_component_div_custom_pyhnxab17ms") + customQrl: qrl(()=>import("./foo_component_div_custom_pyhnxab17ms") , "Foo_component_div_custom_pyHnxab17ms") }); }; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* @@ -190,12 +179,8 @@ export { hW as handleWatch }; */ ============================= foo_component_div_host_ondocumentscroll_1_em1lspk7jvg.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Foo_component_div_host_onDocumentScroll_1_Em1LspK7JVg = ()=>console.log('host:onWindow:scroll') ; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -218,12 +203,8 @@ export { hW as handleWatch }; */ ============================= foo_component_div_custom_pyhnxab17ms.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Foo_component_div_custom_pyHnxab17ms = ()=>console.log('custom') ; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -246,12 +227,8 @@ export { hW as handleWatch }; */ ============================= foo_component_div_ondocument_scroll_1q0sgr8te3g.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Foo_component_div_onDocument_scroLL_1q0Sgr8te3g = ()=>console.log('onDocument-scroLL') ; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -274,12 +251,8 @@ export { hW as handleWatch }; */ ============================= foo_component_div_ondocumentscroll_1_cwneogpmtzi.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Foo_component_div_onDocumentScroll_1_CwneoGpmTZI = ()=>console.log('onWindowScroll') ; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -302,12 +275,8 @@ export { hW as handleWatch }; */ ============================= foo_component_div_on_click_ioasjw8vyjc.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Foo_component_div_on_cLick_IoAsJW8vYJc = ()=>console.log('on-cLick$') ; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -330,12 +299,8 @@ export { hW as handleWatch }; */ ============================= foo_component_div_onclick_m48dyiidsjw.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Foo_component_div_onClick_M48DYiidSJw = ()=>console.log('onClick$') ; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -358,12 +323,8 @@ export { hW as handleWatch }; */ ============================= foo_component_div_ondocumentscroll_rwfftfivukc.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Foo_component_div_onDocumentScroll_rwFFtFiVuKc = ()=>console.log('onDocumentScroll') ; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -386,11 +347,10 @@ export { hW as handleWatch }; */ ============================= foo_component_handler_h10xztd0e7w.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Foo_component_handler_H10xZtD0e7w = ()=>console.log('reused') ; import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); +hW.issue123 && hW.issue123(); export { hW as handleWatch }; /* @@ -414,12 +374,8 @@ export { hW as handleWatch }; */ ============================= foo_component_div_ondocument_scroll_5vnik61pzom.js (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; export const Foo_component_div_onDocument_sCroll_5VNik61PZOM = ()=>console.log('onDocument-sCroll') ; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_lightweight_functional.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_lightweight_functional.snap index 8736fcab91a..eb203dfbbc1 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_lightweight_functional.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_lightweight_functional.snap @@ -32,7 +32,6 @@ export const ButtonArrow = ({text, color}) => { ============================= foo_component_htdrsvublie.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; import { Button } from "./test"; import { ButtonArrow } from "./test"; export const Foo_component_HTDRsvUbLiE = ({ color })=>{ @@ -44,9 +43,6 @@ export const Foo_component_HTDRsvUbLiE = ({ color })=>{
; }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -69,14 +65,11 @@ export { hW as handleWatch }; */ ============================= buttonarrow_button_onclick_9npo43figik.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { useLexicalScope } from "@builder.io/qwik"; export const ButtonArrow_button_onClick_9npo43fIGik = ()=>{ - const [color, text] = qwik.useLexicalScope(); + const [color, text] = useLexicalScope(); return console.log(text, color); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -99,14 +92,11 @@ export { hW as handleWatch }; */ ============================= button_button_onclick_nsm0jyv00jw.tsx (ENTRY POINT)== -import * as qwik from "@builder.io/qwik"; +import { useLexicalScope } from "@builder.io/qwik"; export const Button_button_onClick_NsM0JYV00Jw = ()=>{ - const [color, text] = qwik.useLexicalScope(); + const [color, text] = useLexicalScope(); return console.log(text, color); }; -import { handleWatch as hW } from "@builder.io/qwik"; -hW.issue456 && hW.issue123(); -export { hW as handleWatch }; /* { @@ -129,21 +119,21 @@ export { hW as handleWatch }; */ ============================= test.tsx == -import * as qwik from "@builder.io/qwik"; import { componentQrl } from "@builder.io/qwik"; -export const Foo = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./foo_component_htdrsvublie") +import { qrl } from "@builder.io/qwik"; +export const Foo = /*#__PURE__*/ componentQrl(qrl(()=>import("./foo_component_htdrsvublie") , "Foo_component_HTDRsvUbLiE"), { tagName: "my-foo" }); export function Button({ text , color }) { - return ; } export const ButtonArrow = ({ text , color })=>{ - return