Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare published hydrate output with babe807 hydrate output #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions hydrate.mjs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const NAMESPACE = 'ch-ui';
const BUILD = /* ch-ui */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: false, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: true, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: false, shadowDomShim: true, slot: false, slotChildNodesFix: false, slotRelocation: true, state: true, style: false, svg: true, taskQueue: true, updatable: true, vdomAttribute: true, vdomClass: false, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: false }; const BUILD = /* ch-ui */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: false, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: false, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: true, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: false, propMutable: false, propNumber: false, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: false, shadowDomShim: true, slot: false, slotChildNodesFix: false, slotRelocation: true, state: true, style: false, svg: true, taskQueue: true, updatable: true, vdomAttribute: true, vdomClass: false, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: false };


/* /*
Stencil Hydrate Platform v4.18.3-dev.1718911114.babe807 | MIT Licensed | https://stenciljs.com Stencil Hydrate Platform v4.19.0 | MIT Licensed | https://stenciljs.com
*/ */
var __defProp = Object.defineProperty; var __defProp = Object.defineProperty;
var __export = (target, all) => { var __export = (target, all) => {
Expand Down Expand Up @@ -1245,10 +1245,10 @@ var setValue = (ref, propName, newVal, cmpMeta) => {


// src/runtime/proxy-component.ts // src/runtime/proxy-component.ts
var proxyComponent = (Cstr, cmpMeta, flags) => { var proxyComponent = (Cstr, cmpMeta, flags) => {
var _a; var _a, _b;
const prototype = Cstr.prototype; const prototype = Cstr.prototype;
if (cmpMeta.$members$) { if (cmpMeta.$members$ || BUILD.watchCallback ) {
const members = Object.entries(cmpMeta.$members$); const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
members.map(([memberName, [memberFlags]]) => { members.map(([memberName, [memberFlags]]) => {
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) { if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
Object.defineProperty(prototype, memberName, { Object.defineProperty(prototype, memberName, {
Expand Down Expand Up @@ -1293,7 +1293,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
}; };
Cstr.observedAttributes = Array.from( Cstr.observedAttributes = Array.from(
/* @__PURE__ */ new Set([ /* @__PURE__ */ new Set([
...Object.keys((_a = cmpMeta.$watchers$) != null ? _a : {}), ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => { ...members.filter(([_, m]) => m[0] & 15 /* HasAttribute */).map(([propName, m]) => {
const attrName = m[1] || propName; const attrName = m[1] || propName;
attrNameToPropName.set(attrName, propName); attrNameToPropName.set(attrName, propName);
Expand Down Expand Up @@ -1491,14 +1491,16 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
} }
}; };
var parseVNodeAnnotations = (doc2, node, docData, orgLocationNodes) => { var parseVNodeAnnotations = (doc2, node, docData, orgLocationNodes) => {
var _a;
if (node == null) { if (node == null) {
return; return;
} }
if (node["s-nr"] != null) { if (node["s-nr"] != null) {
orgLocationNodes.push(node); orgLocationNodes.push(node);
} }
if (node.nodeType === 1 /* ElementNode */) { if (node.nodeType === 1 /* ElementNode */) {
node.childNodes.forEach((childNode) => { const childNodes = [...Array.from(node.childNodes), ...Array.from(((_a = node.shadowRoot) == null ? void 0 : _a.childNodes) || [])];
childNodes.forEach((childNode) => {
const hostRef = getHostRef(childNode); const hostRef = getHostRef(childNode);
if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) { if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {
const cmpData = { const cmpData = {
Expand Down Expand Up @@ -1769,6 +1771,8 @@ async function hydrateComponent(win2, results, tagName, elm, waitingElements) {
const cmpMeta = Cstr.cmpMeta; const cmpMeta = Cstr.cmpMeta;
if (cmpMeta != null) { if (cmpMeta != null) {
waitingElements.add(elm); waitingElements.add(elm);
const hostRef = getHostRef(this);
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
try { try {
connectedCallback(elm); connectedCallback(elm);
await elm.componentOnReady(); await elm.componentOnReady();
Expand Down Expand Up @@ -1939,7 +1943,7 @@ var registerComponents = (Cstrs) => {
var win = window; var win = window;
var doc = win.document; var doc = win.document;
var writeTask = (cb) => { var writeTask = (cb) => {
process.nextTick(() => { nextTick(() => {
try { try {
cb(); cb();
} catch (e) { } catch (e) {
Expand Down Expand Up @@ -1980,7 +1984,6 @@ var registerHost = (elm, cmpMeta) => {
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r); hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
elm["s-p"] = []; elm["s-p"] = [];
elm["s-rc"] = []; elm["s-rc"] = [];
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
return hostRefs.set(elm, hostRef); return hostRefs.set(elm, hostRef);
}; };


Expand Down Expand Up @@ -2304,7 +2307,7 @@ exports.hydrateApp = hydrateApp;
} }


/* /*
Stencil Hydrate Runner v4.18.3-dev.1718911114.babe807 | MIT Licensed | https://stenciljs.com Stencil Hydrate Runner v4.19.0 | MIT Licensed | https://stenciljs.com
*/ */
var __defProp = Object.defineProperty; var __defProp = Object.defineProperty;
var __export = (target, all) => { var __export = (target, all) => {
Expand Down