@viewfly/core 0.0.1-alpha.2 → 0.0.1-alpha.3

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.
@@ -230,7 +230,7 @@ class Component extends ReflectiveInjector {
230
230
  }
231
231
  init() {
232
232
  const self = this;
233
- const props = new Proxy({}, {
233
+ const props = new Proxy(this.config || {}, {
234
234
  get(_, key) {
235
235
  if (self.config) {
236
236
  return self.config[key];
@@ -568,7 +568,7 @@ function inject(token, notFoundValue, flags) {
568
568
  */
569
569
  class RootComponent extends Component {
570
570
  constructor(factory) {
571
- super(new NullInjector(), factory, new Props(null));
571
+ super(new NullInjector(), factory, null);
572
572
  this.changeEmitter = new Subject();
573
573
  }
574
574
  markAsChanged() {
@@ -905,7 +905,9 @@ let Renderer = class Renderer {
905
905
  if (isChanged) {
906
906
  diffAtom.jsxNode.invokePropsChangedHooks(start.jsxNode.config);
907
907
  }
908
+ const newProps = start.jsxNode.props;
908
909
  start.jsxNode = diffAtom.jsxNode;
910
+ start.jsxNode.props = newProps;
909
911
  const { render } = this.componentAtomCaches.get(start.jsxNode);
910
912
  const template = render();
911
913
  if (template) {
package/bundles/index.js CHANGED
@@ -231,7 +231,7 @@ class Component extends di.ReflectiveInjector {
231
231
  }
232
232
  init() {
233
233
  const self = this;
234
- const props = new Proxy({}, {
234
+ const props = new Proxy(this.config || {}, {
235
235
  get(_, key) {
236
236
  if (self.config) {
237
237
  return self.config[key];
@@ -569,7 +569,7 @@ function inject(token, notFoundValue, flags) {
569
569
  */
570
570
  class RootComponent extends Component {
571
571
  constructor(factory) {
572
- super(new di.NullInjector(), factory, new Props(null));
572
+ super(new di.NullInjector(), factory, null);
573
573
  this.changeEmitter = new stream.Subject();
574
574
  }
575
575
  markAsChanged() {
@@ -906,7 +906,9 @@ exports.Renderer = class Renderer {
906
906
  if (isChanged) {
907
907
  diffAtom.jsxNode.invokePropsChangedHooks(start.jsxNode.config);
908
908
  }
909
+ const newProps = start.jsxNode.props;
909
910
  start.jsxNode = diffAtom.jsxNode;
911
+ start.jsxNode.props = newProps;
910
912
  const { render } = this.componentAtomCaches.get(start.jsxNode);
911
913
  const template = render();
912
914
  if (template) {
@@ -6,7 +6,7 @@ export declare class JSXComponent {
6
6
  }
7
7
  export type JSXTemplate = JSXElement | JSXComponent | null | void;
8
8
  export interface ComponentSetup {
9
- (props: JSXProps<any>): () => JSXTemplate;
9
+ (props?: JSXProps<any>): () => JSXTemplate;
10
10
  }
11
11
  /**
12
12
  * Viewfly 组件管理类,用于管理组件的生命周期,上下文等
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/core",
3
- "version": "0.0.1-alpha.2",
3
+ "version": "0.0.1-alpha.3",
4
4
  "description": "Viewfly is a simple and easy-to-use JavaScript framework with an intuitive development experience.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -36,5 +36,6 @@
36
36
  },
37
37
  "bugs": {
38
38
  "url": "https://github.com/viewfly/viewfly.git/issues"
39
- }
39
+ },
40
+ "gitHead": "e0795c315c3b3e1df2e3d2d9f823843b91838ff6"
40
41
  }