webpack + babel support
See original GitHub issueIssue Description
Trying to implement the new schema introduced by v0.10 I was stuck on error: SchemaSerializer error. See: https://docs.colyseus.io/migrating/0.10/#new-default-serializer
.
The thing is I was using the new schema so I started debugging.
It turns out I was missing a room decorator: @serialize(SchemaSerializer)
which isn’t mentioned anywhere in docs that you have to use.
The only context this decorator is mentioned in is with fossil serializer.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
babel-loader - webpack
Webpack supports bundling multiple targets. For cases where you may want different Babel configurations for each target (like web and node ), this...
Read more >How to Webpack 5 with Babel - Setup Tutorial
A step by step tutorial on how to integrate Babel into Webpack to access powerful JavaScript features (ES6, ES7, ES8, ES9) from the...
Read more >Using Babel and Webpack - ECMAScript 6 Tutorial
Open a command prompt, and navigate ( cd ) to the es6-tutorial-data directory. Type the following command to install the Babel and Webpack...
Read more >Why and How to Use Webpack and Babel with Vanilla JS
Advantages of Using Webpack and Babel with Vanilla JS. Removes unused and unnecessary assets from the code, making it cleaner. Makes the code ......
Read more >BabelJS - Working with Babel and Webpack - Tutorialspoint
BabelJS - Working with Babel and Webpack, Webpack is a module bundler which packs all modules with dependencies – js, styles, images, etc....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@endel The changes to the config in https://github.com/endel/coly-test/commit/c45d9d1ce6ce16b7a5db7b16f4f88ac6c599ce8e do allow the project to be compiled, room to be created and clients to join, however, state updates are not sent to client.
When I compile the same project with
tsc
, the updates start working.I’ve been playing around with this today, and I’ve managed to get rid of the
SchemaSerializer error
using this configuration: https://github.com/endel/coly-test/commit/c45d9d1ce6ce16b7a5db7b16f4f88ac6c599ce8eThe problem is deeper than it seems, though. Babel currently cannot play nicely with TypeScript’s (“legacy”) decorators, here are some relevant issues on their issue tracker:
I believe the root of this issue is because of the
initializerDefineProperty_default
calls generated by Babel, here:Unfortunately I don’t know how high is for the Babel team to fix this.