Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/blitz-js/babel-plugin-superjson-next
- Owner: blitz-js
- License: mit
- Created: 2020-08-04T15:14:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-17T18:02:39.000Z (17 days ago)
- Last Synced: 2024-12-21T11:20:41.303Z (14 days ago)
- Topics: blitz-js, json, next-js, react, superjson
- Language: TypeScript
- Homepage:
- Size: 1.93 MB
- Stars: 123
- Watchers: 4
- Forks: 15
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
X
Automatically transform your Next.js Pages to use SuperJSON.
SupportsgetStaticProps
&getServerSideProps
.## 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
π» πΉ π€ π§
Brandon Bayer
π€ π’
Nicolas Torres
π» β οΈ π
Benjamin Johnson
π» β οΈ π
Joris
π»
Alex Rohleder
π
Alex Johansson
π¬
Cyrus
π
Gabe O'Leary
π
jlmodell
π
Cheese
π
JuanM04
π
Pieter Venter
π
Santeri Elo
π»
Diego Albitres
π»
MichaΕ Miszczyszyn
π π
Γtalo Andrade
π π»
Vincas Stonys
π
Felipe Lima
π» π
Dante
π
Nils Haberkamp
π» π π
florian-milky
π
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!