diff --git a/.npmrc b/.npmrc index ab682c96469..6aba6e22a54 100644 --- a/.npmrc +++ b/.npmrc @@ -2,3 +2,4 @@ engine-strict=true strict-peer-dependencies=false shell-emulator=true auto-install-peers=false +ignore-workspace-root-check=true diff --git a/package.json b/package.json index 1d53c1af030..1c4585c55bd 100644 --- a/package.json +++ b/package.json @@ -59,22 +59,22 @@ "@napi-rs/triples": "1.1.0", "@node-rs/helper": "1.3.3", "@octokit/action": "3.18.1", - "@playwright/test": "1.29.0", + "@playwright/test": "1.29.1", "@types/brotli": "1.3.1", "@types/cross-spawn": "6.0.2", "@types/eslint": "8.4.10", "@types/express": "4.17.15", "@types/mri": "1.1.1", - "@types/node": "^18.11.16", + "@types/node": "^18.11.18", "@types/node-fetch": "2.6.2", "@types/path-browserify": "1.0.0", - "@types/prettier": "2.7.1", + "@types/prettier": "2.7.2", "@types/prompts": "2.4.2", "@types/semver": "7.3.13", "@types/which-pm-runs": "1.0.0", - "@typescript-eslint/eslint-plugin": "5.46.1", - "@typescript-eslint/parser": "5.46.1", - "@typescript-eslint/utils": "5.46.1", + "@typescript-eslint/eslint-plugin": "5.48.0", + "@typescript-eslint/parser": "5.48.0", + "@typescript-eslint/utils": "5.48.0", "all-contributors-cli": "6.24.0", "brotli": "1.3.3", "commitizen": "4.2.6", @@ -82,8 +82,8 @@ "create-qwik": "workspace:*", "cross-spawn": "7.0.3", "cz-conventional-changelog": "3.3.0", - "esbuild": "0.16.8", - "eslint": "8.30.0", + "esbuild": "0.16.12", + "eslint": "8.31.0", "eslint-plugin-no-only-tests": "3.1.0", "execa": "6.1.0", "express": "4.18.2", @@ -96,7 +96,7 @@ "prettier": "2.8.1", "pretty-quick": "^3.1.3", "prompts": "2.4.2", - "rollup": "3.7.4", + "rollup": "3.9.1", "semver": "7.3.8", "snoop": "^1.0.4", "terser": "5.16.1", @@ -104,7 +104,7 @@ "typescript": "4.9.4", "undici": "5.14.0", "uvu": "0.5.6", - "vite": "4.0.1", + "vite": "4.0.3", "vite-tsconfig-paths": "4.0.3", "watchlist": "0.3.1", "which-pm-runs": "1.1.0" diff --git a/packages/docs/package.json b/packages/docs/package.json index 0e1196566b1..c54e7417e30 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -43,7 +43,7 @@ "typescript": "4.9.4", "undici": "5.14.0", "uvu": "0.5.6", - "vite": "4.0.1", + "vite": "4.0.3", "wrangler": "^2.6.2" }, "author": "Builder.io Team", diff --git a/packages/eslint-plugin-qwik/qwik.unit.ts b/packages/eslint-plugin-qwik/qwik.unit.ts index b564b35e442..f0a939bf69e 100644 --- a/packages/eslint-plugin-qwik/qwik.unit.ts +++ b/packages/eslint-plugin-qwik/qwik.unit.ts @@ -302,7 +302,7 @@ export default component$(() => { return
});`, errors: [ - 'Identifier ("useMethod") can not be captured inside the scope (component$) because it\'s declared at the root of the module and it is not exported. Add export. Check out https://qwik.builder.io/docs/advanced/optimizer for more details.', + 'Identifier ("useMethod") can not be captured inside the scope (component$) because it\'s declared at the root of the module and it is not exported. Add export. Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.', ], }, { @@ -318,7 +318,7 @@ export default component$(() => { return
; });`, errors: [ - 'Identifier ("useMethod") can not be captured inside the scope (useTask$) because it is a function, which is not serializable. Check out https://qwik.builder.io/docs/advanced/optimizer for more details.', + 'Identifier ("useMethod") can not be captured inside the scope (useTask$) because it is a function, which is not serializable. Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.', ], }, { @@ -334,7 +334,7 @@ export default component$(() => { });`, errors: [ - 'Identifier ("useMethod") can not be captured inside the scope (useTask$) because it is a function, which is not serializable. Check out https://qwik.builder.io/docs/advanced/optimizer for more details.', + 'Identifier ("useMethod") can not be captured inside the scope (useTask$) because it is a function, which is not serializable. Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.', ], }, { @@ -348,7 +348,7 @@ export default component$(() => { });`, errors: [ - 'Identifier ("Stuff") can not be captured inside the scope (useTask$) because it is a class constructor, which is not serializable. Check out https://qwik.builder.io/docs/advanced/optimizer for more details.', + 'Identifier ("Stuff") can not be captured inside the scope (useTask$) because it is a class constructor, which is not serializable. Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.', ], }, { @@ -363,7 +363,7 @@ export default component$(() => { });`, errors: [ - 'Identifier ("stuff") can not be captured inside the scope (useTask$) because it is an instance of the "Stuff" class, which is not serializable. Use a simple object literal instead. Check out https://qwik.builder.io/docs/advanced/optimizer for more details.', + 'Identifier ("stuff") can not be captured inside the scope (useTask$) because it is an instance of the "Stuff" class, which is not serializable. Use a simple object literal instead. Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.', ], }, { @@ -378,7 +378,7 @@ export default component$(() => { });`, errors: [ - 'Identifier ("a") can not be captured inside the scope (useTask$) because it is Symbol, which is not serializable. Check out https://qwik.builder.io/docs/advanced/optimizer for more details.', + 'Identifier ("a") can not be captured inside the scope (useTask$) because it is Symbol, which is not serializable. Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.', ], }, { @@ -400,7 +400,7 @@ export default component$(() => { });`, errors: [ - 'Identifier ("a") can not be captured inside the scope (useTask$) because it is a function, which is not serializable. Check out https://qwik.builder.io/docs/advanced/optimizer for more details.', + 'Identifier ("a") can not be captured inside the scope (useTask$) because it is a function, which is not serializable. Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.', ], }, { @@ -417,7 +417,7 @@ export default component$(() => { return
});`, errors: [ - 'Identifier ("state") can not be captured inside the scope (useTask$) because "state.value" is a function, which is not serializable. Check out https://qwik.builder.io/docs/advanced/optimizer for more details.', + 'Identifier ("state") can not be captured inside the scope (useTask$) because "state.value" is a function, which is not serializable. Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.', ], }, { @@ -448,7 +448,7 @@ export default component$(() => { ); });`, errors: [ - 'The value of the identifier ("click") can not be changed once it is captured the scope (onClick$). Check out https://qwik.builder.io/docs/advanced/optimizer for more details.', + 'The value of the identifier ("click") can not be changed once it is captured the scope (onClick$). Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.', ], }, { @@ -465,7 +465,7 @@ export default component$(() => { ); });`, errors: [ - 'Identifier ("props") can not be captured inside the scope (onClick$) because "props.nonserializableTuple" is an instance of the "Function" class, which is not serializable. Check out https://qwik.builder.io/docs/advanced/optimizer for more details.', + 'Identifier ("props") can not be captured inside the scope (onClick$) because "props.nonserializableTuple" is an instance of the "Function" class, which is not serializable. Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.', ], }, ], diff --git a/packages/eslint-plugin-qwik/src/validLexicalScope.ts b/packages/eslint-plugin-qwik/src/validLexicalScope.ts index 2c2cbfb633f..15cb75a8e10 100644 --- a/packages/eslint-plugin-qwik/src/validLexicalScope.ts +++ b/packages/eslint-plugin-qwik/src/validLexicalScope.ts @@ -40,11 +40,11 @@ export const validLexicalScope = createRule({ messages: { referencesOutside: - 'Identifier ("{{varName}}") can not be captured inside the scope ({{dollarName}}) because {{reason}}. Check out https://qwik.builder.io/docs/advanced/optimizer for more details.', + 'Identifier ("{{varName}}") can not be captured inside the scope ({{dollarName}}) because {{reason}}. Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.', unvalidJsxDollar: 'JSX attributes that end with $ can only take an inlined arrow function of a QRL identifier. Make sure the value is created using $()', mutableIdentifier: - 'The value of the identifier ("{{varName}}") can not be changed once it is captured the scope ({{dollarName}}). Check out https://qwik.builder.io/docs/advanced/optimizer for more details.', + 'The value of the identifier ("{{varName}}") can not be changed once it is captured the scope ({{dollarName}}). Check out https://qwik.builder.io/docs/advanced/dollar/ for more details.', }, }, create(context) { diff --git a/packages/qwik-city/package.json b/packages/qwik-city/package.json index a5b8a63bbcd..a9596a46586 100644 --- a/packages/qwik-city/package.json +++ b/packages/qwik-city/package.json @@ -82,13 +82,13 @@ "@netlify/edge-functions": "^2.0.0", "@types/marked": "4.0.8", "@types/mdast": "^3.0.10", - "@types/node": "^18.11.16", + "@types/node": "^18.11.18", "@types/refractor": "3.0.2", "estree-util-value-to-estree": "2.1.0", "github-slugger": "2.0.0", "hast-util-heading-rank": "2.1.0", "hast-util-to-string": "2.0.0", - "marked": "4.2.4", + "marked": "4.2.5", "mdast-util-mdx": "^2.0.0", "refractor": "4.8.0", "rehype-autolink-headings": "6.1.1", @@ -99,8 +99,8 @@ "unified": "10.1.2", "unist-util-visit": "4.1.1", "uvu": "0.5.6", - "vite": "4.0.1", - "yaml": "2.1.3" + "vite": "4.0.3", + "yaml": "2.2.1" }, "peerDependencies": { "@builder.io/qwik": ">=0.16.0" diff --git a/packages/qwik-react/package.json b/packages/qwik-react/package.json index 425950fd711..f1d655f0b1c 100644 --- a/packages/qwik-react/package.json +++ b/packages/qwik-react/package.json @@ -20,11 +20,11 @@ "devDependencies": { "@builder.io/qwik": "workspace:*", "@types/react": "18.0.26", - "@types/react-dom": "18.0.9", + "@types/react-dom": "18.0.10", "react": "18.2.0", "react-dom": "18.2.0", "typescript": "4.9.4", - "vite": "4.0.1" + "vite": "4.0.3" }, "peerDependencies": { "@builder.io/qwik": ">=0.1.11", diff --git a/packages/qwik/src/core/api.md b/packages/qwik/src/core/api.md index b00189e1a5a..567fd117f7f 100644 --- a/packages/qwik/src/core/api.md +++ b/packages/qwik/src/core/api.md @@ -740,6 +740,9 @@ export interface ResourceResolved { // @public (undocumented) export type ResourceReturn = ResourcePending | ResourceResolved | ResourceRejected; +// @internal (undocumented) +export const _restProps: (props: Record, omit: string[]) => Record; + // @alpha export const setPlatform: (plt: CorePlatform) => CorePlatform; diff --git a/packages/qwik/src/core/index.ts b/packages/qwik/src/core/index.ts index 2749c6630b2..00ac12c6a31 100644 --- a/packages/qwik/src/core/index.ts +++ b/packages/qwik/src/core/index.ts @@ -116,6 +116,7 @@ export type { ValueOrPromise } from './util/types'; export type { Signal } from './state/signal'; export type { NoSerialize } from './state/common'; export { _wrapSignal } from './state/signal'; +export { _restProps } from './state/store'; export { noSerialize, mutable } from './state/common'; export { _IMMUTABLE } from './state/constants'; diff --git a/packages/qwik/src/core/state/store.ts b/packages/qwik/src/core/state/store.ts index ddfe3cdcd55..0a342164f25 100644 --- a/packages/qwik/src/core/state/store.ts +++ b/packages/qwik/src/core/state/store.ts @@ -78,6 +78,19 @@ export const setObjectFlags = (obj: object, flags: number) => { export type TargetType = Record; +/** + * @internal + */ +export const _restProps = (props: Record, omit: string[]) => { + const rest: Record = {}; + for (const key in props) { + if (!omit.includes(key)) { + rest[key] = props[key]; + } + } + return rest; +}; + class ReadWriteProxyHandler implements ProxyHandler { constructor( private $containerState$: ContainerState, @@ -174,14 +187,6 @@ class ReadWriteProxyHandler implements ProxyHandler { } ownKeys(target: TargetType): ArrayLike { - let subscriber: SubscriberHost | SubscriberEffect | null | undefined = null; - const invokeCtx = tryGetInvokeContext(); - if (invokeCtx) { - subscriber = invokeCtx.$subscriber$; - } - if (subscriber) { - this.$manager$.$addSub$([0, subscriber, undefined]); - } if (isArray(target)) { return Reflect.ownKeys(target); } diff --git a/packages/qwik/src/optimizer/core/src/code_move.rs b/packages/qwik/src/optimizer/core/src/code_move.rs index 774c193028f..78d16f3d39e 100644 --- a/packages/qwik/src/optimizer/core/src/code_move.rs +++ b/packages/qwik/src/optimizer/core/src/code_move.rs @@ -384,7 +384,7 @@ fn transform_fn(node: ast::FnExpr, use_lexical_scope: &Id, scoped_idents: &[Id]) } } -const fn create_return_stmt(expr: Box) -> ast::Stmt { +pub const fn create_return_stmt(expr: Box) -> ast::Stmt { ast::Stmt::Return(ast::ReturnStmt { arg: Some(expr), span: DUMMY_SP, diff --git a/packages/qwik/src/optimizer/core/src/collector.rs b/packages/qwik/src/optimizer/core/src/collector.rs index 6de1eac170e..de8c3e84447 100644 --- a/packages/qwik/src/optimizer/core/src/collector.rs +++ b/packages/qwik/src/optimizer/core/src/collector.rs @@ -42,6 +42,7 @@ pub struct Import { } pub struct GlobalCollect { + pub synthetic: Vec<(Id, Import)>, pub imports: HashMap, pub exports: HashMap>, pub root: HashMap, @@ -52,6 +53,7 @@ pub struct GlobalCollect { pub fn global_collect(module: &ast::Module) -> GlobalCollect { let mut collect = GlobalCollect { + synthetic: vec![], imports: HashMap::with_capacity(16), exports: HashMap::with_capacity(16), @@ -96,6 +98,9 @@ impl GlobalCollect { } pub fn add_import(&mut self, local: Id, import: Import) { + if import.synthetic { + self.synthetic.push((local.clone(), import.clone())); + } self.rev_imports.insert( (import.specifier.clone(), import.source.clone()), local.clone(), @@ -370,25 +375,29 @@ impl Visit for IdentCollector { } } -pub fn collect_from_pat(pat: &ast::Pat, identifiers: &mut Vec<(Id, Span)>) { +pub fn collect_from_pat(pat: &ast::Pat, identifiers: &mut Vec<(Id, Span)>) -> bool { match pat { ast::Pat::Ident(ident) => { identifiers.push((id!(ident.id), ident.id.span)); + true } ast::Pat::Array(array) => { for el in array.elems.iter().flatten() { collect_from_pat(el, identifiers); } + false } ast::Pat::Rest(rest) => { if let ast::Pat::Ident(ident) = rest.arg.as_ref() { identifiers.push((id!(ident.id), ident.id.span)); } + false } ast::Pat::Assign(expr) => { if let ast::Pat::Ident(ident) = expr.left.as_ref() { identifiers.push((id!(ident.id), ident.id.span)); } + false } ast::Pat::Object(obj) => { for prop in &obj.props { @@ -406,7 +415,8 @@ pub fn collect_from_pat(pat: &ast::Pat, identifiers: &mut Vec<(Id, Span)>) { } } } + false } - _ => {} - }; + _ => false, + } } diff --git a/packages/qwik/src/optimizer/core/src/lib.rs b/packages/qwik/src/optimizer/core/src/lib.rs index b140496770c..aa78bce6c62 100644 --- a/packages/qwik/src/optimizer/core/src/lib.rs +++ b/packages/qwik/src/optimizer/core/src/lib.rs @@ -17,6 +17,7 @@ mod filter_exports; mod is_immutable; mod package_json; mod parse; +mod props_destructuring; mod transform; mod utils; mod words; diff --git a/packages/qwik/src/optimizer/core/src/parse.rs b/packages/qwik/src/optimizer/core/src/parse.rs index a11c31cae74..1c6e074a98f 100644 --- a/packages/qwik/src/optimizer/core/src/parse.rs +++ b/packages/qwik/src/optimizer/core/src/parse.rs @@ -10,6 +10,7 @@ use crate::collector::global_collect; use crate::const_replace::ConstReplacerVisitor; use crate::entry_strategy::EntryPolicy; use crate::filter_exports::StripExportsVisitor; +use crate::props_destructuring::transform_props_destructuring; use crate::transform::{HookKind, QwikTransform, QwikTransformOptions}; use crate::utils::{Diagnostic, DiagnosticCategory, DiagnosticScope, SourceLocation}; use path_slash::PathExt; @@ -283,8 +284,11 @@ pub fn transform_code(config: TransformCodeOptions) -> Result { + component_ident: Option, + pub identifiers: HashMap, + pub global_collect: &'a mut GlobalCollect, +} + +pub fn transform_props_destructuring( + main_module: &mut ast::Module, + global_collect: &mut GlobalCollect, +) { + main_module.visit_mut_with(&mut PropsDestructuing { + component_ident: global_collect.get_imported_local(&COMPONENT, &BUILDER_IO_QWIK), + identifiers: HashMap::new(), + global_collect, + }); +} + +macro_rules! id { + ($ident: expr) => { + ($ident.sym.clone(), $ident.span.ctxt()) + }; +} + +macro_rules! id_eq { + ($ident: expr, $cid: expr) => { + if let Some(cid) = $cid { + cid.0 == $ident.sym && cid.1 == $ident.span.ctxt() + } else { + false + } + }; +} + +impl<'a> VisitMut for PropsDestructuing<'a> { + fn visit_mut_call_expr(&mut self, node: &mut ast::CallExpr) { + if let ast::Callee::Expr(box ast::Expr::Ident(ref ident)) = &node.callee { + if id_eq!(ident, &self.component_ident) { + if let Some(first_arg) = node.args.first_mut() { + if let ast::Expr::Arrow(arrow) = &mut *first_arg.expr { + transform_component_props(arrow, self); + } + } + } + } + node.visit_mut_children_with(self); + } + + fn visit_mut_expr(&mut self, node: &mut ast::Expr) { + match node { + ast::Expr::Ident(ident) => { + if let Some(expr) = self.identifiers.get(&id!(ident)) { + *node = expr.clone(); + } + } + _ => { + node.visit_mut_children_with(self); + } + } + } +} + +fn transform_component_props(arrow: &mut ast::ArrowExpr, props_transform: &mut PropsDestructuing) { + if let Some(ast::Pat::Object(obj)) = arrow.params.first() { + let new_ident = private_ident!("props"); + let mut local = vec![]; + let mut skip = false; + let mut rest_id = None; + for prop in &obj.props { + match prop { + ast::ObjectPatProp::Assign(ref v) => { + let access = ast::Expr::Member(ast::MemberExpr { + obj: Box::new(ast::Expr::Ident(new_ident.clone())), + prop: ast::MemberProp::Ident(v.key.clone()), + span: DUMMY_SP, + }); + if let Some(value) = &v.value { + if is_immutable_expr( + value.as_ref(), + &COMPONENT, + props_transform.global_collect, + None, + ) { + local.push(( + id!(v.key), + v.key.sym.clone(), + ast::Expr::Bin(ast::BinExpr { + span: DUMMY_SP, + op: ast::BinaryOp::NullishCoalescing, + left: Box::new(access), + right: value.clone(), + }), + )); + } else { + skip = true; + } + } else { + local.push((id!(v.key), v.key.sym.clone(), access)); + } + } + ast::ObjectPatProp::KeyValue(ref v) => { + if let ast::PropName::Ident(ref key) = v.key { + if let ast::Pat::Ident(ref ident) = *v.value { + let access = ast::Expr::Member(ast::MemberExpr { + obj: Box::new(ast::Expr::Ident(new_ident.clone())), + prop: ast::MemberProp::Ident(key.clone()), + span: DUMMY_SP, + }); + local.push((id!(ident), key.sym.clone(), access)); + } else { + skip = true; + } + } else { + skip = true; + } + } + ast::ObjectPatProp::Rest(ast::RestPat { box arg, .. }) => { + if let ast::Pat::Ident(ref ident) = arg { + rest_id = Some(id!(&ident.id)); + } else { + skip = true; + } + } + } + } + if skip || local.is_empty() { + return; + } + if let Some(rest_id) = rest_id { + let props_id = id!(new_ident); + let omit_fn = props_transform + .global_collect + .import(_REST_PROPS.clone(), BUILDER_IO_QWIK.clone()); + let omit = local.iter().map(|(_, id, _)| id.clone()).collect(); + transform_rest(arrow, &omit_fn, &rest_id, &props_id, omit); + } + for (id, _, expr) in local { + props_transform.identifiers.insert(id, expr); + } + arrow.params[0] = ast::Pat::Ident(ast::BindingIdent::from(new_ident)); + } +} + +fn transform_rest( + arrow: &mut ast::ArrowExpr, + omit_fn: &Id, + rest_id: &Id, + props_id: &Id, + omit: Vec, +) { + let new_stmt = create_omit_props(omit_fn, rest_id, props_id, omit); + match &mut arrow.body { + ast::BlockStmtOrExpr::BlockStmt(block) => { + block.stmts.insert(0, new_stmt); + } + ast::BlockStmtOrExpr::Expr(ref expr) => { + arrow.body = ast::BlockStmtOrExpr::BlockStmt(ast::BlockStmt { + span: DUMMY_SP, + stmts: vec![new_stmt, create_return_stmt(expr.clone())], + }); + } + } +} + +fn create_omit_props(omit_fn: &Id, rest_id: &Id, props_id: &Id, omit: Vec) -> ast::Stmt { + ast::Stmt::Decl(ast::Decl::Var(Box::new(ast::VarDecl { + span: DUMMY_SP, + declare: false, + kind: ast::VarDeclKind::Const, + decls: vec![ast::VarDeclarator { + definite: false, + span: DUMMY_SP, + init: Some(Box::new(ast::Expr::Call(ast::CallExpr { + callee: ast::Callee::Expr(Box::new(ast::Expr::Ident(new_ident_from_id(omit_fn)))), + span: DUMMY_SP, + type_args: None, + args: vec![ + ast::ExprOrSpread { + spread: None, + expr: Box::new(ast::Expr::Ident(new_ident_from_id(props_id))), + }, + ast::ExprOrSpread { + spread: None, + expr: Box::new(ast::Expr::Array(ast::ArrayLit { + span: DUMMY_SP, + elems: omit + .into_iter() + .map(|v| { + Some(ast::ExprOrSpread { + spread: None, + expr: Box::new(ast::Expr::Lit(ast::Lit::Str(ast::Str { + span: DUMMY_SP, + value: v, + raw: None, + }))), + }) + }) + .collect(), + })), + }, + ], + }))), + name: ast::Pat::Ident(ast::BindingIdent::from(new_ident_from_id(rest_id))), + }], + }))) +} diff --git a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_dead_code.snap b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_dead_code.snap index f31831afc66..62ec7c973c1 100644 --- a/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_dead_code.snap +++ b/packages/qwik/src/optimizer/core/src/snapshots/qwik_core__test__example_dead_code.snap @@ -21,13 +21,13 @@ export const Foo = component$(({foo}) => { ============================= foo_component_htdrsvublie.tsx (ENTRY POINT)== -export const Foo_component_HTDRsvUbLiE = ({ foo })=>{ +export const Foo_component_HTDRsvUbLiE = (props)=>{ useMount$(()=>{}); return
; }; -Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\"yCAI8B,CAAC,EAAC,IAAG,EAAC,GAAK;IACrC,UAAU,IAAM,CAIhB;IACA,QACK;AAET\"}") +Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\"yCAI8B,SAAW;IACrC,UAAU,IAAM,CAIhB;IACA,QACK;AAET\"}") /* { "origin": "test.tsx", 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 27e9fb8b87a..8da0f3aef51 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 @@ -31,10 +31,10 @@ export const Child = component$(() => { ============================= test.tsx == import { componentQrl } from "@builder.io/qwik"; +import { useStylesQrl } 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 './sibling'; import mongodb from 'mongodb'; 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 e219bd4dd06..6c13f798033 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 @@ -34,14 +34,14 @@ Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"ma ============================= app_component_ckepmxzlub0.js (ENTRY POINT)== import { qrl } from "@builder.io/qwik"; -export const App_component_ckEPmXZlub0 = ({ count })=>{ +export const App_component_ckEPmXZlub0 = (props)=>{ console.log(I1, I2, I3, I4, I5, I6, I7, I8, I9); console.log(itsok, v1, v2, v3, obj); return qrl(()=>import("./app_component_1_w0t0o3qmovu"), "App_component_1_w0t0o3QMovU"); }; -Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";yCAQ8B,CAAC,EAAC,MAAK,EAAC,GAAK;IACvC,QAAQ,GAAG,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI;IAC5C,QAAQ,GAAG,CAAC,OAAO,IAAI,IAAI,IAAI;IAC/B;AAKJ\"}") +Some("{\"version\":3,\"sources\":[\"/user/qwik/src/test.tsx\"],\"names\":[],\"mappings\":\";yCAQ8B,SAAa;IACvC,QAAQ,GAAG,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI;IAC5C,QAAQ,GAAG,CAAC,OAAO,IAAI,IAAI,IAAI;IAC/B;AAKJ\"}") /* { "origin": "test.tsx", 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 f469f8961b3..86a49d489f3 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,8 +19,8 @@ export const App2 = qwikify$(() => ( ============================= test.js == -/* @jsxImportSource react */ import { qrl } from "@builder.io/qwik"; -import { qwikifyQrl } from "./qwikfy"; +/* @jsxImportSource react */ import { qwikifyQrl } from "./qwikfy"; +import { qrl } from "@builder.io/qwik"; import { jsx as _jsx } from "react/jsx-runtime"; export const App = ()=>/*#__PURE__*/ _jsx("div", { onClick$: ()=>console.log('App') 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 5c9d47844e6..b9b0767971a 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 @@ -34,7 +34,7 @@ export const ButtonArrow = ({text, color}) => { import { Button } from "./test"; import { ButtonArrow } from "./test"; -export const Foo_component_HTDRsvUbLiE = ({ color })=>{ +export const Foo_component_HTDRsvUbLiE = (props1)=>{ return