-
Notifications
You must be signed in to change notification settings - Fork 31
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
[REFACTOR] Remove json2typescript dependency #443
Conversation
6a41645
to
0886bc8
Compare
1a0c839
to
6136bfb
Compare
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.
6136bfb
to
aa28a3e
Compare
-> Documentation updated |
6274cba
to
c552e36
Compare
Notice that removing json2typescript decreases the size of our demo js file: from |
@@ -152,7 +152,7 @@ function executeEventCommonTests( | |||
}); | |||
|
|||
it(`should NOT convert, when there are several '${eventDefinitionKind}EventDefinition' in the same element${specificTitle}, ${titleForEventDefinitionIsAttributeOf}`, () => { | |||
const eventDefinition = [{}, {}]; | |||
const eventDefinition = ['', {}]; |
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.
Normally, it was in the previous PR, but I think there was a problem in the rebase 😕
@@ -140,7 +140,7 @@ export function addEventDefinitionsOnDefinition(jsonModel: BpmnJsonModel, buildP | |||
const eventDefinition = buildParameter.eventDefinition ? buildParameter.eventDefinition : { id: 'event_definition_id' }; | |||
addEventDefinitions(jsonModel.definitions, { ...buildParameter, eventDefinition }); | |||
if (Array.isArray(eventDefinition)) { | |||
event.eventDefinitionRef = eventDefinition.map(eventDefinition => eventDefinition.id); | |||
event.eventDefinitionRef = eventDefinition.map(eventDefinition => (typeof eventDefinition === 'string' ? eventDefinition : eventDefinition.id)); |
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.
Same as previous comment
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.
Some questions, otherwise looks good
if (waypoints) { | ||
return ensureIsArray(waypoints).map(waypoint => new Waypoint(waypoint.x, waypoint.y)); | ||
} | ||
return ensureIsArray(waypoints).map(waypoint => new Waypoint(waypoint.x, waypoint.y)); |
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.
👍 for the check removal
@@ -68,10 +66,9 @@ interface EventDefinition { | |||
counter: number; | |||
} | |||
|
|||
@JsonConverter | |||
export default class ProcessConverter extends AbstractConverter<Process> { | |||
export default class ProcessConverter extends AbstractConverter<void> { |
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.
❓ I thought that we would have been able to remove global 'converted' arrays and encapsulate them in a dedicated processing short life instance to avoid any side effect/concurrent accesses?
Is this plan in another PR?
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.
I didn't think about that.
I don't really see how to do that.
If you want, do it. Or we can do it in another PR. As you wish ^^
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.
so in another PR, later 😺
Closes #383