Git Product home page Git Product logo

workers.cloudflare.com's Introduction

Welcome to Remix + Vite!

📖 See the Remix docs and the Remix Vite docs for details on supported features.

Development

Run the Vite dev server:

npm run dev

Deployment

First, build your app for production:

npm run build

Then run the app in production mode:

npm start

Now you'll need to pick a host to deploy it to.

DIY

If you're familiar with deploying Node applications, the built-in Remix app server is production-ready.

Make sure to deploy the output of npm run build

  • build/server
  • build/client

workers.cloudflare.com's People

Contributors

adamschwartz avatar albertozhao avatar ashleygwilliams avatar deadlypants1973 avatar ekwuno avatar electroid avatar everlastingbugstopper avatar greg-mckeon avatar gregbrimble avatar irvinebroque avatar isaac-mcfadyen avatar ispivey avatar jackpittenger avatar jbampton avatar jenvaccaro13 avatar jkup avatar kalepail avatar kristianfreeman avatar lauragift21 avatar obsidianminor avatar penalosa avatar rita3ko avatar rozenmd avatar swr avatar tombyrer avatar walshydev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

workers.cloudflare.com's Issues

Add `.live` property to Project schema

@signalnerve This came from a conversation @ashleygwilliams and I had earlier today. We felt like it would improve moderation ergonomics to have a project.live property (or isLive?—up to you) which we can use to filter projects from inclusion in collections on the homepage.

Currently, if you mark a project as a draft (to achieve a similar end goal), Sanity tells you that this will break the collections that project is a member of (which makes sense). So instead, if you were able to keep it "published" (as far as Sanity is concerned) but with the live flag turned off, we could still generate a /built-with/projects/slug page for it, but prevent it from showing on the homepage.

Screenshots will eventually get out of date

It might be worth it to periodically grab screenshots for websites featured on Built With Workers so they don't need to be manually updated every time a dev pushes a change.

Manual backups of data

After some weirdness with a collection being cleared out yesterday, @ashleygwilliams had a great idea – we should be backing up our data just in case – because it's all JSON, we can probably script something in GitHub Actions and then upload it to a KV namespace

Featured on Built with Workers Badge

This is just an idea, feel free to close if it seems bad/not worth it but I thought it would be cool to have a "Feature on Built With Workers" badge that we can give out to sites that are featured with the number of times they've been bookmarked

image

We could maybe even incorporate these badges on the marketing landing pages for products like Access, AMP Real URL, etc.

Deployed site browser history not working

When viewing the site at https://built-with-workers.signalnerve.workers.dev/built-with, if you click a project, then hit the browser back button, you’re not taken back to the homepage, but instead to the page you were on before (e.g. this Github issue page if you click the link from here, or about:blank if you open the page fresh).

This differs from the behavior locally (localhost:8000/built-with), in which hitting the back button correctly returns you to the built-with.js page.

Delete feature template

"Features" (features of Cloudflare Workers) are not shipping as a first class citizen in the MVP, so we’re going to delete the template for these (for now).

Fix asset references to `url()` in CSS files

@signalnerve I’d love your help figuring out how to fix the issues with references to assets via url() in CSS files, e.g. https://github.com/cloudflare/built-with-workers/blob/3cc6e304d0cafcad498af5553048cbfb23d8af44/src/vendor/workers-brand-assets/css/components/unordered-list.css#L1-L18

For now I manually replaced them with inlined assets to workaround the issue, but once #41 happens we’ll need a real solution.

I’m not sure if Gatsby/Sanity/React/(Our setup) offers this level of control, but I’d love to be able to reference the files externally but then have the bundling inline them or not depending on our preferences. (In some cases, inlining may have the best performance trade-off characteristics.) Looking forward to hacking on this stuff together @signalnerve!

Horizontal scroll persistence

When you hit back from an individual project page, you lose your horizontal scroll position for the collections on the index page.

Horizontal Scrolling and Getting Stuck

I can't click and drag and I don't have a horiz scrolling mousewheel right now (travelling) so I got stuck trying to move the carousel to the right.

