Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/blitz-js/babel-plugin-superjson-next

Automatically transform your Next.js Pages to use SuperJSON
https://github.com/blitz-js/babel-plugin-superjson-next

blitz-js json next-js react superjson

Last synced: 6 days ago
JSON representation

Automatically transform your Next.js Pages to use SuperJSON

Awesome Lists containing this project

README

        


superjson
X
next.js


Automatically transform your Next.js Pages to use SuperJSON.
Supports getStaticProps & getServerSideProps.



All Contributors


npm


CI

## Getting started

Install the library with your package manager of choice, e.g.:

```
npm install babel-plugin-superjson-next
```

Since this is a companion to [SuperJSON](https://github.com/blitz-js/superjson),
make sure it's also installed:

```
npm install superjson
```

> for npm 7 or later, you can skip this since from npm v7 automatically installs peer dependencies

Add the plugin to your `.babelrc`.
If you don't have one, create it.

```json5
{
presets: ['next/babel'],
plugins: [
...
'superjson-next' // πŸ‘ˆ
]
}
```

That's it! Now you're free to use all values and type supported by SuperJSON in your Next.js Components.

### Options

You can use the `exclude` option to exclude specific properties from serialisation.

```json5
{
presets: ['next/babel'],
plugins: [
...
['superjson-next', { exclude: ["someProp"] }]
]
}
```

## Contributing

1. Clone the repo
1. `yarn`
1. `yarn build`

### Test Example App

1. `cd example`
2. `yarn` (make sure you first run `yarn build` in the repo root)
3. `yarn test`

## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):



Simon Knott
Simon Knott

πŸ’» πŸ“Ή πŸ€” 🚧
Brandon Bayer
Brandon Bayer

πŸ€” πŸ“’
Nicolas Torres
Nicolas Torres

πŸ’» ⚠️ πŸ›
Benjamin Johnson
Benjamin Johnson

πŸ’» ⚠️ πŸ›
Joris
Joris

πŸ’»
Alex Rohleder
Alex Rohleder

πŸ›
Alex Johansson
Alex Johansson

πŸ’¬


Cyrus
Cyrus

πŸ›
Gabe O'Leary
Gabe O'Leary

πŸ›
jlmodell
jlmodell

πŸ›
Cheese
Cheese

πŸ›
JuanM04
JuanM04

πŸ›
Pieter Venter
Pieter Venter

πŸ›
Santeri Elo
Santeri Elo

πŸ’»


Diego Albitres
Diego Albitres

πŸ’»
MichaΕ‚ Miszczyszyn
MichaΕ‚ Miszczyszyn

πŸ› πŸ”Œ
Ítalo Andrade
Ítalo Andrade

πŸ› πŸ’»
Vincas Stonys
Vincas Stonys

πŸ›
Felipe Lima
Felipe Lima

πŸ’» πŸ›
Dante
Dante

πŸ“–
Nils Haberkamp
Nils Haberkamp

πŸ’» πŸ”Œ πŸ›


florian-milky
florian-milky

πŸ›

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!