Closed wooseok123 closed 4 months ago
An index.d.ts
for importing classes like import {RoundRectangle, YoutubePlayer, ContainerLite, TextEdit, Edit } from 'phaser3-rex-plugins/plugins';
is a good idea.
I will try to write a script to generate that index.d.ts
, which will import these classes from className.d.ts
file.
Can't remove all these className.d.ts
files because of backward-compatible.
An
index.d.ts
for importing classes likeimport {RoundRectangle, YoutubePlayer, ContainerLite, TextEdit, Edit } from 'phaser3-rex-plugins/plugins';
is a good idea. I will try to write a script to generate thatindex.d.ts
, which will import these classes fromclassName.d.ts
file. Can't remove all theseclassName.d.ts
files because of backward-compatible.
Thank you!! If there's anything i can help you with, i'd gladly work with you
I try to create a script to generate index.js
file. And find some duplication import name issues, i.e. they will have name conflict if put them into a single index.js file)
Sorry I don't have time to resolve/rename them. So I will pending this task currently.
Duplicate Board
./board/board/Board.js
./board/board/LogicBoard.js
Duplicate BracketParser
./logic/bracketparser/bracketparser/BracketParser.js
./logic/bracketparser/bracketparser2/BracketParser.js
Duplicate Preload
./firebase/preload/Preload
./firebase/preload/Preload.js
Duplicate GlowFilterPostFxPipeline
./shaders/glowfilter2/GlowFilterPostFxPipeline.js
./shaders/glowfilter/GlowFilterPostFxPipeline.js
Duplicate Hexagon
./board/grid/hexagon/Hexagon.js
./geom/hexagon/Hexagon.js
Duplicate LoaderCallback
./loader/awaitloader/AwaitLoaderCallback.js
./loader/imageuri/ImageURILoaderCallback.js
Duplicate Files
./firebase/firestore/files/Files
./storage/localforage/files/Files.js
Duplicate DataManager
./data/buff/DataManager.js
./storage/localstorage/data/DataManager.js
Duplicate MoveTo
./board/moveto/MoveTo.js
./behaviors/moveto/MoveTo.js
Duplicate NinePatch
./gameobjects/rendertexture/ninepatch/NinePatch.js
./gameobjects/blitter/ninepatch/NinePatch.js
Duplicate ObjectFactory
./firebase/ObjectFactory.js
./parse/ObjectFactory.js
Duplicate Preload
./firebase/preload/Preload.js
./parse/utils/preload/Preload.js
Duplicate PageLoaderFactory
./firebase/firestore/pageloader/Factory.js
./parse/pageloader/Factory.js
Duplicate ItemTableFactory
./firebase/database/itemtable/Factory.js
./parse/itemtable/Factory.js
Duplicate LeaderBoardFactory
./firebase/firestore/leaderboard/Factory.js
./parse/leaderboard/Factory.js
Duplicate DataManager
./storage/localstorage/data/DataManager.js
./data/restorabledata/DataManager.js
Duplicate Rotate
./input/gestures/rotate/Rotate.js
./behaviors/rotate/Rotate.js
Duplicate LoaderCallback
./loader/imageuri/ImageURILoaderCallback.js
./loader/scripttag/ScriptTagLoaderCallback.js
Duplicate Recorder
./logic/runcommands/arcadetcrp/Recorder.js
./logic/runcommands/tcrp/Recorder.js
Duplicate Player
./logic/runcommands/arcadetcrp/Player.js
./logic/runcommands/tcrp/Player.js
Duplicate ToggleSwitch
./gameobjects/shape/toggleswitch/ToggleSwitch.js
./gameobjects/shape/toggleswitch/ToggleSwitchShape.js
Duplicate LoaderCallback
./loader/scripttag/ScriptTagLoaderCallback.js
./loader/webfontloader/WebFontLoaderCallback.js
Duplicate Achievements
./logic/achievements/csvachievements/Achievements.js
./logic/achievements/ymlachievements/Achievements.js
Duplicate ConditionsTable
./logic/conditionstable/csvconditiontable/ConditionsTable.js
./logic/conditionstable/ymlconditiontable/ConditionsTable.js
Thank you for your hard work 👍
I've also checked the error and as you mentioned, it seems that there are files with the same class names despite being in different modules.
However, in addition to just organizing imports, ensuring unique class names across modules seems necessary?
From the first post
import RoundRectangle from 'phaser3-rex-plugins/plugins/roundrectangle.js';
import YoutubePlayer from 'phaser3-rex-plugins/plugins/youtubeplayer.js';
import ContainerLite from 'phaser3-rex-plugins/plugins/containerlite';
import {TextEdit, Edit} from 'phaser3-rex-plugins/plugins/textedit.js';
It seems that most of classes can be found in ui-components.js, except YoutubePlayer.
There has another package named rexui, which has a single exporting file (Classes, plugin), they will have unique class names by design.
Oh, RexUI
is exactly what i wanted. Like this example
import { ScrollablePanel, FixWidthSizer, Label, RoundRectangle } from 'phaser3-rex-plugins/templates/ui/ui-components.js';
But as you mentioned, RoundRectangle
, TextEdit
, Container
are both member of Plugin
and RexUI
. And what i understand is that RexUI
is used as integrated Packaged and Plugin
is used as a singleton of each file.
Making two integrated modules (rexUI, plugins) might looks redundant and confusing (duplicated import ex. RoundRectangle
from plugin
and rexUI
). But it does look tidy if we make plugins a module rather than just leaving it as is.
Maybe need couple of guides to the developers about using rexUI
and plugin
.
plugins
folder does not have clear objectives, but rexui
folder has, it focus on collection of ui.
I don't have plan to restructure plugins
folder recently, sorry.
For documentation, it is another story...
plugins
folder does not have clear objectives, butrexui
folder has, it focus on collection of ui. I don't have plan to restructureplugins
folder recently, sorry. For documentation, it is another story...
Sure! I understand what you meant. Take your time!
Description
How about adding a
index.ts
which includes all plugin files so that the import lines look clean?As-Is
To-Be
To look like this, i think we need to remove all the
d.ts
file of each component and make a intergratedindex.ts
. Also have to changeexport default
toexport
needs to be done
If it looks good, i'm willing to make a contribution.
BTW, thank you for making this cool lib 👍