00:00
00:00
Newgrounds Background Image Theme

mangoneNG just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Faulty comment stripping in js file

491 Views | 4 Replies
New Topic Respond to this Topic

Newgrounds seems to strip comments from javascript source files when uploading HTML5 games.

However, very long comments seem to be only partially stripped, resulting in an invalid .js file and the malfunction of the uploaded game.

This is a minimized example of this faulty behavior I've uploaded: http://www.newgrounds.com/projects/games/1120353/preview

Here is the .zip file I uploaded: https://www.dropbox.com/s/vmwnp02zz8ye4e7/NGBug.zip?dl=0 It consists only of two files: index.html : https://paste.ee/p/bLoni and script.js : https://paste.ee/p/7DCkN

When displayed locally in a browser, this should display a white Hello World text (white to make it visible on NG's black background). However, as you can see, this fails to work when uploaded on Newgrounds, because Newgrounds only partially strips the very long comment in the beginning, producing the following incorrect and malfunctioning .js file: https://paste.ee/p/cSZF7

This is an issue in practice as well, because RPG Maker MV requires some meta-info in the comments of the source files of Javascript third-party plugins. Some plugins, like Yanfly's Credits Page plugin http://yanfly.moe/2015/12/24/yep-49-credits-page/ , legitimately need to store a lot of meta-info in the comments. This is an inconvenience for RPGMakerMV users, since they need to manually modify these plugins so that they no longer get invalidated by NG formatters. Fixing the comment stripper so that it always strips the whole comment and never only parts of it would be convenient.

Response to Faulty comment stripping in js file 2017-07-18 22:38:46


At 7/17/17 09:25 AM, Marcgal wrote: Newgrounds seems to strip comments from javascript source files when uploading HTML5 games.

However, very long comments seem to be only partially stripped, resulting in an invalid .js file and the malfunction of the uploaded game.

This is a minimized example of this faulty behavior I've uploaded: http://www.newgrounds.com/projects/games/1120353/preview

Here is the .zip file I uploaded: https://www.dropbox.com/s/vmwnp02zz8ye4e7/NGBug.zip?dl=0 It consists only of two files: index.html : https://paste.ee/p/bLoni and script.js : https://paste.ee/p/7DCkN

When displayed locally in a browser, this should display a white Hello World text (white to make it visible on NG's black background). However, as you can see, this fails to work when uploaded on Newgrounds, because Newgrounds only partially strips the very long comment in the beginning, producing the following incorrect and malfunctioning .js file: https://paste.ee/p/cSZF7

This is an issue in practice as well, because RPG Maker MV requires some meta-info in the comments of the source files of Javascript third-party plugins. Some plugins, like Yanfly's Credits Page plugin http://yanfly.moe/2015/12/24/yep-49-credits-page/ , legitimately need to store a lot of meta-info in the comments. This is an inconvenience for RPGMakerMV users, since they need to manually modify these plugins so that they no longer get invalidated by NG formatters. Fixing the comment stripper so that it always strips the whole comment and never only parts of it would be convenient.

Newgrounds doesn't actually parse any of your files directly. However, they do get served using the CloudFlare CDN, which compresses javascripts so they load with the optimum speed for all users. There's not much we at NG can do about this. Any site using CloudFlare will have the same issue.

We apologize for the inconvenience, but if you are able to strip the comments before publishing, you should still be able to submit your games here.

Response to Faulty comment stripping in js file 2017-07-20 09:09:01


At 7/17/17 09:25 AM, Marcgal wrote: Newgrounds seems to strip comments from javascript source files when uploading HTML5 games.

Try adding .min to the file name of any JS you upload e.g. "mygame.min.js".

Response to Faulty comment stripping in js file 2017-07-21 07:46:24


At 7/20/17 09:09 AM, BrenTheMan wrote:
At 7/17/17 09:25 AM, Marcgal wrote: Newgrounds seems to strip comments from javascript source files when uploading HTML5 games.
Try adding .min to the file name of any JS you upload e.g. "mygame.min.js".

This, unfortunately, is not easily feasible due to the peculiarities of RPG Maker MV. For some weird reason the editor strips ".min" from the file name and links the game against "mygame.js" - and then makes the game crash 'cause it can't find "mygame.js".

If this is possible it requires manually editing the game's config files. I'll have to dig deeper into it.

Response to Faulty comment stripping in js file 2017-07-21 23:44:58


At 7/21/17 07:46 AM, Marcgal wrote: If this is possible it requires manually editing the game's config files. I'll have to dig deeper into it.

See if you can, but if it's not feasible let us know.