example
example copied to clipboard
Upgrade to Marblejs 3.0
@JozefFlakus It would be great to upgrade this example project to later version of framework according to https://docs.marblejs.com/other/migration-guides/version-2
@VitalyVrublevskiy I'm working on new example project which will cover all important aspects of the framework. IMO the current one is too fuzzy. Please be patient :)
In order to try marble.js I created a non working example using version 3. Perhaps @JozefFlakus I could get a bit of help. I'd like to create an event with payload implementing the EventCreatorWithPayload. As you may see in the linked effect: https://github.com/virgiliolino/marblejs-math/blob/main/src/shape/effects/createShape.effect.ts and in https://github.com/virgiliolino/marblejs-math/blob/main/src/shape/effects/postShape.effect.ts In both the compiler expects me to send an EventCreatorWithoutPayload. what should I change in order to pass a payload to the event? Many thanks, Virgilio
I probably spot the problem - tsconfig
. The issue looked suspicious then as a last test I copy and pasted tsconfig from my different project. Right now I'm not sure which configuration element breaks the type correct event
builder type inference.
Try this:
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"pretty": true,
"strict": true,
"target": "es6",
"outDir": "./dist/",
"rootDir": "./src",
"sourceMap": true,
"typeRoots": [
"node_modules/@types"
],
"lib": [
"ES2020"
]
},
"inputs": [
"src"
]
}
instead of:
{
"compilerOptions": {
"lib": [
"es5",
"es6"
],
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "./build",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true
}
}
Many thanks it looks like it worked.