-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
Version 2.0 (June-August) #658
Comments
Some minor things to consider,
That's all so far. |
Just come into my mind, it would be nice to have FoalTS shown in realword. |
Maybe considering migrating from typeorm to mikro-orm (but any other orm would be a better choice than typeorm if you ask me). The documentation of typeorm is lacking which is problematic because issues are not answered anymore. If you ask for some clarification, it will mostly never be answered. As an example, I had to dig hard to discover that I also just got bitten by BeforeInsert that is not always firing (typeorm/typeorm#5493). And there are many other problems/annoyance like this that were reported for months (even with a PR available) and basically you can't expect to get them fixed. The situation is well summarized by this post: Even though I can understand the frustration of the developer, I believe that his approach will make people move away (and this is already the case). mirko-orm is another typescript based orm. Nothing can prevent that one day the same problem occurs. However at this time, the developer is very responsive. He answers issues. He can be reached on slack and he is actively developing the library. |
Thanks for the tip, @FredericLatour |
After 2.0 release, I suggest to have a basic CRUD controller and service for each model which can be easily established by simply extend a controller and service with a base class. I can provide some of my code. |
Additional suggestions: Regarding the Config approach. I don't think Foalts should rely directly on the "Config" service provided:
I would instead pass an IFoaltsConfig object when creating and initializing the application. And by the way, nothing would prevent anybody to have a Config tree that mimics IFoaltsConfig. const foaltsConfig = Config.get<IFoaltsConfg>('settings')
const app = await createAndInitApp(AppController, foaltsConfig) I had a look at the config service and was wondering why you were not consolidating/merging the various config sources (except for process.env) instead of your current approach in the Get method. That being said, I tend to give up JSON configuration and I use Typescript instead. In most cases, we will want our configuration to be committed so I can't really see any advantage of using Json. Json or .env files make sense for information that we don't want to commit (passwords, etc ..). |
I don't think moving away from TypeORM is a good idea. If it lacks something then it should be improved. That requires involvement. Moving away to another, less popular, ORM is like spiraling in a vicious circle. No mature solution comes out of it. If you find TypeORM lacking support consider to donate for at least of 1 hour of the developer's time. He has at least one mouth to feed. |
|
Thank you for sharing your thoughts on version 2. The issue description has been updated.
Yes, having to deal with AJV schemas in shell scripts is not the best when we use
The framework cannot implement easily this feature because the message is generated by Ajv, not Foal. I'm not sure this feature would be used by many users of the framework so I'd rather not to add it. |
@kingdun3284 could you open an issue for this and provide your code so that we can work on? I would have more in mind to add this code in the documentation or in a generator rather than in the core of the framework. CRUD components can become complex and limiting as the framework or the application grow, which would go against Foal's philosophy: simple and progressive. But having an initial code to provide (via the doc or a generator) to users to create reusable components for building a API REST seems to be a good idea to me 👍 . |
@FredericLatour could you open an issue on this? Could you also add some examples of code/configuration where you find the
Hmm, it's been a while. I think that at that time, it was for performance reasons. But I didn't make tests on this so I'm sure it really performs better that way.
So would you like to have a committed TS file in
Let's continue this discussion on a separate issue. |
@EmilCataranciuc @FredericLatour Thank you for your thoughts on TypeORM. I don't think this is the right place to talk about everyone's donation policy or TypeORM's business plan. Please let's keep us on focusing on the improvements of FoalTS. TypeORM will be kept in v2 as default ORM for these reasons:
However choosing TypeORM as default ORM does not prevent the framework from being used with another one such as mikro-orm (for example the hooks |
@LoicPoullain thank you again, you're good with code and words. |
Is there any roadmap for built-in support microservice that will be provided in the future ? (like redis,mqtt,queue system) |
How about translating FoalTS docs, is it possible for v2+? If there's gonna be guidance, I'm in. Gonna take my part translating into Bahasa Indonesia. |
@rizalashidiq97 Currently there is no such map. But if you see some features that are missing in the framework, feel free to open an issue with some use cases. |
@anonimusprogramus could you open a specific issue for this? |
When would we expect Version 2.0? |
I’m running late on version 2. The reason behind this is that some parts of the code took me more time that I was expected. The same goes writing the upgrading guide and updating the documentation. Where we are now:
Once done:
If everything is ok, v2 will be published in production. I can’t give a precise date but I would say that the final version will be released in October-November. |
It is said that When using MongoDB, there are some features that are not available: Will v2 still have those limitations? |
@anonimusprogramus yes, it will. The reason behind this it that groups and permissions logic is based on many relations between the groups, the permissions and the users. This can be managed with relational databases (i.e. SQL databases) but hardly with db such as MongoDB. The |
I see, it makes sense. Thank you. |
Point of progress:
|
Version 2.0.0 currently published as |
Version 2 is officially released 🎉 |
Version 2
Updated on June 19, 2020.
This issue provides an overview of the next version of Foal TS. It will be released between June and August 2020.
The purpose of this release is not to add many new features, which are regularly added in minor versions, but to fix issues and hacks that require some break changes. It will also remove unused and deprecated components and make parts of the framework simpler and more intuitive.
Changes & New Features
✅ = Implemented
1. Developper experience (CLI) ✅
Migrations and shell scripts are not developper friendly when developping (#494). There are too many CLI commands and it is not intuitive to know which one to use and in which order.
In version 2, the files
tsconfig.migrations.json
andtsconfig.scripts.json
will be removed and the CLI commands will be reduced and simplified.More details here: #684.
Examples
Build, make and run migrations
Build migrations, scripts and the app
2. Authentication with sessions ✅
Authentication with sessions is complicated and requires a lot of code. Current implementation also prevents the framework from adding new features (#525, #521, #510).
In version 2, the authentication system with sessions will be greatly simplified.
See #799.
3. Schema references in validation hooks ✅
It is not possible to use references (especially OpenAPI references) in validation hooks.
In version 2, this will be fixed.
More details here: #552.
Example
4. Service initialization ✅
Services can be initialized using their
boot
method. For this to work, we currently need to callServicesManager.boot()
insrc/index.ts
.In version 2, this feature will be enabled by default. No need to call
ServicesManager.boot()
anymore.5. Accessing file metadata during uploading ✅
When uploading a file, we have only access to its content (#673).
In version 2, we will also have access to its file size, mime type and original file name.
6. Safer configuration ✅
Current
Config.get
function has several faults (#496).In version 2, it will be replaced with the new
Config.get2
added in v1.7.7. Improve the naming of JWT settings ✅
Version 1:
settings.jwt.secretOrPublicKey
Version 2:
settings.jwt.secret
,settings.jwt.publicKey
8. Remove support of Mongoose ✅
Mongoose brought many problems in the past while maintaining the framework. It takes time to maintain it and it is also not typed and does not seem to be used by FoalTS users: https://www.npmjs.com/package/@foal/mongoose.
FoalTS will no longer provide Mongoose tools starting from v2 (i.e. CLI code generation and the
fetchUser
function). Users will still be able to use it "by hand" if they wish.9. Improve the configuration system ✅
See #805, #497.
10. Simplify the management of custom errors thrown in controllers and hooks ✅
See #638 (comment).
Cleanup ✅
PermissionDenied
andObjectDoesNotExist
which are unused and do not appear in the documentation.ValidationError
and the functionvalidate
which are unused and do not bring value to the framework.createHttpResponseFile
and useDisk.createHttpResponseFile
instead. Once done, remove the packagemime
from@foal/core
dependencies.@foal/formidable
and use the@ValidateMultipartFormDataBody
hook instead.legacy
option of the functionshashPassword
andverifyPassword
. This option was used in very old versions of Foal when no one was using the framework.@foal/ejs
and the possibility to create FoalTS template engines. Only Express templates engines will be allowed (Twig, EJS, pug, etc).pump
in@foal/core
,@foal/storage
and@foal/aws-s3
and use thepipeline
function from the standard library (added in Node 10).foal g sub-app
.createApp
return a promise and removecreateAndInitApp
. The functioncreateAndInitApp
was introduced because we needed to return a promise.createApp
.Upgrading Dependencies
The text was updated successfully, but these errors were encountered: