-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* draft a v0.20.0 blog post * grammar tweaks
- Loading branch information
1 parent
00696bd
commit 86ebee0
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
label: 'blog' | ||
title: v0.20.0 Release | ||
template: blog | ||
--- | ||
|
||
# Greenwood v0.20.0 | ||
|
||
## What's New | ||
|
||
<img src="/assets/nodejs.png" style="display: block; width: 30%; margin: 0 auto;"/> | ||
|
||
So although there are no new features in [this release](https://github.com/ProjectEvergreen/greenwood/releases/tag/v0.20.0), there is quite a major change incoming... we are proud and excited to announce Greenwood has moved towards [**ECMAScript Modules (ESM)**](https://nodejs.org/api/esm.html)!!! 📦 🥳 | ||
|
||
|
||
## Why We Did It | ||
It was a lot of work, and although ESM is not quite in a perfect place yet within the ecosystem (CJS <> ESM interop and the "dual module hazard"), there were two key motivations for us that made us want to make the jump now, especially before htting a 1.0 release. | ||
|
||
### Browser Parity ♻️ | ||
As Greenwood expands past just static sites with our upcoming plans to add support for [**Server Side Rendering**](https://github.com/ProjectEvergreen/greenwood/issues/708) and [**External Data Sources**](https://github.com/ProjectEvergreen/greenwood/issues/21), user's would be able to start writing server side code within their project's workspace. This meant there would be NodeJS and browser code right next to each other, and as part of Greenwood's [mission to make writing sites for the web easier](/about/), taking advantage of a consolidated module system makes perfect sense for developer experience. We want the NodeJS code you have to write to be as close to the code that you write for the browser, and so for Greenwood, this means supporting ESM in NodeJS. | ||
|
||
### Server Rendering 🚀 | ||
Additionally, libraries like [**Lit**](https://lit.dev/) that provide [support for SSR](https://github.com/lit/lit/tree/main/packages/labs/ssr) are themselves written in ESM and unfortutely because interop between CJS and ESM doesn't go both ways, we would not be able to support these projects if we stayed on CJS. For this reason, the first party code by users will need to be written in ESM. we also expect more packages to become ESM first / only, and so this helps us get ahead of an eventual migration anyway. | ||
|
||
|
||
## Upgrade Path | ||
As would be expected, there are some breaking changes and new conventions that come along with adopting ESM. If you are coming from an existing Greenwood application, you can follow the _Upgrade Notes_ in the release notes and check out some of our links in the _Learn More_ section below. 👇 | ||
|
||
|
||
## Learn More | ||
Below are some great resources to learn a bit more a CJS and ESM in NodeJS that are worth reading. In addition, the Greenwood website and all documentation examples have been written in ESM. | ||
|
||
- [Pure ESM Package](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) | ||
- [https://github.com/johnloy/esm-commonjs-interop-manual](https://github.com/johnloy/esm-commonjs-interop-manual) |