Skip to content

Conversation

@zfi
Copy link
Contributor

@zfi zfi commented May 21, 2018

Currently, whenever a project is loaded, the server evaluates the project code to identify and possibly replace deprecated block constructs. It does this regardless of how many times previously this was done.

This patch does the following to address the unnecessary parsing on subsequent project load operations.

First, it establishes a block code library version number that identifies a known state for the blocks at any given time. This number is incremented whenever there are breaking changes introduced into the block library.

Second, it adds code to compare the project code block library version with the existing library version. If they do not match, the server will send the project code through the deprecated block filter before passing the code to the client browser. This will effectively prevent code that has already been filtered from going through the process again until the next breaking change in the block library.

Finally, the server updates the code library version in the project record when the project is saved from a previous code library version. There is an assumption made that the code returned to the server is already filtered and compatible with the current code block library version.

zfi added 2 commits May 21, 2018 16:25
…epricated blocks only when there are breaking changes in blockly library updates.
@zfi zfi merged commit 72e77a3 into parallaxinc:0.100 May 22, 2018
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.

1 participant