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

docs(core): Nx 19 blogpost #23207

Merged
merged 14 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
201 changes: 201 additions & 0 deletions docs/blog/2024-05-07-nx-19-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
---
title: Nx 19.0 Release!!
authors: ['Zack DeRose']
cover_image: '/blog/images/2024-05-07/nx-19-thumbnail.png'
tags: [nx, release]
---

{% youtube
src="https://youtu.be/U6eO8-w9DR0"
title="Nx 19.0 Has Landed!!"
width="100%" /%}

Hey folks!

It's been awhile since February, where in the midsts our big launch week, we launched Nx 18. Nx 18 introduced the biggest new enhancement to Nx to date: Project Crystal.

[![Project Crystal](/blog/images/2024-02-05/featured_img.png)](/blog/2024-02-05-nx-18-project-crystal)

You can read more on project crystal [here](/blog/2024-02-05-nx-18-project-crystal). The main thing to know though is that Project Crystal adjusts the idea of Nx plugins, so that the mere presence of the plugin in your Nx Workspace removes the need to maintain any configuration for most cases.

Nx 18 was a significant departure for us in several ways - maybe the most noteworthy was that we broke our years-long cadence of releasing a new major version every 6 months.

Nx 19 represents a return to form, matching the reliable 6-month schedule. Nx 19 is releasing now 6 months from when Nx 17 released, making Nx 18 a special case to match the impact that Project Crystal had on Nx as a whole.

Here's the rundown of the major things we'll cover in this update:

- [NEW PLUGIN: @nx/gradle](#new-plugin-nxgradle)
- [Nx Atomizer Enhancements](#nx-atomizer-enhancements)
- [Project View Enhancements](#more-project-view-enhancements-for-targets)
- [Generators to Migrate to Project Crystal](#generators-to-migrate-to-project-crystal)
- [BREAKING CHANGE: Updating Bundled Environment Variables: `NX_` to `NX_PUBLIC_`](#breaking-change-updating-bundled-environment-variables-to)
- [General Crystal Polishing](#general-crystal-polishing)
- [New Conference: Monorepo World 2024](#new-conference-monorepo-world-2024)
- [Wrapping Up, And A Heartfelt Thank You](#wrapping-up-and-a-heartfelt-thank-you)
- [Learn More](#learn-more)

## NEW PLUGIN: @nx/gradle

[![NEW PLUGIN: @nx/gradle](/blog/images/2024-04-19/featured_img.png)](/blog/2024-04-19-manage-your-gradle)

We've launched a new first-party plugin for Gradle!

Emily, the engineer that worked on this effort, posted an entire article where you can find the full details [here](/blog/2024-04-19-manage-your-gradle).

Like most of our Nx plugins, you'll be able to use this plugin to generate new applications and projects in your workspace for Gradle, as well as to manage your project dependencies and tasks!
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved

Like all our plugins from here on out, this plugin is supports Project Crystal from the start, which allows us to determine information to create Nx Tasks based on the way your Gradle projects are setup - no further Nx-specific configuration required!
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved

In addition, you can now find [a new tutorial on using Nx with Gradle](/getting-started/tutorials/gradle-tutorial) which will expand on the Java Spring framework's tutorial for multimodal projects and show you how Nx further enhances those features. This tutorial takes you all the way through setting up your CI pipeline with Nx Cloud, so be sure to check it out!
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved

As an editorial note, this Gradle plugin is a big step for Nx, as it represents the first major step we're taking outside of the Javascript sandbox. This has always been the goal: to robustly support monorepos and full-stack development, even across language and ecosystem barriers. We're using this Gradle plugin internally for our closed-sourced projects (in particular Nx Cloud) and we're very proud of this plugin and all that it represents.
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved

## Nx Atomizer Enhancements

The Nx Atomizer launched in Nx 18 with Project Crystal. Essentially, "Atomizer" is the name we use to describe how Nx will automatically shard your e2e tests in your CI pipelines via our first party plugins. You can find out more information in the video below:

{% youtube
src="https://youtu.be/0YxcxIR7QU0"
title="10x Faster e2e Tests!"
width="100%" /%}

While the Atomizer was great for reducing the wall time of end-to-end tests in CI pipelines, one unfortunate trade-off of the Atomizer was that rather than having a single task to represent your end-to-end validation tasks, you instead had a collection of tasks. This tended to clutter up tools when viewing your Nx Tasks. It also wasn't very clear which tasks belonged to which group!

We've addressed this in Nx 19 by introducing the concept of Task Grouping inside of our tooling.

Now, when running the command:

```shell
nx show project e2e-angular --web
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved
```

You'll see the following in the project view:

![Nx Show Project Web View](/blog/images/2024-05-07/nx-show-project-view.webp)

Notice how all tasks are now appropriately grouped in the `E2E (CI)` group!

You can also find the same enhancements in Nx Cloud. Below is a view of all tasks in the [CI pipeline](https://staging.nx.app/runs/ctbAZfiLy3):

[![Grouped e2e tests in Nx Cloud](/blog/images/2024-05-07/nx-cloud-atomizer-groupings.gif)](https://staging.nx.app/runs/ctbAZfiLy3)

Notice how all e2e groups are collapsed by default to give a concise view, while allowing you to expand to see how each individual task is progressing!

To support this new feature, we've added the concept of `metadata` as a property of Nx projects. You can see this by running the command:
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved

```shell
nx show project e2e-angular --json | jq
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved
```

![Show Project JSON view](/blog/images/2024-05-07/show-project-json.webp)

Notice that the information on how the tasks are grouped is automatically inferred by your Nx Plugin and put into the `metadata` for your project! All Nx Plugins that support Atomization will do this automatically for you, and if you are writing a custom plugin for your own tool or special use-case, you can leverage this `targetGroups` property to group your targets in Nx and Nx Cloud tooling as well!

## More Project View Enhancements For Targets
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved

In addition to adding `metadata` to Nx projects, we've also added the concept of `metadata` for Nx tasks!

This means that you'll see additional information on tasks in the project detail web view:

![Technology icons in Project Detail View](/blog/images/2024-05-07/icon-in-project-detail-view.gif)

And in Nx Cloud:

![Technology icons in Nx Cloud](/blog/images/2024-05-07/nx-cloud-icons.gif)

This will help easily identify at-a-glance the technology your tasks are associated with. All this is supported out of the box by our plugins and you should see this as soon as updating to Nx 19.

To see how we support this new feature, checkout the json view of our project again:

```shell
nx show project e2e-angular --json | jq
```

![Highlighting target metadata](/blog/images/2024-05-07/highlight-target-metadata.webp)

Notice how tasks now have a `metadata` property including `technologies` and `description` properties. As with the Atomizer, any custom tools can also take advantage of these properties to enable this behavior in Nx and Nx Cloud tooling!

## Generators to Migrate to Project Crystal

As part of Nx 19, we've included migrations for our Playwright, Cypress, and ESLint plugins to allow you to easily opt into Project Crystal features!
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved

To migrate your workspace, you can use the command:

```shell
nx generate convert-to-inferred
```

Before running this command you could expect your project detail view to look like this:

```shell
nx show project my-react-app-e2e --web
```

![Before Migration](/blog/images/2024-05-07/before-migration.webp)

And after running the generator, you can expect your project detail view to look like this:

![After Migration](/blog/images/2024-05-07/after-migration.webp)

Notice that in addition to reducing the configuration in your `project.json` file, this generator will also turn on the Nx Atomizer for your Cypress and Playwright projects, so Nx will always shard your end-to-end tasks based on the tests present in your workspace going forward.
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved

As a note, if you cannot see `e2e-ci` tasks after migrating your cypress projects, you can [take a closer look here](https://nx.dev/nx-api/cypress/documents/overview#splitting-e2e-tasks-by-file) at how to configure them correctly.
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved

## BREAKING CHANGE: Updating Bundled Environment Variables: `NX_` to `NX_PUBLIC_`

An important update for folks using environment variables in their builds!

Previously, when building projects your projects in an Nx workspace, our builds were setup to include any environment variables prefixed with `NX_` and include them in the built artifact so they would be accessible there. This is often used for setting things like urls for different versions of external services to hit - for example, sending requests to your local development server while developing, but pointing to the production service for your production build.
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved

Going forward, these environment variables will need to be prefixed with `NX_PUBLIC_`. This is a security consideration - by requiring a more specific prefix we're making sure that no secrets end up in your production builds unintentionally!

Because of the nature of this change we will NOT be providing an automatic migration. So be sure to manually update any environment variables that you want bundled into your builds from `NX_` to `NX_PUBLIC_`.

## General Crystal Polishing

Along with the features above (many of which further build upon Nx Project Crystal), we've done quite a bit since Nx 18 to polish the features that we introduced with Project Crystal.
ZackDeRose marked this conversation as resolved.
Show resolved Hide resolved

You can find a full list of fixes and features applied in this major release [here](https://github.com/nrwl/nx/releases/tag/19.0.0).

[![Changelog for Nx 19](/blog/images/2024-05-07/fixes.gif)](https://github.com/nrwl/nx/releases/tag/19.0.0)

With Project Crystal landed now, we're also adjusting our priorities to place a higher importance on stability. You should see this reflected in Nx 19. In future cycles, we've also committed to continuing to reduce the total number of open github issues, and further increasing stability going forward.

## NEW CONFERENCE: Monorepo World 2024

[![NEW CONFERENCE: Monorepo World 2024](/blog/images/2024-05-07/welcome-to-monorepo-world-2024.webp)](https://monorepo.tools/conf)

We've got a new conference coming up: [Monorepo World 2024](https://monorepo.tools/conf)!

This conference will cover all things dealing with monorepos, and we're excited to host it at the Computer History Museum in Mountain View, California this October 7th!

You can [reserve your tickets now](https://ti.to/nx-conf/monorepoworld2024)! In person tickets start at $300 a piece for Early Bird (open until May 31), and online attendance is free.

The [Call for Speakers](https://sessionize.com/monorepo-world) is open now, and will close on June 20, 2024.

We'll be excited to see y'all there!

## Wrapping Up, And A Heartfelt Thank You

That's it for now!

I did want to take a moment to give a heartfelt thank you to everyone out there. If you weren't aware, I had something of a [personal tragedy](https://twitter.com/zackderose/status/1759695615573864758) in February, not long after our big launch week.

[![My Sadie.](/blog/images/2024-05-07/sadie.webp)](https://twitter.com/zackderose/status/1759695615573864758)

For me, this blogpost represents the beginning of my return to Nx, and to the larger dev community.

To everyone out there - your kindness and care meant more to me than you could know. I intend to return that the positivity and care you invested in me in those dark days back as best I can. So here's looking forward to hard work, more releases, and better days to come.

With Many Thanks,

Zack

## Learn more

- [Nx Docs](/getting-started/intro)
- [X/Twitter](https://twitter.com/nxdevtools) -- [LinkedIn](https://www.linkedin.com/company/nrwl/)
- [Nx GitHub](https://github.com/nrwl/nx)
- [Nx Official Discord Server](/community)
- [Nx Youtube Channel](https://www.youtube.com/@nxdevtools)
- [Speed up your CI](https://nx.app/)
Binary file added docs/blog/images/2024-05-07/after-migration.webp
Binary file not shown.
Binary file added docs/blog/images/2024-05-07/before-migration.webp
Binary file not shown.
Binary file added docs/blog/images/2024-05-07/fixes.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/blog/images/2024-05-07/nx-19-thumbnail.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/blog/images/2024-05-07/nx-cloud-icons.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added docs/blog/images/2024-05-07/sadie.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
25 changes: 25 additions & 0 deletions docs/changelog/19_0_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Nx 19

Nx 19.0 has landed, and it's ALL about reinforcing 💎Project Crystal💎!!!

Catch the details in this [blog post](/blog/2024-05-07-nx-19-release) and watch the video below:

{% youtube
src="https://youtu.be/U6eO8-w9DR0"
title="Nx 19.0 Has Landed!!"
/%}

## Features

{% cards cols="2" %}
{% card title="NEW PLUGIN: @nx/gradle" type="document" url="/blog/2024-05-07-nx-19-release#new-plugin-nxgradle" /%}
{% card title="Nx Atomizer Enhancements" type="document" url="/blog/2024-05-07-nx-19-release#nx-atomizer-enhancements" /%}
{% card title="More Project View Enhancements For Targets" type="document" url="/blog/2024-05-07-nx-19-release#more-project-view-enhancements-for-targets" /%}
{% card title="Generators to Migrate to Project Crystal" type="document" url="/blog/2024-05-07-nx-19-release#generators-to-migrate-to-project-crystal" /%}
{% card title="General Crystal Polishing" type="document" url="/blog/2024-05-07-nx-19-release#general-crystal-polishing" /%}
{% card title="NEW CONFERENCE: Monorepo World 2024" type="document" url="/blog/2024-05-07-nx-19-release#new-conference-monorepo-world-2024" /%}
{% /cards %}

## Breaking Changes

[Updating Bundled Environment Variables: `NX_` to `NX_PUBLIC_`](/blog/2024-05-07-nx-19-release#breaking-change-updating-bundled-environment-variables-to)