Skip to content

Commit

Permalink
fix: implicit split component client rerender
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Jan 16, 2025
1 parent e6ffdbe commit 631ad47
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/quick-onions-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"marko": patch
---

Fix issue where implicit split components (those with no class/component that have event handlers) were not getting the client side render apis.
3 changes: 2 additions & 1 deletion packages/runtime-class/src/translator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const analyze = {
) {
meta.component = file.opts.filename;
} else if (meta.hasStringEventHandlers) {
meta.implicitSplitComponent = true;
meta.component = componentFiles.componentBrowserFile =
"marko/src/runtime/helpers/empty-component.js";
meta.hasComponentBrowser = true;
Expand Down Expand Up @@ -388,7 +389,7 @@ export const translate = {
componentTypeIdentifier,
t.arrowFunctionExpression(
[],
componentBrowserFile
componentBrowserFile && !meta.implicitSplitComponent
? importDefault(
file,
resolveRelativePath(file, componentBrowserFile),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import _customTag from "./components/custom-tag.marko";
import _marko_tag from "marko/src/runtime/helpers/render-tag.js";
import _marko_renderer from "marko/src/runtime/components/renderer.js";
import { r as _marko_registerComponent } from "marko/src/runtime/components/registry.js";
import _marko_split_component from "marko/src/runtime/helpers/empty-component.js";
_marko_registerComponent(_marko_componentType, () => _marko_split_component);
_marko_registerComponent(_marko_componentType, () => _marko_template);
const _marko_component = {};
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state, $global) {
out.e("div", null, "0", _component, 0, 0, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import _customTag from "./components/custom-tag.marko";
import _marko_tag from "marko/dist/runtime/helpers/render-tag.js";
import _marko_renderer from "marko/dist/runtime/components/renderer.js";
import { r as _marko_registerComponent } from "marko/dist/runtime/components/registry.js";
import _marko_split_component from "marko/dist/runtime/helpers/empty-component.js";
_marko_registerComponent(_marko_componentType, () => _marko_split_component);
_marko_registerComponent(_marko_componentType, () => _marko_template);
const _marko_component = {};
_marko_template._ = _marko_renderer(function (input, out, _componentDef, _component, state, $global) {
out.e("div", null, "0", _component, 0, 0, {
Expand Down

0 comments on commit 631ad47

Please sign in to comment.