Trackpad works fine, but without a scrollbar or some arrow on the sides, this feels like a bad pattern.

I would add subtle arrows on the sides for desktop with a hover that makes them bolder so they don't get in the way too much. User clicks and it should slide the carousel over about 80% of screen.

Feedback/review needed: Project URL

We should finalize the URL for this project so we can prepare accordingly for:

  • Gatsby's URL configuration (located in gatsby-config.js) - this will affect how the production URLs are generated
  • The Workers script configuration. If this is living on workers.cloudflare.com, for instance, we should figure how to correctly have both the landing page and built-with URLs render from two different deploys

These are not original ideas (they're @adamschwartz's from our past convos about this project), but I have two open questions around this topic:

  1. What should the URL for this project be? FWIW, I like the idea of having it live somewhere at workers.cloudflare.com.
  2. If we proceed with workers.cloudflare.com, can we just move the landing page (workers.cloudflare.com) into this codebase? It's two pages with extremely similar CSS that we could just drop wholesale into pages/, wrap in a React component, and be ready to go (I think 😅 – I would block off a day to get it working)

Adam's proposal for this project's URL was workers.cloudflare.com/built-with, which I think looks super cool and is easy to remember.

The other options URL options I've considered or heard mentioned in passing are:

  • www.built-with.workers.dev (using the www hack that @EverlastingBugstopper discovered recently). I don't know if we want to promote this hack, but it does look cool :)
  • built-with.workers.cloudflare.com – no script clashes between the landing page and this Workers Sites project, and it matches the name of the project. My understanding is that the landing page and this subdomain wouldn't share SEO juice, so that would be a potential downside for this option.

Other ideas? cc @ashleygwilliams @rita3ko, feel free to @ anyone else who wouldn't get the Workers DevEx Team ping for this issue being opened. Sorry that there's a few questions interleaved in here!

Ensure document has a non-empty `<title>`

We’re doing pretty well on the others, but SEO is struggling.

image

e.g. It appears we’re not SSR-ing the <title/> element, and we’re serving a 500 status code for /robots.txt.

Create CONTRIBUTING.md

Create a contribution guide that outlines:

  • What this project is from an open-source perspective (what the code is, whether you can run it locally or not, etc)
  • Contributions we're accepting
  • Contributions we're not accepting
  • How to give feedback on content on the project

Initial design plan

Workers design planning

Here we’ll discuss the initial plan for the design of the Built with Workers site. This document was put together by @adamschwartz and @signalnerve with help from @remyguercio and based on research and input from the broader Workers team.

Terminology

  • Project – a website, API, service, etc. built partially or wholly with Workers.
  • Feature badge – a feature of Workers (e.g. Workers KV) that a project may use, displayed in a way to associate it with the project.

High-level goals of the site

Each goal is listed in a rough priority order. Meaning, for our MVP, we seek to achieve goal 1 stronger than goal 4. Note though that these are somewhat overlapping goals, and design is an art as well as a science, so it’s OK if we’re not strict here.

  1. Answers the question "What can I build?"
    • Directly answers this question for anyone interested in Workers.
    • Gives Sales and Support the power to answer that question when it comes.
  2. Showcases real projects
    • (As opposed to examples say in the docs which would be more for learning and thus stripped down and not necessarily live production apps/services.)
    • Bonus: a featured project can function as a sort-of case study, perhaps containing quotes or other supporting material to make a stronger case.
  3. Provides a consistent experience with the Workers homepage
    • Intuitive and coherent navigation between the two helps synthesize concepts, particularly when deep linking between the two occurs. (For example, the item view page for a project built with Workers Sites linking to the Workers Sites landing page.)
    • Begin to mature and solidify the Workers brand.
  4. Helps people "put the pieces together"
    • e.g. How do I use Workers Sites with HTMLRewriter?
    • Bring clarity to complex docs by telling a coherent story.

Features

These are also sorted in rough priority order. Same lack-of-strictness applies.

  • Listing page
    • Default to manual sort (e.g. via order property similar Cloudflare Apps)
    • Listing page item
      • Project title
      • Project image
      • Feature badges
        • Icons
      • Project source
        • Avatar (user/company) image
        • Link
      • Featured boolean
      • Difficulty level?
    • Allow user-enabled sorting (date added, alphabetical, popularity [claps])
  • Individual project page
    • Everything from "Listing page item" above, plus:
      • Project description
      • Optional image gallery
      • Optional quote
      • Claps1
      • Edit link to GH issue with prefilled content
  • Open-sourcing the Built with Workers site itself

[1]: We’re particularly excited about using Workers KV to build this (and showcasing that as Built with Workers itself will likely be a featured project of the site—yes, how meta of us).

Not doing (for MVP)

Here are a few of the things we considered building but decided against for the MVP. By no means should this list be considered exhaustive. We are happy to consider them after we slap down a v1.

  • Feature pages (KV, HTMLRewriter, Wrangler)
    • Hero art
    • Descriptions
  • Examples of features of an app you can build (a login flow, a redirect, an optimized image)
    • Live code feature examples with preview
    • Code as reference
  • Admin author display ("signalnerve edited 4 hrs ago")

Potential list of feature badges

We think feature badges are going to be really fun. But we’re not sure exactly how they’ll work. We may have categories of these which could be distinguished e.g. by color.

  • Workers features (proper badges) (orange)
    • Workers KV
    • Workers Sites
    • HTLMRewriter
    • WASM
    • Cache API
  • Things that supercharge you (blue)
    • workers.dev
    • Github Action
    • Wrangler
  • Tools to help you build with Workers (purple)
    • React
    • Gatsby
    • Svelte
    • etc.

Content

We plan to take a content-driven approach for the initial design. This is generally a solid approach to design, but it’s especially critical when designing a site whose content is generated by someone other than the designer.

Projects

The main content of course are the projects. So, with the help of @remyguercio we generated an initial list. If you know of know of any projects we missed, please let us know!

Mockups

I know y’all want to see pretty pictures. I promise, they will soon exist. However, at this stage we feel it’s more important to share the plan, get feedback, and build consensus before drawing a bunch of rectangles.

Normalize collections, projects, and features at the GraphQL layer

The normalizeCollection function (https://github.com/cloudflare/built-with-workers/blob/master/src/utils.js#L3-L23) is a pretty big hack for a limitation in the Sanity/Gatsby GraphQL integration, where we don't have access to belongsTo-style data modeling. Instead of normalizing it at the component layer, my friend at Sanity has suggested implementing it in gatsby-node.js, so that by the time the component makes the GraphQL query, the data has already been normalized in the way we need it to be. This isn't a blocker but a good refactor to consider after v1.

Bookmark component refactoring

Some of the existing issues:

  • The way <Bookmark/> is non-transparently morphed/overloaded to represent both <BookmarkIndicator/> and <BookmarkButton/> is confusing.

  • The Project components is not "aware" of its bookmarked status (there’s no project.bookmarked) which is why we end up needing to use CSS classNames like Project--bookmark inside of the Bookmark component. This means you can’t properly render the DOM for <Project/>s not bookmarked, and it means the Bookmark component is not reusable.

  • The render path also produces a different DOM structure depending on whether the component is rendered in the browser vs. at the edge.

My rough proposal would be the following:

  • Break up Bookmark into two components, BookmarkIndicator and BookmarkButton, and they would share code from a "helper" JS file called bookmark.js placed somewhere else in src (not the src/components directory), to handle the ES vs. browser logic.

  • Move the bookmark status storage into a helper or into Project, and pass a boolean into the Bookmark component to allow it to determine how to render itself.

cc @signalnerve

Update Project schema

as per convo with @adamschwartz on Friday, the project schema should resemble the following:

title: '' // text
shortDescription: '' // text
longDescription: '' // markdown

links: [
  link: {
    url: 'https://workers.cloudflare.com' // url
    type: 'website' // `website`, `twitter`, `code`, `blog-post`, etc.
    primary: Boolean
  },
  //...
]

developer: {
  image: { /* ... */ },
  name: '' // text
}

claps: 0 // number – unsure if this will actually live in sanity

Mobile nav

We should probably have something simple at the very least to get us through the initial release. Currently on mobile, you can click the logo to go back to https://workers.cloudflare.com and there’s a login button as well. But there’s no way to get directly to the Docs from the /built-with e.g. I won’t set this as a blocker for the MVP release, since once you tap the logo then you can get anywhere. But the current situation is certainly less than ideal, and I don’t want to let the "Docs Redesign" project hold this up. We should be using this site as a way to experiment while we work on the grand nav plan for the long term.

Replace vendored assets with proper NPM package management

Clap display issues

There’s two (I believe related) issues with the display behavior of the Clap component.

  1. If you navigate from any page into a page which has a clap in it, the clap won’t load. But if you load that page directly, it does:

    gif

    I think this may be because the <script id="claps_json"/> is in the DOM when the worker returns SSRs the page directly, but not when you navigate there from another page.

  2. When a page with a clap in it loads, the page renders a frame without the clap in it before it renders the clap in it, effectively creating a FOUC.

    gif

    Outside of React-world, I’d easily work around this by e.g. putting a placeholder wrapper element which has a fixed height, waiting for the clap to "fill in" the placeholder. But in this case, doing that would break the component paradigm as it would have to be code outside of the clap component itself (I assume because of the way useEffect and setESR are working together). Moreover, in the case where we’re doing a direct load of the page SSR is inlining the clap JSON, so nothing asynchronous should need to be happening.

    This is where 1) and 2) become intertwined. Once 1) above is solved, that would necessitate solving 2) in an additional way. We not only need to avoid FOUC on the direct project page loads, but also when navigating to a project page from another page (e.g. the /built-with page, or one day, other parts of this Gatsby site which may deep link to a project).

Planning: Moving landing page content to this repository

Per #9, we are exploring moving the landing page content into this codebase, which will serve as the new home for everything on workers.cloudflare.com.

My early attempts at getting the content from that site (two pages) to load has been fairly successful: this is after about 20min of work.

Screen Shot 2019-11-14 at 1 31 53 PM

There's a bunch of vendored CSS in this repository that is shared with the landing page – Adam and I have been discussing how to effectively move it back into the landing page repo (or vendoring the assets appropriately so that it can be shared between them), but by merging that content into this repo, we're effectively putting off that problem for the immediate future, as this repo can become the definitive source for the CSS and the content for both sites.

Before we move ahead on this, we'll need to explore a couple additional things:

  • The current Workers script for the landing page has a redirect set up to send all /docs* requests to the Workers docs (developers.cloudflare.com/workers). The code for that is in workers-site/index.js. We should either move that into the script for this project, or potentially compose a new script that just lives on /docs* and takes higher precedence over the script for this application. The benefit there would be that potentially we could show off this project as a pure JAMstack app using the default Workers Sites script ("It works with no additional config – look!").
  • Building off of the last point, we're now in the GTM task territory of "We're open sourcing our landing page" – I'm +1 on this, but want to make sure everyone is in on that. This will have a similar effect to the docs, where we then need to be more discerning about open PRs that indicate new features, etc. Again, I'm also +1 after all of that, but it seems like something that needs #socializing :)

Gatsby (running locally) crashes when an images is swapped in Sanity

I noticed this just now as I was changing some project images.

If in Sanity I upload a new image for a project and then hit publish, I see this in my terminal:

/Users/[redacted]/.nvm/versions/node/v8.12.0/lib/node_modules/gatsby-cli/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

TypeError: Cannot read property 'write' of null
    at Zlib.callback (zlib.js:499:33)

Hero design

The list view needs something above the fold to establish the page.

Could be just "Built with Workers", could have an illustration or animation, or something fancier. For MVP, a stylized h1 may be good enough.

Collections

Collections should be a new top-level schema that is used on the homepage to compose collections of projects. This should be fairly open-ended so we can do things like "Ecommerce" or "Built with HTMLRewriter".

My proposal is that collections should have two modes, one where you can set a tag (e.g. "Build with HTMLRewriter"), which will automatically inherit all the projects for that tag, and manual, where we can specify our own set of projects (such as "Featured", "Staff Picks", etc) and manually order them how we'd prefer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.