• Stars
    star
    125
  • Rank 278,773 (Top 6 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Automatically transform your Next.js Pages to use SuperJSON

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!

More Repositories

1

blitz

⚑️ The Missing Fullstack Toolkit for Next.js
TypeScript
13,434
star
2

superjson

Safely serialize JavaScript expressions to a superset of JSON, which includes Dates, BigInts, and more.
TypeScript
3,746
star
3

next-superjson-plugin

SuperJSON Plugin for Next.js Pages and Components
Rust
182
star
4

blitzjs.com

Website & docs
MDX
179
star
5

awesome-blitzjs

Curated list of awesome resources for blitz.js
89
star
6

blitzjs.com-translation

Nexus of resources and tools for translating the Blitz docs.
TypeScript
14
star
7

ja.blitzjs.com

(Work in progress) Blitzjs.com website in Japanese!
JavaScript
13
star
8

github-bot

Our very own Github Bot
TypeScript
6
star
9

codesandbox-template

TypeScript
5
star
10

drafts

A place for RFCs and other documents to be drafted before official publication
5
star
11

zh-hans.blitzjs.com

(Work in progress) Blitzjs.com website in Simplified Chinese!
JavaScript
4
star
12

fr.blitzjs.com

(Work in progress) Blitzjs.com website in French!
JavaScript
4
star
13

blitz-realworld-example

TypeScript
4
star
14

art

Blitz.js Branding Assets
3
star
15

es.blitzjs.com

(Work in progress) Blitzjs.com website in Spanish!
JavaScript
3
star
16

discord-bot

The bot used on the Blitz Community discord server
TypeScript
3
star
17

id.blitzjs.com

(Work in progress) Blitzjs.com website in Indonesian!
JavaScript
2
star
18

community-intros-matcher

Algorithm to generate community intros matches.
TypeScript
2
star
19

legacy-framework

JavaScript
2
star
20

versions-diff-web

A web tool to support Blitz developers in upgrading their apps.
JavaScript
2
star
21

versions-diff

Shell
2
star
22

pt-br.blitzjs.com

(Work in progress) Blitzjs.com website in Brazilian Portuguese!
JavaScript
1
star
23

it.blitzjs.com

(Work in progress) Blitzjs.com website in Italian!
JavaScript
1
star
24

ko.blitzjs.com

(Work in progress) Blitzjs.com website in Korean!
JavaScript
1
star