pixi-text-input
pixi-text-input copied to clipboard
Update app structure
So .. what I've done here is to update the project structure following a typescript boilerplate I am currently using and with whom I export few things like pixi-console pixi-fps.
There are some tradeoffs in this way and I guess the most major one is that you can't include it as simple as just put the TextInput.js to the head of an HTML file and expect it to work. In most of the projects tho I use some module bundler like browserify or webpack and I don't have problems with that
I need a way to publish this as a simple browser script that works without browserify or webpack. You think there is a way to do it while keeping the proposed structure?
Currently, I don't have a working solution for that. Maybe from this setup, there is a way to create a build script that will bundle a single file for you, but I am not sure how to attach it to the window.PIXI object.
Maybe an IIFE inside the index.ts 🤔 ?
Pixi.js manages to do this well, but I don't have time atm to see how they manage to create and export bundles for both worlds.
I've updated the npm package, can you check if it works for you via
import { TextInput } from "pixi-text-input"
it seems broken
@buryo I fixed those problems. There was a missing import in the DefaultBoxGenerator
@Mwni I tested it with these latest changes. Btw It is exported as default so
import TextInput from "pixi-text-input"
would work too without the curly braces
Is it working now (v1.0.3)?
For me, no. ( all my projects are with typescript and currently, you are not exporting any d.ts for a beginning ). As an advice, you could use this template from me currently and export a version 2.0.0 from it that will have some breaking changes, but people will be able to use this lib or I could publish the fork I have for @buryo and other folks.
We are currently working on infrastructure for plugins for v5, including ones on typescript. When time comes I'll notify you, maybe our template will be good enough for you too :)
@jkanchelov Of course, feel free to fork it and publish it for typescript. On my end, i'll first have to familiarize myself with typescript, otherwise I can't make updates anymore.
If I have some free time I will. About the typescript thing .. it's really something like the modern type of writing javascript, but provides you some compile-time errors that could save you some time finding stupid errors + makes things easier with the generation of d.ts for the things you write out of the box ( that comes useful for many people ) I recommend you to check it and there is a big chance that you would like it
big change that you would like it
Unless you already have traumatic experience with types http://www.html5gamedevs.com/topic/42970-how-to-extends-pixiextrasanimatedsprite/?tab=comments#comment-242015 :)