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

fix: Replace CRA with Vite #2215

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changeset/ten-nails-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
101 changes: 51 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/chrome-extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<img src="https://images.clerk.com/static/logo-light-mode-400x400.png" height="64">
</picture>
</a>
<br />
<br />
</p>

# @clerk/chrome-extension
Expand Down Expand Up @@ -35,7 +35,7 @@ the <a href="https://clerk.com/docs/reference/node/getting-started?utm_source=gi

## Getting Started

To use this package you should first create a Clerk application and retrieve a `Publishable Key` for you application to be used as environment variables `REACT_APP_CLERK_PUBLISHABLE_KEY`.
To use this package you should first create a Clerk application and retrieve a `Publishable Key` for you application to be used as environment variables `VITE_CLERK_PUBLISHABLE_KEY`.

### Prerequisites

Expand All @@ -60,7 +60,7 @@ function HelloUser() {
return <p> Hello user</p>;
}

const publishableKey = process.env.REACT_APP_CLERK_PUBLISHABLE_KEY || '';
const publishableKey = process.env.VITE_CLERK_PUBLISHABLE_KEY || '';

function ClerkProviderWithRoutes() {
const navigate = useNavigate();
Expand Down
4 changes: 2 additions & 2 deletions packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ npm run dev

Clerk requires your application to be wrapped in the `<ClerkProvider/>` context.

If using Create React App, set `REACT_APP_CLERK_PUBLISHABLE_KEY` to your Publishable key in your `.env.local` file to make the environment variable accessible on `process.env` and pass it as the `publishableKey` prop.
If using Vite, set `VITE_CLERK_PUBLISHABLE_KEY` to your Publishable key in your `.env.local` file to make the environment variable accessible on `process.env` and pass it as the `publishableKey` prop.

```jsx
import { render } from 'react-dom';

import { ClerkProvider, SignedIn, SignedOut, SignInButton, UserButton } from '@clerk/clerk-react';

const publishableKey = process.env.REACT_APP_CLERK_PUBLISHABLE_KEY;
const publishableKey = process.env.VITE_CLERK_PUBLISHABLE_KEY;

render(
<ClerkProvider publishableKey={publishableKey}>
Expand Down
2 changes: 1 addition & 1 deletion playground/vite-react-ts/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_REACT_APP_CLERK_PUBLISHABLE_KEY=pk_test_************
VITE_CLERK_PUBLISHABLE_KEY=pk_test_************
2 changes: 1 addition & 1 deletion playground/vite-react-ts/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from '@clerk/clerk-react';
import { BrowserRouter, Route, Routes, useNavigate } from 'react-router-dom';

const clerkPubKey = import.meta.env.VITE_REACT_APP_CLERK_PUBLISHABLE_KEY;
const clerkPubKey = import.meta.env.VITE_CLERK_PUBLISHABLE_KEY;

function NavBar() {
return (
Expand Down
Loading