Skip to content

Commit

Permalink
Added update instructions (#457)
Browse files Browse the repository at this point in the history
* Added update instructions

* Mandatory emoji

* made link to UPDATE relative

* Fixes after review

* 1.x in upgrade guide

* version bump
  • Loading branch information
lmammino committed Jan 5, 2020
1 parent e66e994 commit d3c32ce
Show file tree
Hide file tree
Showing 54 changed files with 182 additions and 145 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
</p>
</div>

**⚠️ UPGRADE NOTICE: if you are updating from Middy 0.x, check out the [update instructions](UPDATE.md)!**

## What is Middy

Middy is a very simple middleware engine that allows you to simplify your AWS Lambda code when using Node.js.
Expand Down
35 changes: 35 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 0.x -> 1.x

## Independent packages structure

Version 1.x of Middy features decoupled independent packages published on npm under the `@middy` namespace. The core middleware engine has been moved to [`@middy/core`](https://www.npmjs.com/package/@middy/core) and all the other middlewares are moved into their own packages as well. This allows to only install the features that are needed and to keep your Lambda dependencies small. See the list below to check which packages you need based on the middlewares you use:

- Core middleware functionality -> [`@middy/core`](https://www.npmjs.com/package/@middy/core)
- `cache` -> [`@middy/cache`](https://www.npmjs.com/package/@middy/cache)
- `cors` -> [`@middy/http-cors`](https://www.npmjs.com/package/@middy/http-cors)
- `doNotWaitForEmptyEventLoop` -> [`@middy/do-not-wait-for-empty-event-loop`](https://www.npmjs.com/package/@middy/do-not-wait-for-empty-event-loop)
- `httpContentNegotiation` -> [`@middy/http-content-negotiation`](https://www.npmjs.com/package/@middy/http-content-negotiation)
- `httpErrorHandler` -> [`@middy/http-error-handler`](https://www.npmjs.com/package/@middy/http-error-handler)
- `httpEventNormalizer` -> [`@middy/http-event-normalizer`](https://www.npmjs.com/package/@middy/http-event-normalizer)
- `httpHeaderNormalizer` -> [`@middy/http-header-normalizer`](https://www.npmjs.com/package/@middy/http-header-normalizer)
- `httpMultipartBodyParser` -> [`@middy/http-json-body-parser`](https://www.npmjs.com/package/@middy/http-json-body-parser)
- `httpPartialResponse` -> [`@middy/http-partial-response`](https://www.npmjs.com/package/@middy/http-partial-response)
- `jsonBodyParser` -> [`@middy/http-json-body-parser`](https://www.npmjs.com/package/@middy/http-json-body-parser)
- `s3KeyNormalizer` -> [`@middy/s3-key-normalizer`](https://www.npmjs.com/package/@middy/s3-key-normalizer)
- `secretsManager` -> [`@middy/secrets-manager`](https://www.npmjs.com/package/@middy/secrets-manager)
- `ssm` -> [`@middy/ssm`](https://www.npmjs.com/package/@middy/ssm)
- `validator` -> [`@middy/validator`](https://www.npmjs.com/package/@middy/validator)
- `urlEncodeBodyParser` -> [`@middy/http-urlencode-body-parser`](https://www.npmjs.com/package/@middy/http-urlencode-body-parser)
- `warmup` -> [`@middy/warmup`](https://www.npmjs.com/package/@middy/warmup)


## Header normalization in `http-header-normalizer`

In Middy 0.x the `httpHeaderNormalizer` middleware normalizes HTTP header names into their own canonical format, for instance `Sec-WebSocket-Key` (notice the casing). In Middy 1.x this behavior has been changed to provide header names in lowercase format (e.g. `sec-webSocket-key`). This new behavior is more consistent with what Node.js core `http` package does and what other famous http frameworks like Express or Fastify do, so this is considered a more intuitive approach.
When updating to Middy 1.x, make sure you double check all your references to HTTP headers and switch to the lowercase version to read them.
All the middy core modules have been already updated to support the new format, so you should worry only about your userland code.


## Node.js 10 and 12 now supported / Node.js 6 and 8 now dropped

Version 1.x of Middy no longer supports Node.js versions 6.x and 8.x as these versions have been dropped by the AWS Lambda runtime itself and not supported anymore by the Node.js community. You are highly encouraged to move to Node.js 12 or 10, which are the new supported versions in Middy 1.x.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"packages": [
"packages/*"
],
"version": "1.0.0-alpha.64"
"version": "1.0.0-alpha.65"
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "middy-monorepo",
"version": "1.0.0-alpha.64",
"version": "1.0.0-alpha.65",
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda",
"engines": {
"node": ">=10"
Expand Down
8 changes: 4 additions & 4 deletions packages/cache/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/cache/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/cache",
"version": "1.0.0-alpha.64",
"version": "1.0.0-alpha.65",
"description": "Cache middleware for the middy framework",
"engines": {
"node": ">=10"
Expand Down Expand Up @@ -41,7 +41,7 @@
"@middy/core": ">=1.0.0-alpha"
},
"devDependencies": {
"@middy/core": "^1.0.0-alpha.64",
"@middy/core": "^1.0.0-alpha.65",
"es6-promisify": "^6.0.2"
},
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/core",
"version": "1.0.0-alpha.64",
"version": "1.0.0-alpha.65",
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda (core package)",
"engines": {
"node": ">=10"
Expand Down
8 changes: 4 additions & 4 deletions packages/db-manager/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/db-manager/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/db-manager",
"version": "1.0.0-alpha.64",
"version": "1.0.0-alpha.65",
"description": "Simple database manager for the middy framework",
"engines": {
"node": ">=10"
Expand Down Expand Up @@ -40,7 +40,7 @@
"knex": "^0.17.3"
},
"devDependencies": {
"@middy/core": "^1.0.0-alpha.64"
"@middy/core": "^1.0.0-alpha.65"
},
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
}
8 changes: 4 additions & 4 deletions packages/do-not-wait-for-empty-event-loop/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/do-not-wait-for-empty-event-loop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/do-not-wait-for-empty-event-loop",
"version": "1.0.0-alpha.64",
"version": "1.0.0-alpha.65",
"description": "Middleware for the middy framework that allows to easily disable the wait for empty event loop in a Lambda function",
"engines": {
"node": ">=10"
Expand Down Expand Up @@ -41,7 +41,7 @@
"@middy/core": ">=1.0.0-alpha"
},
"devDependencies": {
"@middy/core": "^1.0.0-alpha.64",
"@middy/core": "^1.0.0-alpha.65",
"es6-promisify": "^6.0.2"
},
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
Expand Down
8 changes: 4 additions & 4 deletions packages/error-logger/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/error-logger/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/error-logger",
"version": "1.0.0-alpha.64",
"version": "1.0.0-alpha.65",
"description": "Input and output logger middleware for the middy framework",
"engines": {
"node": ">=10"
Expand Down Expand Up @@ -47,7 +47,7 @@
"@types/node": "^10.0.8"
},
"devDependencies": {
"@middy/core": "^1.0.0-alpha.64",
"@middy/core": "^1.0.0-alpha.65",
"es6-promisify": "^6.0.2"
},
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
Expand Down
8 changes: 4 additions & 4 deletions packages/function-shield/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/function-shield/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/function-shield",
"version": "1.0.0-alpha.64",
"version": "1.0.0-alpha.65",
"description": "Hardens AWS Lambda execution environment",
"engines": {
"node": ">=10"
Expand Down Expand Up @@ -45,7 +45,7 @@
"@puresec/function-shield": "^1.2.2"
},
"devDependencies": {
"@middy/core": "^1.0.0-alpha.64",
"@middy/core": "^1.0.0-alpha.65",
"es6-promisify": "^6.0.2"
},
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
Expand Down
8 changes: 4 additions & 4 deletions packages/http-content-negotiation/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/http-content-negotiation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/http-content-negotiation",
"version": "1.0.0-alpha.64",
"version": "1.0.0-alpha.65",
"description": "Http content negotiation middleware for the middy framework",
"engines": {
"node": ">=10"
Expand Down Expand Up @@ -47,7 +47,7 @@
"@middy/core": ">=1.0.0-alpha"
},
"devDependencies": {
"@middy/core": "^1.0.0-alpha.64",
"@middy/core": "^1.0.0-alpha.65",
"es6-promisify": "^6.0.2"
},
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
Expand Down
4 changes: 2 additions & 2 deletions packages/http-cors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

<div align="center">
<p>
<a href="http://badge.fury.io/js/%40middy%2Fcors">
<img src="https://badge.fury.io/js/%40middy%2Fcors.svg" alt="npm version" style="max-width:100%;">
<a href="http://badge.fury.io/js/%40middy%2Fhttp-cors">
<img src="https://badge.fury.io/js/%40middy%2Fhttp-cors.svg" alt="npm version" style="max-width:100%;">
</a>
<a href="https://snyk.io/test/github/middyjs/middy">
<img src="https://snyk.io/test/github/middyjs/middy/badge.svg" alt="Known Vulnerabilities" data-canonical-src="https://snyk.io/test/github/middyjs/middy" style="max-width:100%;">
Expand Down
8 changes: 4 additions & 4 deletions packages/http-cors/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/http-cors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/http-cors",
"version": "1.0.0-alpha.64",
"version": "1.0.0-alpha.65",
"description": "CORS (Cross-Origin Resource Sharing) middleware for the middy framework",
"engines": {
"node": ">=10"
Expand Down Expand Up @@ -42,7 +42,7 @@
"@middy/core": ">=1.0.0-alpha"
},
"devDependencies": {
"@middy/core": "^1.0.0-alpha.64",
"@middy/core": "^1.0.0-alpha.65",
"es6-promisify": "^6.0.2"
},
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
Expand Down
8 changes: 4 additions & 4 deletions packages/http-error-handler/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/http-error-handler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@middy/http-error-handler",
"version": "1.0.0-alpha.64",
"version": "1.0.0-alpha.65",
"description": "Http error handler middleware for the middy framework",
"engines": {
"node": ">=10"
Expand Down Expand Up @@ -47,7 +47,7 @@
"http-errors": "^1.6.3"
},
"devDependencies": {
"@middy/core": "^1.0.0-alpha.64",
"@middy/core": "^1.0.0-alpha.65",
"es6-promisify": "^6.0.2"
},
"gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
Expand Down
8 changes: 4 additions & 4 deletions packages/http-event-normalizer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d3c32ce

Please sign in to comment.