-
Notifications
You must be signed in to change notification settings - Fork 3
Map and List on rest-model and realtime-rest-model replacements #141
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
Conversation
@@ -0,0 +1,3 @@ | |||
import transformer from './can-rest-model-map-short'; | |||
|
|||
export default transformer; |
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 you either add a comment explaining what is going on here or just do this in the build/transforms.json
?
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 tried this simple example and it doesn't seem to work:
import { restModel, realtimeRestModel, DefineMap, DefineList } from "can";
const M = DefineMap.extend({});
const L = DefineList.extend({});
const Mo = restModel({
Map: M,
List: L,
url: "/api/thing"
});
const M2 = restModel("/foo/bar").Map;
const L2 = restModel("/foo/bar").List;
const M3 = realtimeRestModel("/foo/bar").Map;
const L3 = realtimeRestModel("/foo/bar").List;
Not sure if it is an ordering issue. I also see some errors:
Running transform: version-6/can-rest-model/can-rest-model-map-list.
File source invalid: index.js
Error: Cannot read property 'forEach' of undefined.
0 / 1 files modified (1 errors).
Percent complete: 89%.
Time remaining: 2 seconds.
Running transform: version-6/can-rest-model/can-rest-model-map-short.
File source invalid: index.js
Error: Cannot read property 'name' of undefined.
0 / 1 files modified (1 errors).
Percent complete: 95%.
Time remaining: 2 seconds.
Running transform: version-6/can-rest-model/can-rest-model-list-short.
File source invalid: index.js
Error: Cannot read property 'name' of undefined.
0 / 1 files modified (1 errors).
Percent complete: 100%.
Time remaining: 1 seconds.
const root = j(source); | ||
|
||
root | ||
.find(j.CallExpression, { |
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 thing as the other PR with indenting.
…eading call expressions
@phillipskevin I fixed the issue, thank you for catching. |
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.
Looks good.
Fixes #137
All transformations applied to
can-rest-model
andcan-realtime-rest-model
packages.Replaces:
to:
And:
to
And:
to: