Skip to content

Conversation

@jonathannorris
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented Sep 20, 2023

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

Name Status Preview Comments Updated (UTC)
js-sdks-next-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 19, 2023 2:52pm
js-sdks-web-elements ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 19, 2023 2:52pm
js-sdks-with-provider ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 19, 2023 2:52pm

@jonathannorris jonathannorris changed the title feat: adding Cloudflare Worker example app for js-cloud-server-sdk feat: DVC-9055 adding Cloudflare Worker example app for js-cloud-server-sdk Sep 20, 2023
@jonathannorris jonathannorris changed the title feat: DVC-9055 adding Cloudflare Worker example app for js-cloud-server-sdk feat: DVC-9055 adding Cloudflare Worker example app for new js-cloud-server-sdk Sep 20, 2023
Comment on lines 37 to 40
RESPONSE=$(curl -s http://localhost:8787) # Replace with your server's port
# Check the response or do something based on the result.
if [[ "$RESPONSE" != *"DevCycle Variables:"* ]]; then
echo "Server didn't return the expected 'DevCycle Variables:' response"
exit 1
fi
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
RESPONSE=$(curl -s http://localhost:8787) # Replace with your server's port
# Check the response or do something based on the result.
if [[ "$RESPONSE" != *"DevCycle Variables:"* ]]; then
echo "Server didn't return the expected 'DevCycle Variables:' response"
exit 1
fi
RESPONSE=$(curl -s http://localhost:8787)
if [[ "$RESPONSE" != *"DevCycle Variables:"* ]]; then
echo "Server didn't return the expected 'DevCycle Variables:' response"
exit 1
fi

Copy link
Member

Choose a reason for hiding this comment

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

Also - would you not want to do more clear sanitizing and checks via jq?

Copy link
Member Author

Choose a reason for hiding this comment

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

we can, I'm more interested in if it actually returns anything and doesn't throw a worker error, which this checks for.

Comment on lines 37 to 40
RESPONSE=$(curl -s http://localhost:8787) # Replace with your server's port
# Check the response or do something based on the result.
if [[ "$RESPONSE" != *"DevCycle Variables:"* ]]; then
echo "Server didn't return the expected 'DevCycle Variables:' response"
exit 1
fi
Copy link
Member

Choose a reason for hiding this comment

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

Also - would you not want to do more clear sanitizing and checks via jq?

Comment on lines 6 to 21
"target": "es2021" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"lib": ["es2021"] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
"jsx": "react" /* Specify what JSX code is generated. */,
"module": "es2022" /* Specify what module code is generated. */,
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
"types": ["@cloudflare/workers-types"] /* Specify type package names to be included without being referenced in a source file. */,
"resolveJsonModule": true /* Enable importing .json files */,
"allowJs": true /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */,
"checkJs": false /* Enable error reporting in type-checked JavaScript files. */,
"noEmit": true /* Disable emitting files from a compilation. */,
"isolatedModules": true /* Ensure that each file can be safely transpiled without relying on other imports. */,
"allowSyntheticDefaultImports": true /* Allow 'import x from y' when a module doesn't have a default export. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,

"strict": true /* Enable all strict type-checking options. */,
"skipLibCheck": true /* Skip type checking all .d.ts files. */
Copy link
Member

Choose a reason for hiding this comment

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

Why all the comments?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not comments? It's actually kinda nice having an explanation for each setting.
I'm assuming this is one of those flavors of JSON that allows comments, like the VS Code config files.

Copy link
Member Author

Choose a reason for hiding this comment

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

These comments were all from the example app I generated using Cloudflare's CLI.

Copy link
Member

Choose a reason for hiding this comment

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

We should do that for our cli too

Copy link
Member

Choose a reason for hiding this comment

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

We should do that for our cli too, and maybe the sdk proxy too

@jonathannorris jonathannorris force-pushed the DVC-9055-add-cf-example-app branch from 4f3188b to 65c293b Compare October 18, 2023 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants