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

Make Expressions fully deserializable #6255

Open
anandthakker opened this issue Mar 1, 2018 · 3 comments
Open

Make Expressions fully deserializable #6255

anandthakker opened this issue Mar 1, 2018 · 3 comments

Comments

@anandthakker
Copy link
Contributor

Currently, CompoundExpression#_evaluate doesn't survive serialization/deserialization via our web worker transfer scheme:

register('CompoundExpression', CompoundExpression, {omit: ['_evaluate']});

This was fine until now, because we only evaluate a {Source,Composite}Binder's expression on the worker side, during populatePaintArray

const value = this.expression.evaluate({zoom: 0}, feature);

For #6020, however, we'll need to evaluate again on the main thread when making updates, and so we should refactor CompoundExpression so that it can be fully rehydrated on the main thread.

@anandthakker
Copy link
Contributor Author

cc @asheemmamoowala

@jfirebaugh
Copy link
Contributor

It would be great if we could use this as an opportunity to refactor/untangle the following types:

  • Expression
  • StyleExpression
  • StyleExpressionWithErrorHandling
  • ZoomConstantExpression
  • ZoomDependentExpression
  • ConstantExpression
  • SourceExpression
  • CameraExpression
  • CompositeExpression
  • StylePropertyExpression
  • StylePropertyFunction

That seems like more types than is ideal.

@anandthakker
Copy link
Contributor Author

The performance considerations in #6367 suggest that we might want to solve this another way.

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

No branches or pull requests

3 participants