All Projects → blitz-js → babel-plugin-superjson-next

blitz-js / babel-plugin-superjson-next

Licence: MIT license
Automatically transform your Next.js Pages to use SuperJSON

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to babel-plugin-superjson-next

website
Fully responsive website built with NextJS, React and Fluent UI, with the aim of providing services and access to all groups of didactic courses and general purposes to students of the University of Milan.
Stars: ✭ 29 (-76.03%)
Mutual labels:  next-js
snaily-cadv3
> https://github.com/SnailyCAD/snaily-cadv4
Stars: ✭ 37 (-69.42%)
Mutual labels:  next-js
explorer
OONI Explorer: uncover evidence of internet censorship worldwide
Stars: ✭ 45 (-62.81%)
Mutual labels:  next-js
personal-website
Personal website – made with Next.js, Preact, MDX, RMWC, & Vercel
Stars: ✭ 16 (-86.78%)
Mutual labels:  next-js
next-test-api-route-handler
🚀✨ Confidently unit test your Next.js API routes/handlers in an isolated Next.js-like environment
Stars: ✭ 150 (+23.97%)
Mutual labels:  next-js

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, 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.

{
  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.

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

Contributing

  1. Clone the repo
  2. yarn
  3. 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):

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 specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].