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

Support circular referenced code. #584

Merged
merged 4 commits into from Oct 6, 2020

Conversation

seanparsons
Copy link
Contributor

Fixes #568

Problem:
Previously we had protection against circular references on the canvas because they could not be handled there.

Fix:
The canvas as it is currently actually supports circular references, so I removed all the protection functionality to allow those to go through.

Commit Details:

  • Fixes Circular dependencies aren't supported in the Canvas #568.
  • Removed dependencyOrdering from UiJsxCanvasProps.
  • Deleted reorderTopLevelElements.
  • Deleted elementDependencyOrdering.
  • Removed dependencyOrdering from ParseSuccess.
  • Updated existing tests and added another for confirming that
    circular referenced components will render in the canvas.

- Fixes #568.
- Removed `dependencyOrdering` from `UiJsxCanvasProps`.
- Deleted `reorderTopLevelElements`.
- Deleted `elementDependencyOrdering`.
- Removed `dependencyOrdering` from `ParseSuccess`.
- Updated existing tests and added another for confirming that
  circular referenced components will render in the canvas.
Copy link
Contributor

@Rheeseyb Rheeseyb left a comment

Choose a reason for hiding this comment

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

This is my favourite type of PR

Copy link
Contributor

@balazsbajorics balazsbajorics left a comment

Choose a reason for hiding this comment

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

woohoo!

- `ParseSuccess` now includes `combinedTopLevelArbitraryBlock` which holds
  a merged block of all the arbitrary code at the top level of the file.
- Canvas component now executes the combined top level arbitrary block
  instead of the individual ones.
- Parser now produces the value for `combinedTopLevelArbitraryBlock` by
  accumulating all the arbitrary nodes collated across the top level of
  a file.
- Tests updated and added to to cover the new functionality.
@seanparsons seanparsons merged commit 7c45c66 into master Oct 6, 2020
@seanparsons seanparsons deleted the feature/circular-reference-support branch October 6, 2020 13:00
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.

Circular dependencies aren't supported in the Canvas
4 participants