https://discord.cloudflare.com logo
Join Discord
Powered by
# durable-objects
  • k

    kristian

    04/19/2021, 4:18 PM
    hmm, has anyone deployed https://github.com/cloudflare/durable-objects-rollup-esm recently? i haven't tried it yet and just went to do my first project,
    env.COUNTER
    seems to be undefined
  • g

    Greg Brimble | Cloudflare Pages

    04/19/2021, 4:20 PM
    I haven't with v1.16, but I did with the RCs.
  • g

    Greg Brimble | Cloudflare Pages

    04/19/2021, 4:21 PM
    Did you do
    wrangler publish --new-class
    ?
  • k

    kristian

    04/19/2021, 4:22 PM
    oooo
  • k

    kristian

    04/19/2021, 4:23 PM
    I need to be on 1.16.0-rc.0 huh
  • k

    kristian

    04/19/2021, 4:23 PM
    the README just said 1.16.0, i should update that
  • k

    kristian

    04/19/2021, 4:24 PM
    ty!!!
  • k

    kristian

    04/19/2021, 4:24 PM
    seems like that's working
  • g

    Greg Brimble | Cloudflare Pages

    04/19/2021, 4:24 PM
    Et voilà!
  • g

    Greg Brimble | Cloudflare Pages

    04/19/2021, 4:24 PM
    Nice 🙂
  • g

    Greg Brimble | Cloudflare Pages

    04/19/2021, 4:25 PM
    Building anything exciting? Or just getting to grips with DO and the new Wrangler stuff?
  • k

    kristian

    04/19/2021, 4:25 PM
    yep!!
  • k

    kristian

    04/19/2021, 4:25 PM
    I have a cool project I'm gonna try and build but idk if it's gonna work lol
  • k

    kristian

    04/19/2021, 4:25 PM
    I'm going to try and connect to a WS/DO inside of unity
  • g

    Greg Brimble | Cloudflare Pages

    04/19/2021, 4:26 PM
    Oooh
  • g

    Greg-McKeon

    04/19/2021, 7:23 PM
    Yes, the initial request yields when it awaits.
  • g

    Greg-McKeon

    04/19/2021, 7:25 PM
    state isn't reset upon code change. the objects will leave memory and be re-instantiated with the new code, but the storage won't change.
  • g

    Greg-McKeon

    04/19/2021, 7:26 PM
    Not yet, this is something we're thinking about doing though
  • c

    Ceru ©

    04/19/2021, 7:35 PM
    thanks for the update, ill make sure to let people know if they ask again
  • g

    Greg Brimble | Cloudflare Pages

    04/19/2021, 7:36 PM
    For all those asking about `waitUntil`: https://discord.com/channels/595317990191398933/802187271067140107/833771635394871386 !!!
  • v

    vans163

    04/19/2021, 8:02 PM
    Can you clarify state (inmemory) or storage (something that seems rocksdb backed or persistent trie)?
  • m

    matt

    04/19/2021, 9:15 PM
    Keys and values modified using the
    state.storage
    API are persistent across code changes, runtime updates, etc.
    state
    is reset anytime a given durable object is restarted, such as for code updates, going over memory or cpu limits, or Workers Runtime updates
  • j

    john.spurlock

    04/20/2021, 11:35 PM
    Hmm, do script updates to cron triggers propagate more slowly? I pushed a script update over ten minutes ago, and only the 'scheduled' runs are using the old version. The 'fetch' runs are updated almost instantaneously.
  • m

    molmorg

    04/21/2021, 12:33 AM
    Writing a new worker using DurableObjects and want to use TypeScript. Can't find a sample of this - how do I use the new export style in a TypeScript project... e.g.
  • m

    molmorg

    04/21/2021, 12:34 AM
    This yields this error on publish "No event handlers were registered. This script does nothing."
  • k

    kalepail

    04/21/2021, 12:48 AM
    Geeze it's so nice to have
    waitUntil
    back 😄
  • a

    ai

    04/21/2021, 1:14 AM
    you need to export a default object with the handlers, so
    Copy code
    ts
    export default {
        async fetch(request: Request, env: any) {
            // blah
        }
    }
  • m

    molmorg

    04/21/2021, 2:56 AM
    Thanks - I played with default a few ways and couldn't get it to work either. I just tried the code you have above, getting same error. Project is here https://github.com/joshtwist/cf-logger
  • m

    matt

    04/21/2021, 3:19 AM
    @molmorg you need to be using custom builds to use modules https://developers.cloudflare.com/workers/cli-wrangler/configuration#es-modules
  • m

    molmorg

    04/21/2021, 5:24 AM
    Thanks for the help, got it working now with rollup - that repo is updated. Can publish now upload multiple module files separately or we still need to package to a single file with a tool like rollup?
1...656667...567Latest