Manage game page new features / new js minifier / new css minifier

Game development with Board Game Arena Studio
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Manage game page new features / new js minifier / new css minifier

Post 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.
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: Manage game page new features / new js minifier

Post 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 !!
User avatar
docthib
Posts: 73
Joined: 10 August 2015, 14:05

Re: Manage game page new features / new js minifier

Post by docthib »

Nice ! Great improvement for the platform !
Thanks :)
User avatar
Draasill
Posts: 197
Joined: 26 April 2020, 00:00

Re: Manage game page new features / new js minifier

Post by Draasill »

These are wonderful news !

Thank you !
User avatar
JumpMaybe
Posts: 41
Joined: 20 June 2019, 14:25

Re: Manage game page new features / new js minifier

Post by JumpMaybe »

Great update Een, thank you!
User avatar
hersh
Posts: 76
Joined: 12 December 2013, 23:49

Re: Manage game page new features / new js minifier

Post 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
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Manage game page new features / new js minifier

Post by Een »

hersh wrote: 11 July 2020, 00:07 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
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).
User avatar
Brainchild
Posts: 71
Joined: 31 January 2014, 19:42

Re: Manage game page new features / new js minifier

Post 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! :x :x :x

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.
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Manage game page new features / new js minifier

Post 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! :x :x :x

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 :mrgreen:
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 :D

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).
User avatar
Brainchild
Posts: 71
Joined: 31 January 2014, 19:42

Re: Manage game page new features / new js minifier

Post 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 :D

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.
Post Reply

Return to “Developers”