Skip to content

feat: allow pod to access to names in all ancestor scopes #284

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

Merged
merged 1 commit into from
May 7, 2023

Conversation

lihebi
Copy link
Collaborator

@lihebi lihebi commented May 7, 2023

Now a pod can access all names defined in its ancestor scopes. The following canvas shows 4 examples:

  1. [new behavior] function can be accessed in an inner scope
  2. [new behavior] global variables can be accessed anywhere
  3. exported name can be accessed in its parent scope
  4. unexported name cannot be accessed in its parent scope

Screenshot from 2023-05-06 17-27-45

Technical staff: this PR also supports ROOT in Node2Children map, and auto-build it.

@lihebi lihebi merged commit 4725a90 into codepod-io:main May 7, 2023
@@ -855,6 +855,8 @@ export const createCanvasSlice: StateCreator<MyState, [], [], CanvasSlice> = (
nodesMap.delete(change.id);
// remove from store
get().deletePod(client, { id: change.id });
// run auto-layout
get().autoForceGlobal();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR also runs auto-layout on deleting a node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

import variables from parent scope to child scope
1 participant