-
Notifications
You must be signed in to change notification settings - Fork 214
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
Montage data converters#1 #2010
Montage data converters#1 #2010
Conversation
it is deserialized as the root of a serilization
in expression data mappings
- adds a future-proof way to get a type's prototype & constructor
it is deserialized as the root of a serilization
in expression data mappings
- adds a future-proof way to get a type's prototype & constructor
to undefimed revertExpression
to asynchronously retrieve a fully mapped object
…ge into montage-data-converters#1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be linted.
Looks like some commits got added twice, this PR should be rebased to remove duplicates.
I'll let @tejaede review the data/
related changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we find a more descriptive name than than ExpressionDataMappingConverter
? The name says the converter can be used in ExpressionDataMapping
objects, but that is true for any object that implements the converter interface so it doesn't tell us much.
The class and its subclasses do something very specific -- use rawData of type Foo
to fetch (or create) cooked objects of type Bar
where Bar
is a level 1 montage-data type -- so we should find a name that reflects that, IMO.
Some options:
RawValueToObjectConverter
-- The obvious parent class name for the two subclasses (RawEmbeddedValueToObjectConverter
andRawPropertyValueToObjectConverter
), both of which are well named, IMO.ForeignKeyConverter
-- the object (and its subclasses) are responsible for most, if not all, foreign keys so this would be apt as well. This would break the association of parent class name to child class name that we would get with # 1.RawValueToForeignKeyConverter
-- combination of # 1 and # 2.
Agreed, how about parent: RawValueToObjectConverter |
|
If they can't be loaded from the app package, they will be retried under mr (npm 2 / legacy bundling support).
I suspect this code only exists for historical reasons, but it seems totally unnecessary, as bluebird will already be cached in the registry and will not be loaded twice. The hardcoded bluebird path causes an extra 404 when loading the app with npm 3+.
it is deserialized as the root of a serilization
in expression data mappings
- adds a future-proof way to get a type's prototype & constructor
This merged the latest in #master to get sync capabilities in the deserializer, and it needs montagejs/mr#146 to work, which is itself additional to the npm3 work, so both PR go hand in hand |
montage tests pass, also tested with a montage data improved version of shop-demo (which wasn't working without these changes as it's the first use of a main.datareel folder that contains all data related assets) as well as Popcorn master. Please review again. |
Some test fails as it needs montagejs/mr#146, I didn't change package.json, so it still points to "18.0.0-rc1" where montagejs/mr#146 needs to be merged on |
@@ -60,6 +60,9 @@ var ModuleObjectDescriptor = exports.ModuleObjectDescriptor = ObjectDescriptor.s | |||
this.super(serializer); | |||
this._setPropertyWithDefaults(serializer, "module", this.module); | |||
this._setPropertyWithDefaults(serializer, "exportName", this.exportName); | |||
if(this.object) { | |||
this._setPropertyWithDefaults(serializer, "object", this.object); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marchant Is there a spec for serializing/deserializing ModuleObjectDescriptor#object
?
An error with
I am unable to write to marchant/montagejs so I pushed fixes to my own repo for these issues for your review: tejaede@9829912 The fixes are:
cc: @marchant |
…s objectDescriptorModule as a dependency. This could be made more general but slower for all {“%”: “module_id”} construction in a serialization
Makes sure all child services are added and only once.
Adds ability to deserialize synchronously objetc descriptor references: - in expression-data-mapping.js - in raw-value-to-object-converter.js
…ge into montage-data-converters#1
… fix build no running
There's a problem running karma on travis, we need to fix this independently of this PR, merging. |
To merge after /feature/npm3