AncientBeast
AncientBeast copied to clipboard
watch for asset changes
The build:dev command should watch for asset changes as well and recompile on the fly as needed.
This should eliminate the need to run npm run assetLister manually in some cases when building
https://github.com/FreezingMoon/AncientBeast/blob/master/CONTRIBUTING.md#compile-project
It should probably not bundle everything and rely on JS files importing what they need (so creatures import their images etc). This will greatly reduce builds size I suspect by not including all the unused artwork.
-Karl Tiedt
On Thu, Nov 21, 2019 at 6:49 PM Dread Knight [email protected] wrote:
The build:dev command should watch for asset changes as well and recompile on the fly as needed. This should eliminate the need to run npm run assetLister manually in some cases when building
https://github.com/FreezingMoon/AncientBeast/blob/master/CONTRIBUTING.md#compile-project
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/FreezingMoon/AncientBeast/issues/1600?email_source=notifications&email_token=AAAXXWWXWIWIRUTRJIRLBLLQU4UC5A5CNFSM4JQKEMMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4H3IGSVA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAXXWUHBYDN6KCEJSZLRETQU4UC5ANCNFSM4JQKEMMA .
@ktiedt all the assets included should be bundled in the deploy folder, but not all loaded right away. Anyway, It should be possible to optimize load time once we upgrade to Phaser 3 actually #853 as it allows for loading things more on the fly, unlike Phaser 2 which needs all the assets at first load. There are even demo files for that https://labs.phaser.io/index.html?dir=loader/loader%20events/&q= Seems that #678 is related to this kind of stuff, I'll update it soon regarding with what I've said above.
Yeah the current thing isnt copying them to the deploy folder, its encoding them in the bundle... thats why it hits ~10 megs I believe. At least thats how I remember it working.
-Karl Tiedt
On Thu, Nov 21, 2019 at 10:56 PM Dread Knight [email protected] wrote:
@ktiedt https://github.com/ktiedt all the assets included should be bundled in the deploy folder, but not all loaded right away. Anyway, It should be possible to optimize load time once we upgrade to Phaser 3 actually #853 https://github.com/FreezingMoon/AncientBeast/issues/853 as it allows for loading things more on the fly, unlike Phaser 2 which needs all the assets at first load. There are even demo files for that https://labs.phaser.io/index.html?dir=loader/loader%20events/&q= Seems that #678 https://github.com/FreezingMoon/AncientBeast/issues/678 is related to this kind of stuff, I'll update it soon regarding with what I've said above.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/FreezingMoon/AncientBeast/issues/1600?email_source=notifications&email_token=AAAXXWVUXBSZU6S5Q5ULDJTQU5Q7FA5CNFSM4JQKEMMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE4RJAI#issuecomment-557388929, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAXXWRY72VOOOUXBJ5U6C3QU5Q7FANCNFSM4JQKEMMA .
@ktiedt Yeah, you're right, definitely. Just wanted to be clear about things. So I should prioritize Phaser v3 upgrade for next release and then see about using these new goodies that it offers us to play with.
Does the project still need this?
Does the project still need this?
@andretchen0 Hmm, I think so. It only looks for code changes, but if there are some asset changes, things can go badly. You can test it by tweaking/adding/removing an asset...
Does the project still need this?
@andretchen0 Hmm, I think so. It only looks for code changes, but if there are some asset changes, things can go badly. You can test it by tweaking/adding/removing an asset...
Right. I guess I'm wondering if the specs have changed in the meantime, or if it's just to be coded as described.
Does the project still need this?
@andretchen0 Hmm, I think so. It only looks for code changes, but if there are some asset changes, things can go badly. You can test it by tweaking/adding/removing an asset...
Right. I guess I'm wondering if the specs have changed in the meantime, or if it's just to be coded as described.
@andretchen0 Gotcha. It's up for grabs 🐻
Does the project still need this?
@andretchen0 Hmm, I think so. It only looks for code changes, but if there are some asset changes, things can go badly. You can test it by tweaking/adding/removing an asset...
Right. I guess I'm wondering if the specs have changed in the meantime, or if it's just to be coded as described.
@andretchen0 Gotcha. It's up for grabs 🐻
Ok. I'll check it out.
@DreadKnight
Could you fill me in on the needs/thought process behind including assetLister.js?
Sure. Probably the asset list needs to store a hash index as well of the assets. Ideally only of the assets that are used somewhere in the codebase (as someone mentioned above), required/included, that sort of stuff. If a hash changes, file changed. Sometimes assets are added or removed altogether, so in any case, the list would need updated and the build folder would need to have files added/removed/updated. Might increase build time a bit. There might be npm packages just for this. Webpack probably can handle this sort of thing, not fully sure.
On Tue, Jul 11, 2023, 5:10 PM andretchen0 @.***> wrote:
@DreadKnight https://github.com/DreadKnight
Could you fill me in on the needs/thought process behind including assetLister.js?
— Reply to this email directly, view it on GitHub https://github.com/FreezingMoon/AncientBeast/issues/1600#issuecomment-1630907179, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEPNX4V3JHFZJBPGOYE6Z3XPVNGJANCNFSM4JQKEMMA . You are receiving this because you were mentioned.Message ID: @.***>
This would happen similar to how it happens with the code, given the same commands, so that's seamlessly if done right.
Webpack probably can handle this sort of thing, not fully sure.
Yeah. I guess that's where I'm heading. It seems like it's duplicating the bundler. Webpack will almost certainly be faster at bundling — assetLister takes quite some time to run.
Off the top of your head, do you see a problem with removing it?
And assetLoader.ts?
Hmm, if we have all the included assets within code files detected/listed/bundled/updated/removed and such, all good afaik. Might even need some optimizations for them eventually perhaps. Maybe who did the indexing stuff wasn't familiar with Webpack or so.
On Tue, Jul 11, 2023, 6:41 PM andretchen0 @.***> wrote:
Webpack probably can handle this sort of thing, not fully sure.
Yeah. I guess that's where I'm heading. It seems like it's duplicating the bundler. Webpack will almost certainly be faster at bundling — assetLister takes quite some time to run.
Off the top of your head, do you see a problem with removing it?
And assetLoader.ts?
— Reply to this email directly, view it on GitHub https://github.com/FreezingMoon/AncientBeast/issues/1600#issuecomment-1631060961, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEPNX2SGYDBHOGBP7J6FP3XPVX3VANCNFSM4JQKEMMA . You are receiving this because you were mentioned.Message ID: @.***>
I'm looking into assets. It's kind of off topic here, so I'll open a discussion.
Fwiw, I have this working with nodemon – which would be an extra dev dependency and use an extra process.
- Is that an ok solution?
- Given that most contributors won't be fiddling with assets, I wonder if we shouldn't leave the current
package.jsonscripts as-is and simply add an extra one, e.g.,npm run start:dev:assets. Thoughts?
Fwiw, I have this working with nodemon – which would be an extra dev dependency and use an extra process.
- Is that an ok solution?
Don't think I've heard of it, but sure, dev dependencies can be always be fiddled with, they're meant to serve us.
- Given that most contributors won't be fiddling with assets, I wonder if we shouldn't leave the current
package.jsonscripts as-is and simply add an extra one, e.g.,npm run start:dev:assets. Thoughts?
If that process is quite intensive, I guess going that route with extra command might not be a bad idea at all.
If that process is quite intensive, I guess going that route with extra command might not be a bad idea at all.
I was on old hardware last month. Just using Webpack was slow. I don't want to make development even slower for devs in similar situations if possible.
Yeah, figured that was the case. Sounds good, this is a lightweight game after all. If the development process can be as well, even better.
On Wed, Jul 12, 2023, 1:52 AM andretchen0 @.***> wrote:
If that process is quite intensive, I guess going that route with extra command might not be a bad idea at all.
I was on old hardware last month. Just using Webpack was slow. I don't want to make development even slower for devs in similar situations if possible.
— Reply to this email directly, view it on GitHub https://github.com/FreezingMoon/AncientBeast/issues/1600#issuecomment-1631607391, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEPNX2GIQWS7FA33BLKCCTXPXKJZANCNFSM4JQKEMMA . You are receiving this because you were mentioned.Message ID: @.***>