-
Notifications
You must be signed in to change notification settings - Fork 69
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: migrate to cloudflare pages and vite (Work in progress) #81
Changes from all commits
b243d6a
7d44539
a78bd5d
04fff67
eca189d
1189877
cca16c0
035e493
c91f97a
7f9c6a2
2a8e24b
eb6dc38
ae3968d
6de44b6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20.14 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
legacy-peer-deps=true |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @benvinegar, I have previously added this endpoint to test movement of /collect from CF function to remix. I have tested this with mine https://cs.usevega.com and seems to be working fine, do you want to have this change included with this PR or may be in later iteration? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @BhanuNexus I started the I'm going to close this PR in the meantime. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { LoaderFunctionArgs } from "@remix-run/cloudflare"; | ||
import { collectRequestHandler } from "~/analytics/collect"; | ||
|
||
export async function loader({ request, context }: LoaderFunctionArgs) { | ||
return collectRequestHandler(request, context.cloudflare.env); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/// <reference types="@remix-run/cloudflare" /> | ||
/// <reference types="vite/client" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think generally speaking, this change isn't really related to migrating to
vite
, and more of a separate personal choice that's been inserted (same with renamingEnvironment
toEnv
).I'll keep it (it's more clear I suppose) but generally it's best to not to couple these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, this
AnalyticsEngineDataset
type is directly from@cloudflare/workers-types
So, syntaxes and change tracking are aligned with CF.
Regarding
Env
, I personally preferEnvironment
whatever you have set but cloudflare auto generates types fromwrangler.toml
toworker-configuration.d.ts
by usingwrangler types
, that is the reason I have removedEnvironment
and reusedEnv
fromworker-configuration.d.ts