Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency wrangler to v2.15.0 #5388

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 12, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
wrangler 2.14.0 -> 2.15.0 age adoption passing confidence

Release Notes

cloudflare/workers-sdk

v2.15.0

Compare Source

Minor Changes
  • #​2769 0a779904 Thanks @​penalosa! - feature: Support modules with --no-bundle

    When the --no-bundle flag is set, Wrangler now has support for uploading additional modules alongside the entrypoint. This will allow modules to be imported at runtime on Cloudflare's Edge. This respects Wrangler's module rules configuration, which means that only imports of non-JS modules will trigger an upload by default. For instance, the following code will now work with --no-bundle (assuming the example.wasm file exists at the correct path):

    // index.js
    import wasm from './example.wasm'
    
    export default {
      async fetch() {
        await WebAssembly.instantiate(wasm, ...)
        ...
      }
    }

    For JS modules, it's necessary to specify an additional module rule (or rules) in your wrangler.toml to configure your modules as ES modules or Common JS modules. For instance, to upload additional JavaScript files as ES modules, add the following module rule to your wrangler.toml, which tells Wrangler that all **/*.js files are ES modules.

    rules = [
      { type = "ESModule", globs = ["**/*.js"]},
    ]

    If you have Common JS modules, you'd configure Wrangler with a CommonJS rule (the following rule tells Wrangler that all .cjs files are Common JS modules):

    rules = [
      { type = "CommonJS", globs = ["**/*.cjs"]},
    ]

    In most projects, adding a single rule will be sufficient. However, for advanced usecases where you're mixing ES modules and Common JS modules, you'll need to use multiple rule definitions. For instance, the following set of rules will match all .mjs files as ES modules, all .cjs files as Common JS modules, and the nested/say-hello.js file as Common JS.

    rules = [
      { type = "CommonJS", globs = ["nested/say-hello.js", "**/*.cjs"]},
      { type = "ESModule", globs = ["**/*.mjs"]}
    ]

    If multiple rules overlap, Wrangler will log a warning about the duplicate rules, and will discard additional rules that matches a module. For example, the following rule configuration classifies dep.js as both a Common JS module and an ES module:

    rules = [
      { type = "CommonJS", globs = ["dep.js"]},
      { type = "ESModule", globs = ["dep.js"]}
    ]

    Wrangler will treat dep.js as a Common JS module, since that was the first rule that matched, and will log the following warning:

    ▲ [WARNING] Ignoring duplicate module: dep.js (esm)
    

    This also adds a new configuration option to wrangler.toml: base_dir. Defaulting to the directory of your Worker's main entrypoint, this tells Wrangler where your additional modules are located, and determines the module paths against which your module rule globs are matched.

    For instance, given the following directory structure:

    - wrangler.toml
    - src/
      - index.html
      - vendor/
        - dependency.js
      - js/
        - index.js
    

    If your wrangler.toml had main = "src/js/index.js", you would need to set base_dir = "src" in order to be able to import src/vendor/dependency.js and src/index.html from src/js/index.js.

Patch Changes
  • #​2957 084b2c58 Thanks @​esimons! - fix: Respect querystring params when calling .fetch on a worker instantiated with unstable_dev

    Previously, querystring params would be stripped, causing issues for test cases that depended on them. For example, given the following worker script:

    export default {
    	fetch(req) {
    		const url = new URL(req.url);
    		const name = url.searchParams.get("name");
    		return new Response("Hello, " + name);
    	}
    };

    would fail the following test case:

    const worker = await unstable_dev("script.js");
    const res = await worker.fetch("http://worker?name=Walshy");
    const text = await res.text();
    // Following fails, as returned text is 'Hello, null'
    expect(text).toBe("Hello, Walshy");
  • #​2840 e311bbbf Thanks @​mrbbot! - fix: make WRANGLER_LOG case-insensitive, warn on unexpected values, and fallback to log if invalid

    Previously, levels set via the WRANGLER_LOG environment-variable were case-sensitive.
    If an unexpected level was set, Wrangler would fallback to none, hiding all logs.
    The fallback has now been switched to log, and lenient case-insensitive matching is used when setting the level.

  • #​2735 3f7a75cc Thanks @​JacobMGEvans! - Fix: Generate Remote URL
    Previous URL was pointing to the old cloudflare/templates repo,
    updated the URL to point to templates in the workers-sdk monorepo.

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added dependencies Pull requests that update a dependency file skip-change-log Do not include the PR in the change log in the release labels Apr 12, 2023
hlsjs-ci
hlsjs-ci previously approved these changes Apr 12, 2023
hlsjs-ci
hlsjs-ci previously approved these changes Apr 12, 2023
hlsjs-ci
hlsjs-ci previously approved these changes Apr 12, 2023
hlsjs-ci
hlsjs-ci previously approved these changes Apr 12, 2023
hlsjs-ci
hlsjs-ci previously approved these changes Apr 12, 2023
hlsjs-ci
hlsjs-ci previously approved these changes Apr 12, 2023
@hlsjs-ci hlsjs-ci merged commit c7ce6b6 into master Apr 12, 2023
@renovate renovate bot deleted the renovate/wrangler-2.x branch April 12, 2023 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file skip-change-log Do not include the PR in the change log in the release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant