Skip to content

Commit

Permalink
fix: rollup workaround (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed May 6, 2022
1 parent feb1272 commit 4a77611
Show file tree
Hide file tree
Showing 37 changed files with 387 additions and 116 deletions.
15 changes: 3 additions & 12 deletions packages/qwik/src/optimizer/core/src/code_move.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::collector::{new_ident_from_id, GlobalCollect, Id, ImportKind};
use crate::parse::{emit_source_code, HookAnalysis, PathData, TransformModule, TransformOutput};
use crate::transform::{
create_internal_call, create_synthetic_named_export, create_synthetic_wildcard_import,
};
use crate::transform::{add_handle_watch, create_internal_call, create_synthetic_wildcard_import};
use crate::words::*;

use std::collections::BTreeMap;
Expand Down Expand Up @@ -129,10 +127,7 @@ pub fn new_module(ctx: NewModuleCtx) -> Result<(ast::Module, SingleThreadedComme
module.body.push(create_named_export(expr, ctx.name));
if ctx.is_entry {
// Inject qwik internal import
module.body.push(create_synthetic_named_export(
&HANDLE_WATCH,
&BUILDER_IO_QWIK,
));
add_handle_watch(&mut module.body, true);
}
Ok((module, comments))
}
Expand Down Expand Up @@ -289,11 +284,7 @@ fn new_entry_module(hooks: &[&HookAnalysis]) -> ast::Module {
)));
}

module.body.push(create_synthetic_named_export(
&HANDLE_WATCH,
&BUILDER_IO_QWIK,
));

add_handle_watch(&mut module.body, false);
module
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export const renderHeader_zBbHWn4e8Cg = ()=>{
return <div onClick={qwik.qrl(()=>import("./renderheader_div_onclick_fv2uzal99u4")
, "renderHeader_div_onClick_fV2uzAL99u4")}/>;
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand All @@ -48,7 +50,9 @@ export const renderHeader_1_cPyr0uAhiIk = ()=>{
console.log("mount");
return render;
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down Expand Up @@ -79,7 +83,9 @@ component(qwik.qrl(()=>import("./renderheader_1_cpyr0uahiik")
import * as qwik from "@builder.io/qwik";
export const renderHeader_div_onClick_fV2uzAL99u4 = (ctx)=>console.log(ctx)
;
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export const Header_WlR3xnI6u38 = (decl1, { decl2 }, [decl3])=>{
return <div onClick={(ident11)=>ident11 + ident12
} required={false}/>;
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ export const App = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("../entry_hook
export { Header_component_Header_onClick_KjD9TCNkNxY } from "./header_component_header_onclick_kjd9tcnknxy";
export { Header_component_UVBJuFYfvDo } from "./header_component_uvbjufyfvdo";
export { App_component_wGkRHWXaqjs } from "./app_component_wgkrhwxaqjs";
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

== DIAGNOSTICS ==

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export const Header_component_J4uyIhaBNR4 = ()=>{
return <div onClick={qwik.qrl(()=>import("./header_component_div_onclick_i7ekvwh3674")
, "Header_component_div_onClick_i7ekvWH3674")}/>;
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down Expand Up @@ -50,7 +52,9 @@ export const Header = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./header_c
import * as qwik from "@builder.io/qwik";
export const Header_component_div_onClick_i7ekvWH3674 = (ctx)=>console.log(ctx)
;
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export const App_Header_component_B9F3YeqcO1w = ()=>{
return <div onClick={qwik.qrl(()=>import("./app_header_component_div_onclick_ao7ui7iw6oq")
, "App_Header_component_div_onClick_aO7uI7Iw6oQ")}/>;
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand All @@ -46,7 +48,9 @@ export { handleWatch } from "@builder.io/qwik";
import * as qwik from "@builder.io/qwik";
export const App_Header_component_div_onClick_aO7uI7Iw6oQ = (ctx)=>console.log(ctx)
;
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export const App_Header_component_B9F3YeqcO1w = ()=>{
return <div onClick={qwik.qrl(()=>import("./app_header_component_div_onclick_ao7ui7iw6oq")
, "App_Header_component_div_onClick_aO7uI7Iw6oQ")}/>;
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand All @@ -46,7 +48,9 @@ export { handleWatch } from "@builder.io/qwik";
import * as qwik from "@builder.io/qwik";
export const App_Header_component_div_onClick_aO7uI7Iw6oQ = (ctx)=>console.log(ctx)
;
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export const Header_component_J4uyIhaBNR4 = ()=>{

</>;
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down Expand Up @@ -58,7 +60,9 @@ export const Header = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./header_c
import * as qwik from "@builder.io/qwik";
export const Header_component_div_onClick_i7ekvWH3674 = (ctx)=>console.log("2")
;
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export const sym1 = $((ctx) => console.log("1"));
import * as qwik from "@builder.io/qwik";
export const sym1_aXUrPXX5Lak = (ctx)=>console.log("1")
;
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export const Header_component_J4uyIhaBNR4 = ()=>{
return <div onClick={qwik.qrl(()=>import("./header_component_div_onclick_i7ekvwh3674")
, "Header_component_div_onClick_i7ekvWH3674")}/>;
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down Expand Up @@ -61,7 +63,9 @@ import { Header } from "./test";
export const App_component_ckEPmXZlub0 = ()=>{
return <Header />;
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand All @@ -83,7 +87,9 @@ export { handleWatch } from "@builder.io/qwik";
import * as qwik from "@builder.io/qwik";
export const Header_component_div_onClick_i7ekvWH3674 = (ctx)=>console.log(ctx)
;
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export const Header_component_J4uyIhaBNR4 = ()=>{
return qwik.qrl(()=>import("./header_component_1_2b8d0oh9zwc")
, "Header_component_1_2B8d0oH9ZWc");
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand All @@ -52,7 +54,9 @@ export const Header_component_1_2B8d0oH9ZWc = (hola)=>{
const hello = hola.nothere.stuff[global];
return <Header />;
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ export const Header_WjUaUQN7Oxg = (decl1, { decl2 }, [decl3])=>{
try {} catch (decl18) {}
try {} catch ({ decl19 }) {}
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ 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}`;
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand All @@ -55,7 +57,9 @@ export const App_component_ckEPmXZlub0 = ()=>{
useStylesQrl(qwik.qrl(()=>import("./app_component_usestyles_1_xbk4w0zkwe8")
, "App_component_useStyles_1_xBK4W0ZKWe8"));
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand All @@ -77,7 +81,9 @@ export { handleWatch } from "@builder.io/qwik";
import * as qwik from "@builder.io/qwik";
import css3 from "./style.css";
export const App_component_useStyles_1_xBK4W0ZKWe8 = css3;
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export const App_component_ckEPmXZlub0 = ()=>{
return qwik.qrl(()=>import("./app_component_1_w0t0o3qmovu")
, "App_component_1_w0t0o3QMovU");
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand All @@ -70,7 +72,9 @@ export const App_component_1_w0t0o3QMovU = ()=>{
new Thing();
return /*#__PURE__*/ _jsx("div", {});
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export const App_component_useMemo_6Sc9KVki3Y0 = ()=>{
const [state] = qwik.useLexicalScope();
console.log(state.count);
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand All @@ -75,7 +77,9 @@ import * as qwik from "@builder.io/qwik";
export const Lightweight_useMemo_UIcxVTQF1a8 = ()=>{
console.log(state.count);
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down Expand Up @@ -110,7 +114,9 @@ export const App_component_ckEPmXZlub0 = (props)=>{
state
]);
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand All @@ -137,7 +143,9 @@ export const App_component_1_w0t0o3QMovU = ()=>{
children: state.count
});
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export const App = /*#__PURE__*/ componentQrl(qwik.qrl(()=>import("./app_compone

import * as qwik from "@builder.io/qwik";
export const App_component_useStyles_t35nSa5UV7U = 'hola';
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand All @@ -52,7 +54,9 @@ export const App_component_ckEPmXZlub0 = (props)=>{
return qwik.qrl(()=>import("./app_component_1_w0t0o3qmovu.tsx")
, "App_component_1_w0t0o3QMovU");
};
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand All @@ -74,7 +78,9 @@ export { handleWatch } from "@builder.io/qwik";
import * as qwik from "@builder.io/qwik";
export const App_component_1_w0t0o3QMovU = ()=><div ></div>
;
export { handleWatch } from "@builder.io/qwik";
import { handleWatch as hW } from "@builder.io/qwik";
hW.issue456 && hW.issue123();
export { hW as handleWatch };

/*
{
Expand Down

0 comments on commit 4a77611

Please sign in to comment.