What to Expect of AdonisJS 6? #4184
Replies: 41 comments 73 replies
-
Please supports GraphQL, NoSQL, and Serverless for the API. Currently, I can't set up the Adonis with Serverless. |
Beta Was this translation helpful? Give feedback.
-
Absolutely amazing! Can't wait to read new documentation and give a try to the v6 |
Beta Was this translation helpful? Give feedback.
-
maybe, annotations could be considered. |
Beta Was this translation helpful? Give feedback.
-
Great stuff! Amazing work. My only reservation is using |
Beta Was this translation helpful? Give feedback.
-
Very exciting stuff. I'm pretty lucky to start using Adonis at the cusp of new release. 🎉 I also saw @thetutlage playing around with some TSX support on twitter. Is that something that would be included or supported in any official capacity? |
Beta Was this translation helpful? Give feedback.
-
Great news! So many new things, is there any ETA available? |
Beta Was this translation helpful? Give feedback.
-
Add support for documenting rest api. currently package are bad. |
Beta Was this translation helpful? Give feedback.
-
Great News. AdonisJS is great just like Laravel. In this release I am more excited about vite. And I would love to know the release date. Also, is there a way to install the pre-released V6? |
Beta Was this translation helpful? Give feedback.
-
Can't wait to test this new version and create new modules! I'm pretty sure the experience will be quite exciting! 😍😍 |
Beta Was this translation helpful? Give feedback.
-
Excited for Adonisjsv6! 🥳😍 It was mentioned that validator will be receiving a major revamp and I'm just curious if validation reporting will be going to be a focus as well? I do remember struggling in creating custom reporter for my validator and ended up with just a flat list of validation errors. (I wanted it to be structured the same as the input.) |
Beta Was this translation helpful? Give feedback.
-
I have a webapp that is running adonisjs4.1 is there a way to migrate to v5 or v6? |
Beta Was this translation helpful? Give feedback.
-
I would like to see the official Adonis documentation website be multilingual. I am willing to translate the documentation into Russian myself. |
Beta Was this translation helpful? Give feedback.
-
Will v6 have built-in integration with ElasticSearch or OpenSearch? |
Beta Was this translation helpful? Give feedback.
-
This is very exciting. I'm especially happy about ESM support and the switch to vite. When can we expect v6 to become available? |
Beta Was this translation helpful? Give feedback.
-
Adonis JS v6 seems to be great. Is there any plan to make Adonisjs compatible with Adminjs for integrating quick admin panels? Or are there alternative packages for the same purpose? |
Beta Was this translation helpful? Give feedback.
-
The only thing preventing me from using Adonis is the lack of support for the Edge template engine in WebStorm. |
Beta Was this translation helpful? Give feedback.
-
If possible, less opinionated folder structure (similar to the concept of apps in Django and modules in NestJS). I've used Adonis for a handful for production apps where the codebase ended up growing significantly in size, which made it harder to find related files and further increased context switching. With a modular system, domains can be separated, maintenance is improved, and multiple teams can work independently. When there are only a few people, it's easy to manage the codebase, but it becomes harder with the introduction of teams. We can add a template creation feature for this structure through the CLI to avoid major changes (doesn't have to support everything). Then gradually adjust things internally to fully support a full-fledged modular system, while still keeping the existing structure as the default. Using a modular alternative could be beneficial for big projects with many teams, potentially increasing Adonis popularity. All the existing concepts like providers, IOC etc will still remain the same, but just that they can exist within a module. |
Beta Was this translation helpful? Give feedback.
-
It would be great, if AdonisJS in the future has features for integration with Swagger, as is done in large frameworks. generate routing & swagger docs just by defining them in the controller. similar to what NestJs does |
Beta Was this translation helpful? Give feedback.
-
hopefully in the latest version there will be some kind of livewire in adonisjs. and there is also a change in pagination, because I have difficulty using pagination when there are a large number of records. |
Beta Was this translation helpful? Give feedback.
-
I'd love to see integration with the oauth2 protocol like |
Beta Was this translation helpful? Give feedback.
-
WhereRelation in ORM?
await User.query().whereHas('posts', (postsQuery) => {
postsQuery.where('status', 'published')
})
await User.query().whereRelation('posts', 'status', 'published')
or
await User.query().whereRelation('posts', 'number', '>=', 50)
I missed Polymorphic Relationships in the orm |
Beta Was this translation helpful? Give feedback.
-
SurrealDB support? |
Beta Was this translation helpful? Give feedback.
-
Would love to see something similar to Laravel Sail in the future! To make developing with Docker easier, opinionated and stable. |
Beta Was this translation helpful? Give feedback.
-
So pumped for the release ✊🏻 |
Beta Was this translation helpful? Give feedback.
-
Model column typing in model query builder. Example: SomeModel
.query()
.where('typedColumn', someValue) // Here is typed column And more other methods with columns. |
Beta Was this translation helpful? Give feedback.
-
With the upgrade to a better version of pino, will you be able to use new transports for logging to external services ? |
Beta Was this translation helpful? Give feedback.
-
I just came across adonisjs. I noticed once upon a time websockets were supported. I can't find anything about websockets in the v5 docs about their support. Will v6 include support for websockets? |
Beta Was this translation helpful? Give feedback.
-
I love AdonisJS <3 |
Beta Was this translation helpful? Give feedback.
-
Hi everyone / Salut tout le monde I just saw yesterday (24/01/24) the very last v6.2.1 version of Adonis BUT no way to install and configure properly @eidellev/inertia-adonisjs which was working perfectly with Adonis v5.9 Par avance merci @RomainLanz and others ! |
Beta Was this translation helpful? Give feedback.
-
I just found out there is something like this, has anyone tried this? and have you been successful or not? https://socket.dev/npm/package/adonisjs-livewire npm install adonisjs-livewire |
Beta Was this translation helpful? Give feedback.
-
If you have been following us on Twitter, you might have seen us talking about AdonisJS v6 - “A new major version of the AdonisJS framework”. We’ve spent four years in the AdonisJS v5 era, and it’s time to move to the AdonisJS v6 era with some fresh ideas.
But don’t worry. Migrating your apps to AdonisJS v6 will be easy. It might take a few hours or a couple of days, depending on the size of your application. We will also provide a command line tool to help move your code to the new version.
AdonisJS is a modular framework with a feature-rich core (i.e., the
@adonisjs/core
package) and a collection of officially maintained packages. Each package follows its own release cycle and semver versioning. We are significantly updating the framework core in this release (i.e., AdonisJS v6).The main goal of this update is to work more closely with the platform. We want to use new features of JavaScript and Node.js, ensure your apps have better type safety, and keep improving the framework performance.
Updating minimum requirements
Because we’re using new features from Node.js, your system needs to have at least Node.js version 18 or higher. This version is the current Long-Term Support release.
Switching to ECMAScript Modules (ESM)
The most significant change in this update is that we’re moving to ECMAScript modules (ESM). Right now, AdonisJS uses and compiles to CommonJS (CJS) format. Moving to ESM lets us use new language features and stay updated with the ecosystem.
What does this mean for your app?
Your apps will be able to use the new platform features that work in ESM, like the Top-Level-Await statement and Node.js subpath imports.
The good part is ESM applications can load and use CommonJS packages. But not the other way around. Therefore moving to ESM is a must.
New asset bundler
Many of you have asked for this, so we’re excited to announce that AdonisJS 6 will include Vite as the default asset bundler.
Better documentation
There are some lapses in the current documentation of AdonisJS. For example, topics like IoC Container, Service providers, and Package development are undocumented. Also, the docs should be more comprehensive.
With AdonisJS v6, we have spent significant time covering all the framework aspects within the documentation. Here's a sneak-peak of some newly added topics.
An important thing to note is that the documentation is a reference guide explaining how the framework works and the available APIs. We imagine the framework users reference documentation when they want complete information about a topic.
The documentation will not teach you how to build an app from scratch. For that, we plan to write step-by-step tutorials that teach you how to build a specific app using the framework.
In the meanwhile, let us introduce you to Adocasts and AdonisJS Mastery if you want tutorial-based learning content. Both of these platforms have been creating content on AdonisJS for years.
Changes to the import module names
As of today (i.e., AdonisJS v5), you will witness many imports prefixed with the
@ioc
keyword. For example, The router is imported from the@ioc:Adonis/Core/Route
module and the Event emitter is imported from the@ioc:Adonis/Core/Event
module.The
@ioc
keyword is a convention we follow to communicate that this import will be resolved from the IoC Container of AdonisJS. When you compile your code from TypeScript to JavaScript, we use a TypeScript transformer to convert this import into an IoC Container lookup method call.For instance, if you were importing the Route module like this.
The compiled output will roughly look as follows.
Taking this approach has some downsides.
tsc
only.CTRL-click
the import to see the implementation.Starting with v6, we will remove
@ioc
keyword imports with regular ESM imports and still be able to look up dependencies inside the AdonisJS dependency container.Here's what the router import looks like in both v5 and v6. In v6, if you
CTRL+click
on therouter
value, you will see a standard JavaScript module resolving the singleton router instance from the IoC Container and exporting it as a variable.To conclude, in v6, there are no compiler magic converting imports to IoC Container lookup method calls. Everything is straightforward and easy to reason about.
You can learn more about the AdonisJS IoC Container used in v6 from the following links.
New Encryption module
AdonisJS encryption module currently encrypts data using a single static algorithm, i.e.,
aes-256-cbc
. We have received a few requests to support additional algorithms in the form of drivers.AdonisJS v6 will allow you to register custom encryption drivers, and we will bundle drivers for the following encryption algorithms.
aes-256-cbc
aes-256-gcm
chacha20-poly1305
Changes to file system naming conventions
Moving forward, the AdonisJS official starter kits will use the
snake_case
format for naming files and folders. Currently (in v5), we uselowercase
names for root-level directories andPascaleCase
for sub-directories.In the JavaScript ecosystem, there is no general agreement on naming conventions. Some sub-communities use
PascalCase
for files that export a class andsnake_case
ordash-case
for files that export functions or objects.We decided to take a simple approach and consistently name all files and folders without relying on what is exported from the file. The
snake_case
format is inspired from Dart, and Google TypeScript style guide.To learn more about this decision, check out the article “List of rules and conventions I follow when writing code” by Aman Virk.
Flexible stub system
The scaffolding ace commands under the
make
namespace are used to create files with the initial boilerplate quickly. For example, You can use themake:controller
command to create a controller, themake:model
command to create a model, and so on.Until now, the templates used by these commands were within the package's source code, and there was no way to customize them.
Moving forward (with V6), you can eject the scaffolding templates (stubs) to your application codebase and modify them per your requirements. Next time, when you run the
make
commands, AdonisJS will use the ejected template.Here's what the controller template looks like.
generators
object to define variables in the first two lines.3-5
, we use the YAML front matter to define the destination path of the file we are about to create. This will allow you to create controllers and models in any directory of your choice.New Validation Library
The current validation module of AdonisJS has served us well, but it desperately needs some improvements. Right now:
Finally, we developed a framework agnostic validation library called VineJS. VineJS will be the official validation system for AdonisJS v6.
VineJS is much faster than the version used in V5, and it's also more comprehensive. It makes it easy to create custom rules, schema types and validate complex schemas.
You can learn more about VineJS in our introduction live stream. https://www.youtube.com/watch?v=YdBt0s8NA4I
Other Changes
Numerous other changes have been made for the release of AdonisJS 6, both in the core and in some modules.
Following are some highlights:
pino
, the logging package. This allows you to make the most of worker threads to enhance performance.sendingblue
andresend
.All these updates are designed to help you write better, more efficient, and safer code with AdonisJS v6.
The present and the future
We have completed all the changes in the framework core and are ready to migrate official packages to work with AdonisJS v6.
We will not introduce any breaking changes in our official packages. The goal is to keep the breaking changes' surface area as small as possible and help you quickly migrate your apps to v6.
Conclusion
To conclude, the goal of AdonisJS v6 is to remove magic and stay up to date with the language and the platform changes.
We want to make AdonisJS a more robust, efficient, and developer-friendly framework. Trust us; we are so happy with v6 internally and super pumped to release it. Let me share screenshots of an internal conversation we had.
Finally, we thank everyone for using AdonisJS and for sharing their feedback. Having the motivation and energy to work on the framework comes directly from all of you.
--
Your core team
Beta Was this translation helpful? Give feedback.
All reactions