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

Alterations to object by label observers #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kriskowal
Copy link
Member

  1. Removes support for annotating the syntax tree with the last known
    object to be observed for a label on that node. This is necessary for
    syntax tree memoization. This also breaks a few Montage test cases that
    may or may not be important: serialization-spec localizations unit
    serializer serializes default message binding, and serializes data
    binding, as well as bindings-spec should serialize a binding that
    references external objects.
  2. Adds support for observeObjectByLabel that has been useful in
    experiments where the object in scope may change in response to panel
    changes in a substitution.
  3. Removes the alias getComponentByLabel because, in the context of
    Montage serialization, labels may be applied to any value.

1. Removes support for annotating the syntax tree with the last known
object to be observed for a label on that node. This is necessary for
syntax tree memoization. This also breaks a few Montage test cases that
may or may not be important: `serialization-spec` localizations unit
serializer serializes default message binding, and serializes data
binding, as well as `bindings-spec` should serialize a binding that
references external objects.
2. Adds support for `observeObjectByLabel` that has been useful in
experiments where the object in scope may change in response to panel
changes in a substitution.
3. Removes the alias `getComponentByLabel` because, in the context of
Montage serialization, labels may be applied to any value.
var components = scope.components;
var method = components.getObjectByLabel || components.getComponentByLabel;
var component = method.call(components, label);
syntax.component = component;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just being curious, where were we using this information?

Copy link
Member Author

Choose a reason for hiding this comment

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

stringify is/was rigged to use components.getLabelForObject or components.getObjectLabel on syntax.component to consult a deserializer to rewrite the label based on which serialization it was being used in. This, if you recall, was necessary for making round trips through the serialization system.

Copy link
Member Author

Choose a reason for hiding this comment

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

@aadsm We should figure out whether we’re still using this feature.

@kriskowal
Copy link
Member Author

I will punt this issue to the v2 branch and merge myself. I’ll make a note in the change log to make it less mysterious why things break if we’re still depending on syntax annotation at run-time in MontageJS.

@kriskowal kriskowal self-assigned this May 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants