https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • w

    Walshy | Pages

    03/28/2023, 11:45 PM
    local is very much an emulation, it's a best effort
  • w

    Walshy | Pages

    03/28/2023, 11:45 PM
    production is where you'll see this for real
  • w

    Walshy | Pages

    03/28/2023, 11:45 PM
    it may still act this way but i don't know
  • a

    avi

    03/28/2023, 11:46 PM
    this feels like a fairly enormous limitation. everything does seem to work as expected in
    --experimental-local
    , so as I said at the start, i do think this is a bug
  • u

    Unsmart | Tech debt

    03/28/2023, 11:47 PM
    If it works in experimental local why not just use that then?
  • a

    avi

    03/28/2023, 11:47 PM
    i'm building production software here
  • a

    avi

    03/28/2023, 11:47 PM
    how experimental is experimental?
  • u

    Unsmart | Tech debt

    03/28/2023, 11:47 PM
    Just as experimental as the other local tbh. Local will only ever be so good compared to deployed
  • a

    avi

    03/28/2023, 11:50 PM
    i mean, i understand that intellectually, but that seems pretty terrifying from a developer experience perspective
  • k

    kian

    03/28/2023, 11:50 PM
    There's 3 development modes for Workers
  • k

    kian

    03/28/2023, 11:50 PM
    dev
    , which is ran on the Cloudflare edge remotely
    local
    , which is ran in Miniflare 2 which is a Node emulation
    experimental-local
    , which is ran in Miniflare 3 which wraps
    workerd
    , the open-source runtime
  • k

    kian

    03/28/2023, 11:51 PM
    I personally always use normal
    dev
    since it's, well, running as a Worker actually would
  • k

    kian

    03/28/2023, 11:51 PM
    That isn't an option for
    pages dev
    and so users of Pages/Functions can only use
    local
    or
    experimental-local
  • a

    avi

    03/28/2023, 11:53 PM
    that's helpful, thanks -- so to clarify, when i run
    wrangler dev myscript
    , that's literally running my code on the CF edge network?
  • a

    avi

    03/28/2023, 11:53 PM
    and somehow proxying it back to my local machine?
  • k

    kian

    03/28/2023, 11:53 PM
    Yep
  • a

    avi

    03/28/2023, 11:54 PM
    ahh, i see. my issue with that is it clogs up my dashboard
  • a

    avi

    03/28/2023, 11:54 PM
    but, i do get it, and it seems like a good alternative
  • a

    avi

    03/28/2023, 11:55 PM
    fwiw.... Date.now() works totally as-expected via
    wrangler dev
  • a

    avi

    03/28/2023, 11:55 PM
    given our conversation, i am surprised by that
  • a

    avi

    03/28/2023, 11:55 PM
    local mode -> doesn't work dev -> works experimental local -> works
  • k

    kian

    03/28/2023, 11:56 PM
    wrangler dev
    should, barring any bugs, be exactly the same as the resulting Worker from
    wrangler publish
  • p

    PGooo

    03/28/2023, 11:56 PM
    Only coding in production
  • p

    PGooo

    03/28/2023, 11:56 PM
    No localhost
  • a

    avi

    03/28/2023, 11:56 PM
    i'm glad to know that wrangler dev is ~production environment, but what i don't understand still is how the Spectre thing makes any sense
  • a

    avi

    03/28/2023, 11:57 PM
    like, if the whole point was nerfing Date.now() to avoid spectre... how come the nerf only applies in local?
  • u

    Unsmart | Tech debt

    03/28/2023, 11:57 PM
    Yeah true wrangler dev is basically a proxied deployed worker in a way so should be most accurate followed by experimental local since it uses the open source runtime then local
  • a

    avi

    03/28/2023, 11:57 PM
    that seems to completely defeat the point. if anything, you'd want the opposite behavior
  • k

    kian

    03/28/2023, 11:57 PM
    It's nerfed in production and experimental-local
  • k

    kian

    03/28/2023, 11:57 PM
    You might see a delta, but it isn't real as far as accurate, out-of-Worker timing.
1...236623672368...2509Latest