Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(experimental): future module using taint #173

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

juliusmarminge
Copy link
Member

@juliusmarminge juliusmarminge commented Jan 24, 2024

Closes #149

TODO

  • make it build, works in dev but when builidng we get errors complaining the taint api doesn't exist
  • remove the try-catch, even though it worked without them, we got some errors saying taint was not a function, worked around by wrapping in try catch. I assume it's different runtimes at play here that doesn't like eachother

Changes

Adds a /future module to the nextjs package that taints the server variables. This makes sure server variables are not leaked by enforcing:

  • they are not passed as props to client components
  • they are not rendered in the JSX
  • more???

Demo

taint.mp4

Copy link

vercel bot commented Jan 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
t3-env ❌ Failed (Inspect) Jan 24, 2024 9:15pm
t3-env-nextjs ❌ Failed (Inspect) Jan 24, 2024 9:15pm

@@ -1,10 +1,13 @@
import "./app/env.js";
// import "./app/env.js";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't import here since taint isn't "defined" yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explore integration with react's experimental taint api
1 participant