• Stars
    star
    125
  • Rank 286,335 (Top 6 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 1 year 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,675
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
180
star
5

awesome-blitzjs

Curated list of awesome resources for blitz.js
90
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

it.blitzjs.com

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

ko.blitzjs.com

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

pt-br.blitzjs.com

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