@kithinji/orca 1.0.23 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1066,7 +1066,18 @@ var kithinjiorca = (() => {
1066
1066
  }
1067
1067
  }
1068
1068
  const instance = componentInjector.resolve(ComponentClass);
1069
- instance.props = vnode.props || {};
1069
+ const mergedProps = Object.create(
1070
+ Object.getPrototypeOf(instance.props || {})
1071
+ );
1072
+ Object.defineProperties(
1073
+ mergedProps,
1074
+ Object.getOwnPropertyDescriptors(instance.props)
1075
+ );
1076
+ Object.defineProperties(
1077
+ mergedProps,
1078
+ Object.getOwnPropertyDescriptors(vnode.props || {})
1079
+ );
1080
+ instance.props = mergedProps;
1070
1081
  const childVNode = instance.build();
1071
1082
  if (childVNode instanceof Promise) {
1072
1083
  return this.createPendingReference(vnode, childVNode, componentInjector);
@@ -1993,6 +2004,8 @@ var kithinjiorca = (() => {
1993
2004
  constructor() {
1994
2005
  this.__cleanup = [];
1995
2006
  }
2007
+ onInit() {
2008
+ }
1996
2009
  onDestroy() {
1997
2010
  this.__cleanup.forEach((cb) => cb());
1998
2011
  }
@@ -3058,7 +3071,11 @@ var kithinjiorca = (() => {
3058
3071
  if (routePattern) {
3059
3072
  builtRoute = buildRouteFromProps(routePattern, props, ComponentClass.name);
3060
3073
  }
3061
- instance.props = props;
3074
+ const mergedProps = Object.create(Object.getPrototypeOf(instance.props || {}));
3075
+ Object.defineProperties(mergedProps, Object.getOwnPropertyDescriptors(instance.props));
3076
+ Object.defineProperties(mergedProps, Object.getOwnPropertyDescriptors(props));
3077
+ instance.props = mergedProps;
3078
+ instance.onInit?.();
3062
3079
  const root = instance.build();
3063
3080
  if (!(root instanceof Node)) {
3064
3081
  throw new Error(`Component ${ComponentClass.name}.build() must return a DOM Node`);