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

The TypeScript code generator should be able to create Library files #88

Open
MattEWeber opened this issue Jan 10, 2020 · 0 comments
Open
Labels
enhancement Enhancement of existing feature typescript Related to TypeScript target

Comments

@MattEWeber
Copy link
Contributor

Related to #83, I think it would be useful to use the TS code generator to create reusable libraries of components. This should only require some minimal changes to the generated code. We'd have to:

  1. Add the "export" keyword in front of the class definitions for generated Reactors and Apps (top level reactors). So

class Foo extends Reactor {

becomes

export class Foo extends Reactor {

  1. Don't generate the code to instantiate the top level App and start it. Since JavaScript modules are executed when they're loaded, we wouldn't want to accidentally start an instance of App each time the library is loaded.

It should be safe to do (1) and always generate reactors with the export keyword, regardless of whether or not the generated file is intended as a library. But we'd need to add a target property such as "Library" to tell the code generator when it should do (2).

Any thoughts? Maybe the "Library" property would be a good way to handle #83 too?

@MattEWeber MattEWeber added the enhancement Enhancement of existing feature label Jan 10, 2020
@Feliix42 Feliix42 added the typescript Related to TypeScript target label Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing feature typescript Related to TypeScript target
Projects
None yet
Development

No branches or pull requests

2 participants