Giter Site home page Giter Site logo

Comments (5)

anderly avatar anderly commented on June 7, 2024 2

Cool, thanks. Yes, I noticed they validate on their end and reject if invalid, so I had removed the esprima package as well.

I'm already using this boilerplate as a very lightweight edge oauth proxy which is working nicely and I don't have to worry about being the central bottleneck standing up my own oauth proxy server(s).

from cloudflare-worker-routing.

anderly avatar anderly commented on June 7, 2024

Thanks Dave!

If this is simply running in a CloudFlare worker and not in a browser, I don't think I even need babel@polyfill or maybe even babel@preset-env. Thoughts?

Thanks for the heads up on deploy and the link to your updates.

from cloudflare-worker-routing.

detroitenglish avatar detroitenglish commented on June 7, 2024

Dug into a bit and learned that Cloudflare always keeps the worker runtime in line with the latest Chrome version. So now babel-polyfill indeed seems unnecessary.

I'm definitely keeping babel@preset-env though; with Babel 7 it's so much nicer to use e.g. import and object-rest-spread and never worry about installing plugins or tooling.

from cloudflare-worker-routing.

anderly avatar anderly commented on June 7, 2024

10-4. On that link it says "This means you can safely use latest JavaScript features, with no need for “transpilers”. So, I wonder if we really need babel at all? Will import not work without it. rest and spread operators appear to work without needing babel. However, I did see your use of the closure elimination plugin which is nice. For now, I've synced it up with your changes but I'm gonna try removing babel completely and see what, if anything, breaks.

from cloudflare-worker-routing.

detroitenglish avatar detroitenglish commented on June 7, 2024

Transpilation of the worker script might not be necessary, but I for one 'never leave home' without Babel. Mostly just to save me from myself; I can't be bothered to keep up with browser compatibilty and what APIs need polyfilling where. Also my IDE would go bananas. Curious if/how Husky precommit linting will work without Babel installed...

Another thing I learned that doesn't seem to be documented: Cloudflare actually validates uploaded worker scripts on their end, and will reject invalid scripts with a 400 response. So esprima validation isn't necessary in the deployment script.

Pushed some minor updates removing esprima and tweaking some tooling config, nothing drastic.

from cloudflare-worker-routing.

Related Issues (2)

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.