Page 1 of 2
Manage game page new features / new js minifier / new css minifier
Posted: 10 July 2020, 18:37
by Een
Hi developers!
Good news, some new features have been added on the "manage game" page. We'll probably send an email to developers in a while, but until then:
- We are using a new javascript minifier (terser) allowing for modern javascript syntax. You are not limited to ES3 anymore.
- We are using a new css minifier (cssnano) to lift some limitations of the previous one. Your var() will now be preserved.
- You can generate a minified version of your js to test it on the studio (and revert to the original)
- You can generate a minified version of your css to test it on the studio (and revert to the original)
- You can generate some dummy translations («text» for text) to check that all the strings in your game are translatable (and revert to the original)
- The manage game page has been slightly reorganized.
Hope it helps, please let us know if you run into any old or new issue with the new javascript/css minifiers.
Re: Manage game page new features / new js minifier
Posted: 10 July 2020, 19:00
by Tisaac
Een wrote: ↑10 July 2020, 18:37
Hi developers!
Good news, some new features have been added on the "manage game" page. We'll probably send an email to developers in a while, but until then:
- We are using a new javascript minifier (terser) allowing for modern javascript syntax. You are not limited to ES3 anymore.
So great !!! I am gonna put arrow functions everywhere !!
Thanks !!
Re: Manage game page new features / new js minifier
Posted: 10 July 2020, 19:52
by docthib
Nice ! Great improvement for the platform !
Thanks

Re: Manage game page new features / new js minifier
Posted: 10 July 2020, 22:40
by Draasill
These are wonderful news !
Thank you !
Re: Manage game page new features / new js minifier
Posted: 10 July 2020, 23:14
by JumpMaybe
Great update Een, thank you!
Re: Manage game page new features / new js minifier
Posted: 11 July 2020, 00:07
by hersh
Nice. Will it resolve issues like this?
https://boardgamearena.com/bug?id=20548
Not familiar with terser but is it just minifying or doing something more ? To resolve the above i had to change some js to not use calls like object.values(...)
https://caniuse.com/#search=Object.values
Re: Manage game page new features / new js minifier
Posted: 11 July 2020, 08:54
by Een
It should do just minifying (options used are --compress toplevel,sequences=false --mangle).
This issue looked to be browser related, so it would probably not change anything for this case.
The useful thing is that now, you can see exactly what it does directly on the studio by switching to the minified version and looking at the file, so you should be able to pinpoint easily any issue related to the minification itself (it didn't happen often, but it did in a handful of cases).
Re: Manage game page new features / new js minifier
Posted: 11 July 2020, 19:51
by Brainchild
Een wrote: ↑10 July 2020, 18:37
- We are using a new javascript minifier (terser) allowing for modern javascript syntax. You are not limited to ES3 anymore.
Of course you do this right after I've modified my whole JS file to work with ES3!
Just kidding, this is wonderful news. I'm going to take great pleasure in changing all my
vars back to
let!
Een wrote:
- You can generate some dummy translations («text» for text) to check that all the strings in your game are translatable (and revert to the original)
When I tried this feature it mostly worked, but some strings were not surrounded by « » despite having clienttranslate() on them.
Re: Manage game page new features / new js minifier
Posted: 11 July 2020, 20:30
by Een
Brainchild wrote: ↑11 July 2020, 19:51
Een wrote: ↑10 July 2020, 18:37
- We are using a new javascript minifier (terser) allowing for modern javascript syntax. You are not limited to ES3 anymore.
Of course you do this right after I've modified my whole JS file to work with ES3!
Just kidding, this is wonderful news. I'm going to take great pleasure in changing all my
vars back to
let!
I know, I know... I did that to a lot of devs actually

But I had this in mind for months, and didn't really know when I would find the time to get to it and how long it would take, so until then... pointing to the bridge already built
Brainchild wrote: ↑11 July 2020, 19:51
Een wrote:
- You can generate some dummy translations («text» for text) to check that all the strings in your game are translatable (and revert to the original)
When I tried this feature it mostly worked, but some strings were not surrounded by « » despite having clienttranslate() on them.
Well, that's exactly why this feature has been built. Now you can see if you have missed something
Having clienttranslate() in the php pushes the string in the translation system, but you need _() applied on that string on the js side for it to be actually translated (_() is automatically applied for a notification message, but you'll need to properly pass the "i18n" parameter if you use substitution in a notification message with translated strings).
Re: Manage game page new features / new js minifier
Posted: 11 July 2020, 22:21
by Brainchild
Een wrote: ↑11 July 2020, 20:30
Well, that's exactly why this feature has been built. Now you can see if you have missed something
Having clienttranslate() in the php pushes the string in the translation system, but you need _() applied on that string on the js side for it to be actually translated (_() is automatically applied for a notification message, but you'll need to properly pass the "i18n" parameter if you use substitution in a notification message with translated strings).
I find the translation system to be the most confusing aspect of working with BGA framework, so this tool will definitely help. I'll take a closer look and see if I'm missing _() on the strings in question.