Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update app structure #8

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

yordan-kanchelov
Copy link
Contributor

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

@Mwni
Copy link
Owner

Mwni commented Jun 1, 2019

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?

@yordan-kanchelov
Copy link
Contributor Author

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.

@Mwni
Copy link
Owner

Mwni commented Jun 2, 2019

I've updated the npm package, can you check if it works for you via
import { TextInput } from "pixi-text-input"

@buryo
Copy link

buryo commented Jun 2, 2019

it seems broken
Screenshot_5

@yordan-kanchelov
Copy link
Contributor Author

@buryo I fixed those problems. There was a missing import in the DefaultBoxGenerator

@yordan-kanchelov
Copy link
Contributor Author

@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

@Mwni
Copy link
Owner

Mwni commented Jun 2, 2019

Is it working now (v1.0.3)?

@yordan-kanchelov
Copy link
Contributor Author

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.

@ivanpopelyshev
Copy link

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 :)

@Mwni
Copy link
Owner

Mwni commented Jun 4, 2019

@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.

@yordan-kanchelov
Copy link
Contributor Author

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

@ivanpopelyshev
Copy link

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants