Closed Paradoxis closed 8 years ago
I've refactored a large portion of the code to import all modules correctly, but JISON is giving me the worst headache. Feel free to look at and/or implement any of the changes I made over at the forked repo
@paradoxis please create PR!
teria como criar module TS usando imports?
@Paradoxis Has as create module TS, using imports?
@jhonmike CommonJS modules don't need to be compiled into one module (like they were before), however you can export them all in one file like I was doing in test/integration/app/models.ts
. Example:
// TSFramework.ts
export {ApplicationFactory, FactoryConfig} from "./ApplicationFactory";
export {Controller, ActionFilter} from "./Controller";
... all other public classes
// Somewhere in your app
import * as TS from "TSFramework";
class SomeController extends TS.Controller { ... }
This way you can export all classes you want as the "TS" module to expose them in a single class. When it comes to modules I've learned that the only place I ever use them is when I make a class that requires a second namespace. Otherwise its best to just include what you need (Angular 2.0 does this too, rather than importing ALL of angular, you import the bits you need and consume them)
ok, we will study a way to finish the updates and create the first stable version of the "framework"
@Paradoxis we use TS Framework #7 ? I had understood that it was not recommended!
As far as I've read it's not recommended to do in projects, but lots of libraries seem to use it in this way. I created a demo application with a type definition file called typings/ts-framework.d.ts which declares the module. Doing it this way seems pretty stable.
However I'm still stuck on JISON (after researching a little bit, it turns out to be a lexical grammar thing which gets used in C/C++ when building languages, which seems overkill in the first place), it might be smarter to simply use JavaScript and cache routes in memory instead. (Completely eliminating the need for JISON)
I'll be honest, I do not know how to eliminate Jison, but if you know, you can delete it!
I'll work on it some time this week, it should be possible with the new TypeScript decorators and ES6 reflection
show will search about it!
I will close the issue and continue the discussion in gitter!
When running
tsfw start
grunt will complain that the fileTSFramework.d.ts
contains too many duplicate identifiers 'TS'.