@kithinji/orca 1.0.23 → 1.0.24

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,16 @@ var kithinjiorca = (() => {
1066
1066
  }
1067
1067
  }
1068
1068
  const instance = componentInjector.resolve(ComponentClass);
1069
- instance.props = vnode.props || {};
1069
+ const mergedProps = Object.create(Object.getPrototypeOf(instance.props));
1070
+ Object.defineProperties(
1071
+ mergedProps,
1072
+ Object.getOwnPropertyDescriptors(instance.props)
1073
+ );
1074
+ Object.defineProperties(
1075
+ mergedProps,
1076
+ Object.getOwnPropertyDescriptors(vnode.props || {})
1077
+ );
1078
+ instance.props = mergedProps;
1070
1079
  const childVNode = instance.build();
1071
1080
  if (childVNode instanceof Promise) {
1072
1081
  return this.createPendingReference(vnode, childVNode, componentInjector);
@@ -1993,6 +2002,8 @@ var kithinjiorca = (() => {
1993
2002
  constructor() {
1994
2003
  this.__cleanup = [];
1995
2004
  }
2005
+ onInit() {
2006
+ }
1996
2007
  onDestroy() {
1997
2008
  this.__cleanup.forEach((cb) => cb());
1998
2009
  }
@@ -3058,7 +3069,11 @@ var kithinjiorca = (() => {
3058
3069
  if (routePattern) {
3059
3070
  builtRoute = buildRouteFromProps(routePattern, props, ComponentClass.name);
3060
3071
  }
3061
- instance.props = props;
3072
+ const mergedProps = Object.create(Object.getPrototypeOf(instance.props));
3073
+ Object.defineProperties(mergedProps, Object.getOwnPropertyDescriptors(instance.props));
3074
+ Object.defineProperties(mergedProps, Object.getOwnPropertyDescriptors(props));
3075
+ instance.props = mergedProps;
3076
+ instance.onInit?.();
3062
3077
  const root = instance.build();
3063
3078
  if (!(root instanceof Node)) {
3064
3079
  throw new Error(`Component ${ComponentClass.name}.build() must return a DOM Node`);