A tiny, SSR-safe directive for binding random data to an element.

Related tags

Vue.js vue ssr directive
Overview

1️⃣ vue-bind-once

A tiny, SSR-safe directive for binding random data to an element.

A tiny, SSR-safe directive for binding random data to an element.

Quick Start

First install vue-bind-once:

yarn add vue-bind-once

# or npm

npm install vue-bind-once --save

Register directive

import { createApp } from 'vue'
import App from './App.vue'
import { BindOnceDirective, BindOncePlugin } from 'vue-bind-once'

const app = createApp(App)
app.install(BindOncePlugin)
// or app.directive('bind-once', BindOnceDirective)

In most cases you'll be using this directive with an SSR-rendering framework like nuxt, which may have a different way for you to register this directive. For example, in a Nuxt plugin:

import { BindOncePlugin } from 'vue-bind-once'

export default defineNuxtPlugin(nuxtApp => {
  nuxtApp.vueApp.install(BindOncePlugin)
})

Usage

You can now use the directive on any element where you need a binding to a value that needs to match between client/server but won't change dynamically afterwards.

<script setup>
  import { nanoid } from 'nanoid'
  const id = nanoid()
</script>
<template>
  <input type="text" v-bind-once="{ id, name: id }" />
  <label v-bind-once="{ for: id }" />
</template>

This will work on both server and on client re-hydration.

Contributors

This has been developed to suit my needs but additional use cases and contributions are very welcome.

License

MIT License - Copyright © Daniel Roe

Comments
  • chore(deps): update dependency release-it to v15 - autoclosed

    chore(deps): update dependency release-it to v15 - autoclosed

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | release-it | ^14.14.2 -> ^15.0.0 | age | adoption | passing | confidence |


    Release Notes

    release-it/release-it

    v15.0.0

    Compare Source

    • Skip lifecycle hooks without a version (i.e. don't release) (d706484)
    • Update changelog and add announcement for major release (e2aa887)
    • Update dependency (700c547)
    • Update minimum required Node.js engine to v14.9.0 (94e073b)
    • Replace external debug dependency with node:util.debug (e7748a8)
    • Ignore ESM-only dependencies in import/no-unresolved (bd45e52)
    • Remove .only test (3282e95)
    • Prefix node: imports (b033e0b)
    • Remove unused markdown-toc + script (34ad75b)
    • Update changelog (65246b7)
    • Update dependencies (ae0ad11)
    • Remove support for GitLab < v12.4 (c2cf5a9)
    • Remove tasks.js (it's index.js) (fbcbe91)
    • Remove anonymous metrics (and the option to disable it) (e9ce69b)
    • Start using actual un-mocked files in config specs (aa1815e)
    • Remove unused/obsolete files (7c84b4e)
    • Update dependencies & remove support for Node.js v12 (853c6e7)
    • Merge branch 'master' into feature/es-modules (d411f8c)
    • Increase timeout for tests using npm link (bbee9bb)
    • Use npm link to install release-it in plugin tests (f538a01)
    • Disable worker threads in ava (bacec65)
    • Replace tmp package with Node.js internal in test helper (717fab3)
    • Update dependencies (900c1a2)
    • Add file (0f195a3)
    • Update dependency (9dea8fc)
    • Downgrade chalk & migrate ora usage (a6bb29b)
    • Specs don't need to execute git log (ee36d7b)
    • Re-add missing import (b03a34d)
    • Update dependencies (mostly major updates) (fbe0575)
    • Rename/combine index and cli modules (eb4d858)
    • Fix tagName in git tag prompt (f007382)
    • Improve second latest tag command (21cca12)
    • Improve tag version parser (2fc0e94)
    • Lift tagName to global/config context (628edc6)
    • Separate --no-increment from --github.update (57a77c8)
    • Pass url to import() rather than path (38c0eee)
    • Fix up tests (7a76101)
    • Improve legacy module resolution for plugins (c97fc2b)
    • Extend exports for plugin tests (134d27e)
    • Normalize plugin loader (38dabbe)
    • Fix tests (9516010)
    • Stop testing for Node.js v10 (dae3a51)
    • Refactor plugin loader + tests (remove proxyquire) (570e349)
    • Fix ava config (ad03f71)
    • Fix imports in tests (e7e664c)
    • Fix lodash import (7ab8574)
    • Fix relative import paths (f28ec24)
    • Add .js extension to imports (c31548c)
    • Use util to read JSON (216267b)
    • Format modules (eeb4126)
    • Update package.json + .eslintrc.json (abd3c73)
    • Convert CommonJS to ES Modules (179708a)
    • Update dependencies (0568d3e)
    • Only trim end of stdout (75d0c2f)

    Configuration

    📅 Schedule: 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, click this checkbox.

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

    opened by renovate[bot] 2
  • chore(deps): update dependency @release-it/conventional-changelog to v5 - autoclosed

    chore(deps): update dependency @release-it/conventional-changelog to v5 - autoclosed

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @release-it/conventional-changelog | ^4.3.0 -> ^5.0.0 | age | adoption | passing | confidence |


    Release Notes

    release-it/conventional-changelog

    v5.0.0

    Compare Source

    • Add spec to assert conventional-recommended-bump and whatBump option behavior (124351c)
    • Remove obsolete disable-metrics flag in test (39c0992)
    • Whitespace (51adf99)
    • Cross-os newlines (9bcc253)
    • End support for Node.js v12 (de652df)
    • Fix EOLs in specs (bc5f5e3)
    • Fix spec after merge (1d2465d)
    • Update version + dependencies (eb438a9)
    • Don't mutate options, but send clean arguments to conventionalChangelog (d814638)
    • Add GitHub Action for test matrix (c466c69)
    • Move to real integration tests + add more (3ac968d)
    • Refactor tests + more integrated tests (80b99dc)
    • Update dependencies + engine version (f97297e)
    • Migrate implementation to ESM (93c7255)

    Configuration

    📅 Schedule: 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, click this checkbox.

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

    opened by renovate[bot] 2
  • chore(deps): update all non-major dependencies

    chore(deps): update all non-major dependencies

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | esbuild | 0.14.25 -> 0.14.26 | age | adoption | passing | confidence | | eslint (source) | ^8.10.0 -> ^8.11.0 | age | adoption | passing | confidence | | vitest | ^0.6.0 -> ^0.6.1 | age | adoption | passing | confidence |


    Release Notes

    evanw/esbuild

    v0.14.26

    Compare Source

    • Fix a tree shaking regression regarding var declarations (#​2080, #​2085, #​2098, #​2099)

      Version 0.14.8 of esbuild enabled removal of duplicate function declarations when minification is enabled (see #​610):

      // Original code
      function x() { return 1 }
      console.log(x())
      function x() { return 2 }
      
      // Output (with --minify-syntax)
      console.log(x());
      function x() {
        return 2;
      }
      

      This transformation is safe because function declarations are "hoisted" in JavaScript, which means they are all done first before any other code is evaluted. This means the last function declaration will overwrite all previous function declarations with the same name.

      However, this introduced an unintentional regression for var declarations in which all but the last declaration was dropped if tree-shaking was enabled. This only happens for top-level var declarations that re-declare the same variable multiple times. This regression has now been fixed:

      // Original code
      var x = 1
      console.log(x)
      var x = 2
      
      // Old output (with --tree-shaking=true)
      console.log(x);
      var x = 2;
      
      // New output (with --tree-shaking=true)
      var x = 1;
      console.log(x);
      var x = 2;
      

      This case now has test coverage.

    • Add support for parsing "instantiation expressions" from TypeScript 4.7 (#​2038)

      The upcoming version of TypeScript now lets you specify <...> type parameters on a JavaScript identifier without using a call expression:

      const ErrorMap = Map<string, Error>;  // new () => Map<string, Error>
      const errorMap = new ErrorMap();  // Map<string, Error>
      

      With this release, esbuild can now parse these new type annotations. This feature was contributed by @​g-plane.

    • Avoid new Function in esbuild's library code (#​2081)

      Some JavaScript environments such as Cloudflare Workers or Deno Deploy don't allow new Function because they disallow dynamic JavaScript evaluation. Previously esbuild's WebAssembly-based library used this to construct the WebAssembly worker function. With this release, the code is now inlined without using new Function so it will be able to run even when this restriction is in place.

    • Drop superfluous __name() calls (#​2062)

      When the --keep-names option is specified, esbuild inserts calls to a __name helper function to ensure that the .name property on function and class objects remains consistent even if the function or class name is renamed to avoid a name collision or because name minification is enabled. With this release, esbuild will now try to omit these calls to the __name helper function when the name of the function or class object was not renamed during the linking process after all:

      // Original code
      import { foo as foo1 } from 'data:text/javascript,export function foo() { return "foo1" }'
      import { foo as foo2 } from 'data:text/javascript,export function foo() { return "foo2" }'
      console.log(foo1.name, foo2.name)
      
      // Old output (with --bundle --keep-names)
      (() => {
        var __defProp = Object.defineProperty;
        var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
        function foo() {
          return "foo1";
        }
        __name(foo, "foo");
        function foo2() {
          return "foo2";
        }
        __name(foo2, "foo");
        console.log(foo.name, foo2.name);
      })();
      
      // New output (with --bundle --keep-names)
      (() => {
        var __defProp = Object.defineProperty;
        var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
        function foo() {
          return "foo1";
        }
        function foo2() {
          return "foo2";
        }
        __name(foo2, "foo");
        console.log(foo.name, foo2.name);
      })();
      

      Notice how one of the calls to __name is now no longer printed. This change was contributed by @​indutny.

    eslint/eslint

    v8.11.0

    Compare Source

    Features

    • 800bd25 feat: add destructuredArrayIgnorePattern option in no-unused-vars (#​15649) (Nitin Kumar)
    • 8933fe7 feat: Catch undefined and Boolean() in no-constant-condition (#​15613) (Jordan Eldredge)
    • f90fd9d feat: Add ESLint favicon to the HTML report document (#​15671) (Mahdi Hosseinzadeh)
    • 57b8a57 feat: valid-typeof always ban undefined (#​15635) (Zzzen)

    Bug Fixes

    • 6814922 fix: escaping for square brackets in ignore patterns (#​15666) (Milos Djermanovic)
    • c178ce7 fix: extend the autofix range in comma-dangle to ensure the last element (#​15669) (Milos Djermanovic)

    Documentation

    • c481cec docs: add fast-eslint-8 to atom integrations (userguide) (#​15695) (db developer)
    • d2255db docs: Add clarification about eslint-enable (#​15680) (dosisod)
    • 8b9433c docs: add object pattern to first section of computed-property-spacing (#​15679) (Milos Djermanovic)
    • de800c3 docs: link to minimatch docs added. (#​15688) (Gaurav Tewari)
    • 8f675b1 docs: sort-imports add single named import example (#​15675) (Arye Eidelman)

    Chores

    vitest-dev/vitest

    v0.6.1

    Compare Source

    Bug Fixes
    Features

    Configuration

    📅 Schedule: 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.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

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

    opened by renovate[bot] 2
  • chore(deps): update dependency happy-dom to v3 - autoclosed

    chore(deps): update dependency happy-dom to v3 - autoclosed

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | happy-dom | ^2.55.0 -> ^3.0.0 | age | adoption | passing | confidence |


    Release Notes

    capricorn86/happy-dom

    v3.2.2

    Compare Source

    :construction_worker_man: Patch fixes
    • Fixes issue with methods like addEventListener() and removeEventListener() not working when called in the global context. (#​464)

    v3.2.1

    Compare Source

    v3.2.0

    Compare Source

    :art: Features
    • Adds support for Event.composedPath(). (#​468)

    v3.1.1

    Compare Source

    :construction_worker_man: Patch fixes
    • Fixes problem with Vitest hanging in some scenarios. It was caused by the import of the package "sync-request". This fix reverts back to use "require()" when needed instead of using "import". (#​462)

    v3.1.0

    Compare Source

    :art: Features
    • Adds support for Window.getSelection(). (#​457)

    v3.0.0

    Compare Source

    :bomb: Breaking Changes
    • Changes target language from ES5 to ES2020 (CommonJS will still be used as module system). (#​454)
    :art: Features
    • Makes the Window instance a VM context. (#​454)
    • Adds support for a new window called GlobalWindow, that will run in the global context. (#​454)
    :construction_worker_man: Patch fixes
    • Solves general problems with globals (Array, Object etc.) inside a VM by contextifying the Window when it is created. (#​454)
    Migration from v2.x.x to v3.0.0
    • You may have to transpile Happy DOM to ES5 if the rest of your code is executed using ES5.
    • You no longer have to execute VM.createContext(window) as the default Window class is already a VM context. However, it is not necessary to do this change as the createContext() will just ignore already contextified objects.

    Configuration

    📅 Schedule: 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, click this checkbox.

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

    opened by renovate[bot] 1
  • chore(deps): update all non-major dependencies - autoclosed

    chore(deps): update all non-major dependencies - autoclosed

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @typescript-eslint/eslint-plugin | ^5.20.0 -> ^5.21.0 | age | adoption | passing | confidence | | @typescript-eslint/parser | ^5.20.0 -> ^5.21.0 | age | adoption | passing | confidence | | esbuild | 0.14.37 -> 0.14.38 | age | adoption | passing | confidence | | eslint (source) | ^8.13.0 -> ^8.14.0 | age | adoption | passing | confidence | | lint-staged | ^12.4.0 -> ^12.4.1 | age | adoption | passing | confidence | | release-it | ^14.14.2 -> ^14.14.3 | age | adoption | passing | confidence | | typescript (source) | ^4.6.3 -> ^4.6.4 | age | adoption | passing | confidence | | vite | ^2.9.5 -> ^2.9.6 | age | adoption | passing | confidence | | vitest | ^0.9.4 -> ^0.10.0 | age | adoption | passing | confidence |


    Release Notes

    typescript-eslint/typescript-eslint (@​typescript-eslint/eslint-plugin)

    v5.21.0

    Compare Source

    Bug Fixes
    • eslint-plugin: [no-misused-promises] prioritize false returns when checking whether a function returns only void (#​4841) (ccadb60)
    • eslint-plugin: [no-namespace] fix false positive for exported namespaces when allowDeclarations=true (#​4844) (4e7c9be)
    • eslint-plugin: [space-infix-ops] fix no error when right type is function (#​4848) (d74d559)
    Features
    • eslint-plugin: [parameter-properties] add rule to replace no-parameter-properties (#​4622) (88ed9ec)
    typescript-eslint/typescript-eslint (@​typescript-eslint/parser)

    v5.21.0

    Compare Source

    Note: Version bump only for package @​typescript-eslint/parser

    evanw/esbuild

    v0.14.38

    Compare Source

    • Further fixes to TypeScript 4.7 instantiation expression parsing (#​2201)

      This release fixes some additional edge cases with parsing instantiation expressions from the upcoming version 4.7 of TypeScript. Previously it was allowed for an instantiation expression to precede a binary operator but with this release, that's no longer allowed. This was sometimes valid in the TypeScript 4.7 beta but is no longer allowed in the latest version of TypeScript 4.7. Fixing this also fixed a regression that was introduced by the previous release of esbuild:

      | Code | TS 4.6.3 | TS 4.7.0 beta | TS 4.7.0 nightly | esbuild 0.14.36 | esbuild 0.14.37 | esbuild 0.14.38 | |----------------|--------------|---------------|------------------|-----------------|-----------------|-----------------| | a<b> == c<d> | Invalid | a == c | Invalid | a == c | a == c | Invalid | | a<b> in c<d> | Invalid | Invalid | Invalid | Invalid | a in c | Invalid | | a<b>>=c<d> | Invalid | Invalid | Invalid | Invalid | a >= c | Invalid | | a<b>=c<d> | Invalid | a < b >= c | a = c | a < b >= c | a = c | a = c | | a<b>>c<d> | a < b >> c | a < b >> c | a < b >> c | a < b >> c | a > c | a < b >> c |

      This table illustrates some of the more significant changes between all of these parsers. The most important part is that esbuild 0.14.38 now matches the behavior of the latest TypeScript compiler for all of these cases.

    eslint/eslint

    v8.14.0

    Compare Source

    Features

    • ab6363d feat: Add rule no-constant-binary-expression (#​15296) (Jordan Eldredge)

    Bug Fixes

    • 35fa1dd fix: allow project paths to have URL-encoded characters (#​15795) (Milos Djermanovic)
    • 413f1d5 fix: update astUtils.isDirectiveComment with globals and exported (#​15775) (Milos Djermanovic)

    Build Related

    Chores

    • 735458c chore: add static frontmatter to no-constant-binary-expression docs (#​15798) (Milos Djermanovic)
    • db28f2c chore: Add static frontmatter to docs (#​15782) (Nicholas C. Zakas)
    • 3bca59e chore: markdownlint autofix on commit (#​15783) (Nicholas C. Zakas)
    okonet/lint-staged

    v12.4.1

    Compare Source

    Bug Fixes
    • correctly handle symlinked config files (b3f63ec)
    release-it/release-it

    v14.14.3

    Compare Source

    • Remove .only test (dd249c6)
    • Temporarily(?) ignore docs.gihub.com links (returning 403) (ec3e4db)
    • Improve docs re. git.tagMatch (93c583c)
    • Replace "resources" at the bottom with link to license, order examples (e9c6b8d)
    • Update docs.github.com links (2fe93fd)
    • Add test for git.tagMatch + changelog behavior (5e843f1)
    • Improve documentatiion, mainly re. git.tagMatch (751e171)
    • Remove xlink namespace from svg (9ce7501)
    • Remove duplicate test and wrap up proxy fix (f1e8843)
    • Fixes github.proxy not working (#​863) (#​893) (1fe1afa)
    Microsoft/TypeScript

    v4.6.4

    Compare Source

    This release includes a bug fix for text formatting on certain ranges, which was impacting Visual Studio users.

    For the complete list of fixed issues, check out the

    Downloads are available on:

    vitejs/vite

    v2.9.6

    Compare Source

    vitest-dev/vitest

    v0.10.0

    Compare Source

    Breaking Changes

    From Vitest v0.10.0, the callback style of declaring tests is deprecated. You can rewrite them to use async/await functions, or use Promise to mimic the callback style.

    - it('should work', (done) => {
    + it('should work', () => new Promise(done => {
        // ...
        done()
    - })
    + }))
    

    Features

    beforeAll / beforeEach cleanup callback

    beforeAll / beforeEach now accepts an optional cleanup function as the return value (equivalent to afterAll / afterEach).

    import { beforeAll } from 'vitest'
    
    beforeEach(async () => {
      // called once before each test run
      await startMocking()
    
      // clean up function, called once after each test run
      return async () => {
        await stopMocking()
      }
    })
    

    Learn more at:

    Test Context

    Inspired by Playwright Fixtures, Vitest's test context allows you to define utils, states, and fixtures that can be used in your tests.

    import { beforeEach, it } from 'vitest'
    
    beforeEach((context) => {
      // extend context
      context.foo = 'bar'
    })
    
    it('should work', ({ foo }) => {
      console.log(foo) // 'bar'
    })
    

    Learn more at Test Context

    Concurrent Snapshot

    Due to the limitation of JavaScript, timing based Singleton pattern will cause conflicts when running multiple async functions in concurrent. Previously reported as #​551. Thanks to the newly introduced Test Context, we can now provide a test specific expect instance to avoid conflicts. To use it, you can destructure the expect from each test context instead of the global one.

    test.concurrent('test 1', async ({ expect }) => {
      expect(foo).toMatchSnapshot()
    })
    test.concurrent('test 2', async ({ expect }) => {
      expect(foo).toMatchSnapshot()
    })
    
    Reporter from file / package

    Now you can pass a path to file, or a package name to the reporters options to use custom reporter. Thanks to @​ericjgagnon (#​1136) (f2bceb2)

    Bug Fixes


    Configuration

    📅 Schedule: 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.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

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

    opened by renovate[bot] 1
  • chore(deps): update all non-major dependencies

    chore(deps): update all non-major dependencies

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @vue/test-utils | ^2.0.0-rc.20 -> ^2.0.0-rc.21 | age | adoption | passing | confidence | | esbuild | 0.14.36 -> 0.14.37 | age | adoption | passing | confidence | | vitest | ^0.9.3 -> ^0.9.4 | age | adoption | passing | confidence |


    Release Notes

    vuejs/test-utils

    v2.0.0-rc.21

    Compare Source

    This is the final release candidate, unless something major comes up. We will move to 2.0.0 next release.

    evanw/esbuild

    v0.14.37

    Compare Source

    • Add support for TypeScript's moduleSuffixes field from TypeScript 4.7

      The upcoming version of TypeScript adds the moduleSuffixes field to tsconfig.json that introduces more rules to import path resolution. Setting moduleSuffixes to [".ios", ".native", ""] will try to look at the the relative files ./foo.ios.ts, ./foo.native.ts, and finally ./foo.ts for an import path of ./foo. Note that the empty string "" in moduleSuffixes is necessary for TypeScript to also look-up ./foo.ts. This was announced in the TypeScript 4.7 beta blog post.

    • Match the new ASI behavior from TypeScript nightly builds (#​2188)

      This release updates esbuild to match some very recent behavior changes in the TypeScript parser regarding automatic semicolon insertion. For more information, see TypeScript issues #​48711 and #​48654 (I'm not linking to them directly to avoid Dependabot linkback spam on these issues due to esbuild's popularity). The result is that the following TypeScript code is now considered valid TypeScript syntax:

      class A<T> {}
      new A<number> /* ASI now happens here */
      if (0) {}
      
      interface B {
        (a: number): typeof a /* ASI now happens here */
        <T>(): void
      }
      

      This fix was contributed by @​g-plane.

    vitest-dev/vitest

    v0.9.4

    Compare Source

    Bug Fixes
    Features

    Configuration

    📅 Schedule: 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.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

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

    opened by renovate[bot] 1
  • chore(deps): update all non-major dependencies

    chore(deps): update all non-major dependencies

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @release-it/conventional-changelog | ^4.2.2 -> ^4.3.0 | age | adoption | passing | confidence | | @typescript-eslint/eslint-plugin | ^5.18.0 -> ^5.20.0 | age | adoption | passing | confidence | | @typescript-eslint/parser | ^5.18.0 -> ^5.20.0 | age | adoption | passing | confidence | | @vue/test-utils | ^2.0.0-rc.19 -> ^2.0.0-rc.20 | age | adoption | passing | confidence | | c8 | ^7.11.0 -> ^7.11.2 | age | adoption | passing | confidence | | esbuild | 0.14.34 -> 0.14.36 | age | adoption | passing | confidence | | lint-staged | ^12.3.7 -> ^12.4.0 | age | adoption | passing | confidence | | pnpm (source) | 6.32.6 -> 6.32.9 | age | adoption | passing | confidence | | release-it | ^14.14.1 -> ^14.14.2 | age | adoption | passing | confidence | | semver | ^7.3.6 -> ^7.3.7 | age | adoption | passing | confidence | | unbuild | ^0.7.2 -> ^0.7.4 | age | adoption | passing | confidence | | vite | ^2.9.1 -> ^2.9.5 | age | adoption | passing | confidence | | vitest | ^0.9.2 -> ^0.9.3 | age | adoption | passing | confidence | | vue | ^3.2.31 -> ^3.2.33 | age | adoption | passing | confidence |


    Release Notes

    release-it/conventional-changelog

    v4.3.0

    Compare Source

    • Remove CHANGES.md just in case before running specs (51d3b10)
    • Remove unused prepend-file dependency (59053b4)
    • Fix missing newlines (fixes #​46) (cd55c13)
    • Fix specs for new from prop (d20e50d)
    • Pass previousTag to conventionalChangelog in gitRawCommitsOpts to select commit messages (#​47) (f13909e)
    typescript-eslint/typescript-eslint (@​typescript-eslint/eslint-plugin)

    v5.20.0

    Compare Source

    Features
    • eslint-plugin: [no-magic-numbers] ignoreTypeIndexes option (#​4789) (5e79451)

    v5.19.0

    Compare Source

    Bug Fixes
    Features
    • eslint-plugin: [unified-signatures] add ignoreDifferentlyNamedParameters option (#​4659) (fdf95e0)
    • eslint-plugin: add support for valid number and bigint intersections in restrict-plus-operands rule (#​4795) (19c600a)
    typescript-eslint/typescript-eslint (@​typescript-eslint/parser)

    v5.20.0

    Compare Source

    Note: Version bump only for package @​typescript-eslint/parser

    v5.19.0

    Compare Source

    Note: Version bump only for package @​typescript-eslint/parser

    vuejs/test-utils

    v2.0.0-rc.20

    Compare Source

    What's Changed

    New Contributors

    Full Changelog: https://github.com/vuejs/test-utils/compare/v2.0.0-rc.19...v2.0.0-rc.20

    bcoe/c8

    v7.11.2

    Compare Source

    v7.11.1

    Compare Source

    evanw/esbuild

    v0.14.36

    Compare Source

    • Revert path metadata validation for now (#​2177)

      This release reverts the path metadata validation that was introduced in the previous release. This validation has uncovered a potential issue with how esbuild handles onResolve callbacks in plugins that will need to be fixed before path metadata validation is re-enabled.

    v0.14.35

    Compare Source

    • Add support for parsing typeof on #private fields from TypeScript 4.7 (#​2174)

      The upcoming version of TypeScript now lets you use #private fields in typeof type expressions:

      https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-beta/#typeof-on-private-fields

      class Container {
        #data = "hello!";
      
        get data(): typeof this.#data {
          return this.#data;
        }
      
        set data(value: typeof this.#data) {
          this.#data = value;
        }
      }
      

      With this release, esbuild can now parse these new type expressions as well. This feature was contributed by @​magic-akari.

    • Add Opera and IE to internal CSS feature support matrix (#​2170)

      Version 0.14.18 of esbuild added Opera and IE as available target environments, and added them to the internal JS feature support matrix. CSS feature support was overlooked, however. This release adds knowledge of Opera and IE to esbuild's internal CSS feature support matrix:

      /* Original input */
      a {
        color: rgba(0, 0, 0, 0.5);
      }
      
      /* Old output (with --target=opera49 --minify) */
      a{color:rgba(0,0,0,.5)}
      
      /* New output (with --target=opera49 --minify) */
      a{color:#&#8203;00000080}
      

      The fix for this issue was contributed by @​sapphi-red.

    • Change TypeScript class field behavior when targeting ES2022

      TypeScript 4.3 introduced a breaking change where class field behavior changes from assign semantics to define semantics when the target setting in tsconfig.json is set to ESNext. Specifically, the default value for TypeScript's useDefineForClassFields setting when unspecified is true if and only if target is ESNext. TypeScript 4.6 introduced another change where this behavior now happens for both ESNext and ES2022. Presumably this will be the case for ES2023 and up as well. With this release, esbuild's behavior has also been changed to match. Now configuring esbuild with --target=es2022 will also cause TypeScript files to use the new class field behavior.

    • Validate that path metadata returned by plugins is consistent

      The plugin API assumes that all metadata for the same path returned by a plugin's onResolve callback is consistent. Previously this assumption was just assumed without any enforcement. Starting with this release, esbuild will now enforce this by generating a build error if this assumption is violated. The lack of validation has not been an issue (I have never heard of this being a problem), but it still seems like a good idea to enforce it. Here's a simple example of a plugin that generates inconsistent sideEffects metadata:

      let buggyPlugin = {
        name: 'buggy',
        setup(build) {
          let count = 0
          build.onResolve({ filter: /^react$/ }, args => {
            return {
              path: require.resolve(args.path),
              sideEffects: count++ > 0,
            }
          })
        },
      }
      

      Since esbuild processes everything in parallel, the set of metadata that ends up being used for a given path is essentially random since it's whatever the task scheduler decides to schedule first. Thus if a plugin does not consistently provide the same metadata for a given path, subsequent builds may return different results. This new validation check prevents this problem.

      Here's the new error message that's shown when this happens:

      ✘ [ERROR] [plugin buggy] Detected inconsistent metadata for the path "node_modules/react/index.js" when it was imported here:
      
          button.tsx:1:30:
            1 │ import { createElement } from 'react'
              ╵                               ~~~~~~~
      
        The original metadata for that path comes from when it was imported here:
      
          app.tsx:1:23:
            1 │ import * as React from 'react'
              ╵                        ~~~~~~~
      
        The difference in metadata is displayed below:
      
         {
        -  "sideEffects": true,
        +  "sideEffects": false,
         }
      
        This is a bug in the "buggy" plugin. Plugins provide metadata for a given path in an "onResolve"
        callback. All metadata provided for the same path must be consistent to ensure deterministic
        builds. Due to parallelism, one set of provided metadata will be randomly chosen for a given path,
        so providing inconsistent metadata for the same path can cause non-determinism.
      
    • Suggest enabling a missing condition when exports map fails (#​2163)

      This release adds another suggestion to the error message that happens when an exports map lookup fails if the failure could potentially be fixed by adding a missing condition. Here's what the new error message looks like (which now suggests --conditions=module as a possible workaround):

      ✘ [ERROR] Could not resolve "@&#8203;sentry/electron/main"
      
          index.js:1:24:
            1 │ import * as Sentry from '@&#8203;sentry/electron/main'
              ╵                         ~~~~~~~~~~~~~~~~~~~~~~~
      
        The path "./main" is not currently exported by package "@&#8203;sentry/electron":
      
          node_modules/@&#8203;sentry/electron/package.json:8:13:
            8 │   "exports": {
              ╵              ^
      
        None of the conditions provided ("require", "module") match any of the currently active conditions
        ("browser", "default", "import"):
      
          node_modules/@&#8203;sentry/electron/package.json:16:14:
            16 │     "./main": {
               ╵               ^
      
        Consider enabling the "module" condition if this package expects it to be enabled. You can use
        "--conditions=module" to do that:
      
          node_modules/@&#8203;sentry/electron/package.json:18:6:
            18 │       "module": "./esm/main/index.js"
               ╵       ~~~~~~~~
      
        Consider using a "require()" call to import this file, which will work because the "require"
        condition is supported by this package:
      
          index.js:1:24:
            1 │ import * as Sentry from '@&#8203;sentry/electron/main'
              ╵                         ~~~~~~~~~~~~~~~~~~~~~~~
      
        You can mark the path "@&#8203;sentry/electron/main" as external to exclude it from the bundle, which
        will remove this error.
      

      This particular package had an issue where it was using the Webpack-specific module condition without providing a default condition. It looks like the intent in this case was to use the standard import condition instead. This specific change wasn't suggested here because this error message is for package consumers, not package authors.

    okonet/lint-staged

    v12.4.0

    Compare Source

    Bug Fixes
    • handle empty input by returning empty array from parseGitZOutput (a118817)
    • limit configuration discovery to cwd (d8fdf1d)
    • restore functionality of parent globs for a single configuration file (877ab4c)
    Features
    • expose --max-arg-length cli option (e8291b0)

    v12.3.8

    Compare Source

    Bug Fixes
    • avoid passing unexpected arguments from forEach to process.kill() (1b1f0e4)
    • clear execution interruption interval on first catch (46952cb)
    pnpm/pnpm

    v6.32.9

    Compare Source

    Patch Changes

    • Fix an error with peer resolutions, which was happening when there was a circular dependency and another dependency that had the name of the circular dependency as a substring.

    • When pnpm exec is running a command in a workspace project, the commands that are in the dependencies of that workspace project should be in the PATH #​4481.

    • Hide "WARN deprecated" messages on loglevel error #​4507

      Don't show the progress bar when loglevel is set to warn or error.

    Full Changelog: https://github.com/pnpm/pnpm/compare/v6.32.8...v6.32.9

    v6.32.8

    Compare Source

    Patch Changes

    • Don't check the integrity of the store with the package version from the lockfile, when the package was updated #​4580.
    • Don't update a direct dependency that has the same name as a dependency in the workspace, when adding a new dependency to a workspace project #​4575.

    Full Changelog: https://github.com/pnpm/pnpm/compare/v6.32.7...v6.32.8

    v6.32.7

    Compare Source

    Patch Changes

    • Setting the auto-install-peers to true should work.

    Full Changelog: https://github.com/pnpm/pnpm/compare/v6.32.6...v6.32.7

    release-it/release-it

    v14.14.2

    Compare Source

    NOTE This is the latest release still supporting Node.js v10. Major issues reported in release-it v14 might still receive bug fixes and patch releases, but no new features.

    npm/node-semver

    v7.3.7

    Compare Source

    unjs/unbuild

    v0.7.4

    Compare Source

    v0.7.3

    Compare Source

    vitejs/vite

    v2.9.5

    Compare Source

    v2.9.4

    Compare Source

    v2.9.3

    Compare Source

    v2.9.2

    Compare Source

    vitest-dev/vitest

    v0.9.3

    Compare Source

    Bug Fixes
    vuejs/core

    v3.2.33

    Compare Source

    Bug Fixes

    v3.2.32

    Compare Source

    Bug Fixes

    Configuration

    📅 Schedule: 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.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

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

    opened by renovate[bot] 1
  • chore(deps): update codecov/codecov-action action to v3

    chore(deps): update codecov/codecov-action action to v3

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | codecov/codecov-action | action | major | v2 -> v3 |


    Release Notes

    codecov/codecov-action

    v3

    Compare Source


    Configuration

    📅 Schedule: 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, click this checkbox.

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

    opened by renovate[bot] 1
  • chore(deps): update all non-major dependencies

    chore(deps): update all non-major dependencies

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | @typescript-eslint/eslint-plugin | ^5.17.0 -> ^5.18.0 | age | adoption | passing | confidence | | @typescript-eslint/parser | ^5.17.0 -> ^5.18.0 | age | adoption | passing | confidence | | @vue/test-utils | ^2.0.0-rc.17 -> ^2.0.0-rc.19 | age | adoption | passing | confidence | | esbuild | 0.14.29 -> 0.14.34 | age | adoption | passing | confidence | | eslint (source) | ^8.12.0 -> ^8.13.0 | age | adoption | passing | confidence | | pnpm (source) | 6.32.4 -> 6.32.6 | age | adoption | passing | confidence | | prettier (source) | ^2.6.1 -> ^2.6.2 | age | adoption | passing | confidence | | release-it | ^14.14.0 -> ^14.14.1 | age | adoption | passing | confidence | | semver | ^7.3.5 -> ^7.3.6 | age | adoption | passing | confidence | | vitest | ^0.8.1 -> ^0.9.2 | age | adoption | passing | confidence |


    Release Notes

    typescript-eslint/typescript-eslint (@​typescript-eslint/eslint-plugin)

    v5.18.0

    Compare Source

    Bug Fixes
    • eslint-plugin: method-signature-style respect getter signature (#​4777) (12dd670)
    Features
    • eslint-plugin: [no-shadow] ignoreOnInitialization option (#​4603) (068ea9b)
    • eslint-plugin: [no-this-alias] report on assignment expressions (#​4718) (8329498)
    typescript-eslint/typescript-eslint (@​typescript-eslint/parser)

    v5.18.0

    Compare Source

    Note: Version bump only for package @​typescript-eslint/parser

    vuejs/test-utils

    v2.0.0-rc.19

    Compare Source

    Several fixes. We will move from release candidate soon, hopefully this will be the last release candidate, unless any bugs are reported!

    Features

    feat: Add createStubs plugin hook feat: support custom class component

    Fixes

    fix: added missing find overrides fix: support functional component props fix: do not match component name on getter that returns component fix: static imports fix: findAll root nodes when using render function fix: stop globalProperties config leak fix: add relative imports in wrapperLike interface fix: add methods from baseWrapper to the wrapperLike interface fix(type): add undefined type to attributes() for missing key #​1398 fix(find): find element inside suspense with multi root elements #​1397 fix(find): find and findAll should not find itself on DOM wrappers #​1392

    v2.0.0-rc.18

    Compare Source

    We are edging closer to a 2.0.0. This release contains many small fixes, mainly related to niche edge cases.

    Fixes

    fix: stringify symbol props in stubs (#​1086) fix: Remove methods key from mount (#​1145) Fix: Use defaultName when it exists to correctly stub async components (#​1136) fix(find): allow finding stubs by stub definition (#​1113) fix(emitted): do not track native events on multi-root components (#​1121) fix(html): ensure wrapper.html() works correctly for multi-root (#​1120) fix(find): implement proper find for multi-root components (#​1116) fix(find): do not find DOM node by ref if it is not inside element b118e9aa956a81997dc1276583c0f48c5a767387 fix(find): finding by ref may return Node, not just Element 125ea2fa6c0c757c0628f21aa1b1f60f996ca323

    Other

    chore(findComponent): refactor find & findComponent (fixes #​716, #​899) chore(compat): Always treat legacy functional components as function bb44d9e4b92b852db7dc588c0d663f33739d41de

    evanw/esbuild

    v0.14.34

    Compare Source

    Something went wrong with the publishing script for the previous release. Publishing again.

    v0.14.33

    Compare Source

    • Fix a regression regarding super (#​2158)

      This fixes a regression from the previous release regarding classes with a super class, a private member, and a static field in the scenario where the static field needs to be lowered but where private members are supported by the configured target environment. In this scenario, esbuild could incorrectly inject the instance field initializers that use this into the constructor before the call to super(), which is invalid. This problem has now been fixed (notice that this is now used after super() instead of before):

      // Original code
      class Foo extends Object {
        static FOO;
        constructor() {
          super();
        }
        #foo;
      }
      
      // Old output (with --bundle)
      var _foo;
      var Foo = class extends Object {
        constructor() {
          __privateAdd(this, _foo, void 0);
          super();
        }
      };
      _foo = new WeakMap();
      __publicField(Foo, "FOO");
      
      // New output (with --bundle)
      var _foo;
      var Foo = class extends Object {
        constructor() {
          super();
          __privateAdd(this, _foo, void 0);
        }
      };
      _foo = new WeakMap();
      __publicField(Foo, "FOO");
      

      During parsing, esbuild scans the class and makes certain decisions about the class such as whether to lower all static fields, whether to lower each private member, or whether calls to super() need to be tracked and adjusted. Previously esbuild made two passes through the class members to compute this information. However, with the new super() call lowering logic added in the previous release, we now need three passes to capture the whole dependency chain for this case: 1) lowering static fields requires 2) lowering private members which requires 3) adjusting super() calls.

      The reason lowering static fields requires lowering private members is because lowering static fields moves their initializers outside of the class body, where they can't access private members anymore. Consider this code:

      class Foo {
        get #foo() {}
        static bar = new Foo().#foo
      }
      

      We can't just lower static fields without also lowering private members, since that causes a syntax error:

      class Foo {
        get #foo() {}
      }
      Foo.bar = new Foo().#foo;
      

      And the reason lowering private members requires adjusting super() calls is because the injected private member initializers use this, which is only accessible after super() calls in the constructor.

    • Fix an issue with --keep-names not keeping some names (#​2149)

      This release fixes a regression with --keep-names from version 0.14.26. PR #​2062 attempted to remove superfluous calls to the __name helper function by omitting calls of the form __name(foo, "foo") where the name of the symbol in the first argument is equal to the string in the second argument. This was assuming that the initializer for the symbol would automatically be assigned the expected .name property by the JavaScript VM, which turned out to be an incorrect assumption. To fix the regression, this PR has been reverted.

      The assumption is true in many cases but isn't true when the initializer is moved into another automatically-generated variable, which can sometimes be necessary during the various syntax transformations that esbuild does. For example, consider the following code:

      class Foo {
        static get #foo() { return Foo.name }
        static get foo() { return this.#foo }
      }
      let Bar = Foo
      Foo = { name: 'Bar' }
      console.log(Foo.name, Bar.name)
      

      This code should print Bar Foo. With --keep-names --target=es6 that code is lowered by esbuild into the following code (omitting the helper function definitions for brevity):

      var _foo, foo_get;
      const _Foo = class {
        static get foo() {
          return __privateGet(this, _foo, foo_get);
        }
      };
      let Foo = _Foo;
      __name(Foo, "Foo");
      _foo = new WeakSet();
      foo_get = /* @&#8203;__PURE__ */ __name(function() {
        return _Foo.name;
      }, "#foo");
      __privateAdd(Foo, _foo);
      let Bar = Foo;
      Foo = { name: "Bar" };
      console.log(Foo.name, Bar.name);
      

      The injection of the automatically-generated _Foo variable is necessary to preserve the semantics of the captured Foo binding for methods defined within the class body, even when the definition needs to be moved outside of the class body during code transformation. Due to a JavaScript quirk, this binding is immutable and does not change even if Foo is later reassigned. The PR that was reverted was incorrectly removing the call to __name(Foo, "Foo"), which turned out to be necessary after all in this case.

    • Print some large integers using hexadecimal when minifying (#​2162)

      When --minify is active, esbuild will now use one fewer byte to represent certain large integers:

      // Original code
      x = 123456787654321;
      
      // Old output (with --minify)
      x=123456787654321;
      
      // New output (with --minify)
      x=0x704885f926b1;
      

      This works because a hexadecimal representation can be shorter than a decimal representation starting at around 1012 and above.

      This optimization made me realize that there's probably an opportunity to optimize printed numbers for smaller gzipped size instead of or in addition to just optimizing for minimal uncompressed byte count. The gzip algorithm does better with repetitive sequences, so for example 0xFFFFFFFF is probably a better representation than 4294967295 even though the byte counts are the same. As far as I know, no JavaScript minifier does this optimization yet. I don't know enough about how gzip works to know if this is a good idea or what the right metric for this might be.

    • Add Linux ARM64 support for Deno (#​2156)

      This release adds Linux ARM64 support to esbuild's Deno API implementation, which allows esbuild to be used with Deno on a Raspberry Pi.

    v0.14.32

    Compare Source

    • Fix super usage in lowered private methods (#​2039)

      Previously esbuild failed to transform super property accesses inside private methods in the case when private methods have to be lowered because the target environment doesn't support them. The generated code still contained the super keyword even though the method was moved outside of the class body, which is a syntax error in JavaScript. This release fixes this transformation issue and now produces valid code:

      // Original code
      class Derived extends Base {
        #foo() { super.foo() }
        bar() { this.#foo() }
      }
      
      // Old output (with --target=es6)
      var _foo, foo_fn;
      class Derived extends Base {
        constructor() {
          super(...arguments);
          __privateAdd(this, _foo);
        }
        bar() {
          __privateMethod(this, _foo, foo_fn).call(this);
        }
      }
      _foo = new WeakSet();
      foo_fn = function() {
        super.foo();
      };
      
      // New output (with --target=es6)
      var _foo, foo_fn;
      const _Derived = class extends Base {
        constructor() {
          super(...arguments);
          __privateAdd(this, _foo);
        }
        bar() {
          __privateMethod(this, _foo, foo_fn).call(this);
        }
      };
      let Derived = _Derived;
      _foo = new WeakSet();
      foo_fn = function() {
        __superGet(_Derived.prototype, this, "foo").call(this);
      };
      

      Because of this change, lowered super property accesses on instances were rewritten so that they can exist outside of the class body. This rewrite affects code generation for all super property accesses on instances including those inside lowered async functions. The new approach is different but should be equivalent to the old approach:

      // Original code
      class Foo {
        foo = async () => super.foo()
      }
      
      // Old output (with --target=es6)
      class Foo {
        constructor() {
          __publicField(this, "foo", () => {
            var __superGet = (key) => super[key];
            return __async(this, null, function* () {
              return __superGet("foo").call(this);
            });
          });
        }
      }
      
      // New output (with --target=es6)
      class Foo {
        constructor() {
          __publicField(this, "foo", () => __async(this, null, function* () {
            return __superGet(Foo.prototype, this, "foo").call(this);
          }));
        }
      }
      
    • Fix some tree-shaking bugs regarding property side effects

      This release fixes some cases where side effects in computed properties were not being handled correctly. Specifically primitives and private names as properties should not be considered to have side effects, and object literals as properties should be considered to have side effects:

      // Original code
      let shouldRemove = { [1]: 2 }
      let shouldRemove2 = class { #foo }
      let shouldKeep = class { [{ toString() { sideEffect() } }] }
      
      // Old output (with --tree-shaking=true)
      let shouldRemove = { [1]: 2 };
      let shouldRemove2 = class {
        #foo;
      };
      
      // New output (with --tree-shaking=true)
      let shouldKeep = class {
        [{ toString() {
          sideEffect();
        } }];
      };
      
    • Add the wasmModule option to the initialize JS API (#​1093)

      The initialize JS API must be called when using esbuild in the browser to provide the WebAssembly module for esbuild to use. Previously the only way to do that was using the wasmURL API option like this:

      await esbuild.initialize({
        wasmURL: '/node_modules/esbuild-wasm/esbuild.wasm',
      })
      console.log(await esbuild.transform('1+2'))
      

      With this release, you can now also initialize esbuild using a WebAssembly.Module instance using the wasmModule API option instead. The example above is equivalent to the following code:

      await esbuild.initialize({
        wasmModule: await WebAssembly.compileStreaming(fetch('/node_modules/esbuild-wasm/esbuild.wasm'))
      })
      console.log(await esbuild.transform('1+2'))
      

      This could be useful for environments where you want more control over how the WebAssembly download happens or where downloading the WebAssembly module is not possible.

    v0.14.31

    Compare Source

    • Add support for parsing "optional variance annotations" from TypeScript 4.7 (#​2102)

      The upcoming version of TypeScript now lets you specify in and/or out on certain type parameters (specifically only on a type alias, an interface declaration, or a class declaration). These modifiers control type paramemter covariance and contravariance:

      type Provider<out T> = () => T;
      type Consumer<in T> = (x: T) => void;
      type Mapper<in T, out U> = (x: T) => U;
      type Processor<in out T> = (x: T) => T;
      

      With this release, esbuild can now parse these new type parameter modifiers. This feature was contributed by @​magic-akari.

    • Improve support for super() constructor calls in nested locations (#​2134)

      In JavaScript, derived classes must call super() somewhere in the constructor method before being able to access this. Class public instance fields, class private instance fields, and TypeScript constructor parameter properties can all potentially cause code which uses this to be inserted into the constructor body, which must be inserted after the super() call. To make these insertions straightforward to implement, the TypeScript compiler doesn't allow calling super() somewhere other than in a root-level statement in the constructor body in these cases.

      Previously esbuild's class transformations only worked correctly when super() was called in a root-level statement in the constructor body, just like the TypeScript compiler. But with this release, esbuild should now generate correct code as long as the call to super() appears anywhere in the constructor body:

      // Original code
      class Foo extends Bar {
        constructor(public skip = false) {
          if (skip) {
            super(null)
            return
          }
          super({ keys: [] })
        }
      }
      
      // Old output (incorrect)
      class Foo extends Bar {
        constructor(skip = false) {
          if (skip) {
            super(null);
            return;
          }
          super({ keys: [] });
          this.skip = skip;
        }
      }
      
      // New output (correct)
      class Foo extends Bar {
        constructor(skip = false) {
          var __super = (...args) => {
            super(...args);
            this.skip = skip;
          };
          if (skip) {
            __super(null);
            return;
          }
          __super({ keys: [] });
        }
      }
      
    • Add support for the new @container CSS rule (#​2127)

      This release adds support for @container in CSS files. This means esbuild will now pretty-print and minify these rules better since it now better understands the internal structure of these rules:

      /* Original code */
      @&#8203;container (width <= 150px) {
        #inner {
          color: yellow;
        }
      }
      
      /* Old output (with --minify) */
      @&#8203;container (width <= 150px){#inner {color: yellow;}}
      
      /* New output (with --minify) */
      @&#8203;container (width <= 150px){#inner{color:#ff0}}
      

      This was contributed by @​yisibl.

    • Avoid CSS cascade-dependent keywords in the font-family property (#​2135)

      In CSS, initial, inherit, and unset are CSS-wide keywords which means they have special behavior when they are specified as a property value. For example, while font-family: 'Arial' (as a string) and font-family: Arial (as an identifier) are the same, font-family: 'inherit' (as a string) uses the font family named inherit but font-family: inherit (as an identifier) inherits the font family from the parent element. This means esbuild must not unquote these CSS-wide keywords (and default, which is also reserved) during minification to avoid changing the meaning of the minified CSS.

      The current draft of the new CSS Cascading and Inheritance Level 5 specification adds another concept called cascade-dependent keywords of which there are two: revert and revert-layer. This release of esbuild guards against unquoting these additional keywords as well to avoid accidentally breaking pages that use a font with the same name:

      /* Original code */
      a { font-family: 'revert'; }
      b { font-family: 'revert-layer', 'Segoe UI', serif; }
      
      /* Old output (with --minify) */
      a{font-family:revert}b{font-family:revert-layer,Segoe UI,serif}
      
      /* New output (with --minify) */
      a{font-family:"revert"}b{font-family:"revert-layer",Segoe UI,serif}
      

      This fix was contributed by @​yisibl.

    v0.14.30

    Compare Source

    • Change the context of TypeScript parameter decorators (#​2147)

      While TypeScript parameter decorators are expressions, they are not evaluated where they exist in the code. They are moved to after the class declaration and evaluated there instead. Specifically this TypeScript code:

      class Class {
        method(@&#8203;decorator() arg) {}
      }
      

      becomes this JavaScript code:

      class Class {
        method(arg) {}
      }
      __decorate([
        __param(0, decorator())
      ], Class.prototype, "method", null);
      

      This has several consequences:

      • Whether await is allowed inside a decorator expression or not depends on whether the class declaration itself is in an async context or not. With this release, you can now use await inside a decorator expression when the class declaration is either inside an async function or is at the top-level of an ES module and top-level await is supported. Note that the TypeScript compiler currently has a bug regarding this edge case: https://github.com/microsoft/TypeScript/issues/48509.

        // Using "await" inside a decorator expression is now allowed
        async function fn(foo: Promise<any>) {
          class Class {
            method(@&#8203;decorator(await foo) arg) {}
          }
          return Class
        }
        

        Also while TypeScript currently allows await to be used like this in async functions, it doesn't currently allow yield to be used like this in generator functions. It's not yet clear whether this behavior with yield is a bug or by design, so I haven't made any changes to esbuild's handling of yield inside decorator expressions in this release.

      • Since the scope of a decorator expression is the scope enclosing the class declaration, they cannot access private identifiers. Previously this was incorrectly allowed but with this release, esbuild no longer allows this. Note that the TypeScript compiler currently has a bug regarding this edge case: https://github.com/microsoft/TypeScript/issues/48515.

        // Using private names inside a decorator expression is no longer allowed
        class Class {
          static #priv = 123
          method(@&#8203;decorator(Class.#priv) arg) {}
        }
        
      • Since the scope of a decorator expression is the scope enclosing the class declaration, identifiers inside parameter decorator expressions should never be resolved to a parameter of the enclosing method. Previously this could happen, which was a bug with esbuild. This bug no longer happens in this release.

        // Name collisions now resolve to the outer name instead of the inner name
        let arg = 1
        class Class {
          method(@&#8203;decorator(arg) arg = 2) {}
        }
        

        Specifically previous versions of esbuild generated the following incorrect JavaScript (notice the use of arg2):

        let arg = 1;
        class Class {
          method(arg2 = 2) {
          }
        }
        __decorateClass([
          __decorateParam(0, decorator(arg2))
        ], Class.prototype, "method", 1);
        

        This release now generates the following correct JavaScript (notice the use of arg):

        let arg = 1;
        class Class {
          method(arg2 = 2) {
          }
        }
        __decorateClass([
          __decorateParam(0, decorator(arg))
        ], Class.prototype, "method", 1);
        
    • Fix some obscure edge cases with super property access

      This release fixes the following obscure problems with super when targeting an older JavaScript environment such as --target=es6:

      1. The compiler could previously crash when a lowered async arrow function contained a class with a field initializer that used a super property access:

        let foo = async () => class extends Object {
          bar = super.toString
        }
        
      2. The compiler could previously generate incorrect code when a lowered async method of a derived class contained a nested class with a computed class member involving a super property access on the derived class:

        class Base {
          foo() { return 'bar' }
        }
        class Derived extends Base {
          async foo() {
            return new class { [super.foo()] = 'success' }
          }
        }
        new Derived().foo().then(obj => console.log(obj.bar))
        
      3. The compiler could previously generate incorrect code when a default-exported class contained a super property access inside a lowered static private class field:

        class Foo {
          static foo = 123
        }
        export default class extends Foo {
          static #foo = super.foo
          static bar = this.#foo
        }
        
    eslint/eslint

    v8.13.0

    Compare Source

    Features

    • 274acbd feat: fix no-eval logic for this in arrow functions (#​15755) (Milos Djermanovic)

    Bug Fixes

    • 97b57ae fix: invalid operator in operator-assignment messages (#​15759) (Milos Djermanovic)

    Documentation

    • c32482e docs: Typo in space-infix-ops docs (#​15754) (kmin-jeong)
    • f2c2d35 docs: disambiguate types FormatterFunction and LoadedFormatter (#​15727) (Francesco Trotta)

    Chores

    • bb4c0d5 chore: Refactor docs to work with docs.eslint.org (#​15744) (Nicholas C. Zakas)
    • d36f12f chore: remove lib/init from eslint config (#​15748) (Milos Djermanovic)
    • a59a4e6 chore: replace trimLeft/trimRight with trimStart/trimEnd (#​15750) (Milos Djermanovic)
    pnpm/pnpm

    v6.32.6

    Compare Source

    Patch Changes

    • Linked in dependencies should be considered when resolving peer dependencies #​4541.
    • Peer dependency should be correctly resolved from the workspace, when it is declared using a workspace protocol #​4529.

    Full Changelog: https://github.com/pnpm/pnpm/compare/v6.32.5...v6.32.6

    v6.32.5

    Compare Source

    prettier/prettier

    v2.6.2

    Compare Source

    diff

    Fix LESS/SCSS format error (#​12536 by @​fisker)
    // Input
    .background-gradient(@&#8203;cut) {
        background: linear-gradient(
            to right,
            @&#8203;white 0%,
            @&#8203;white (@&#8203;cut - 0.01%),
            @&#8203;portal-background @&#8203;cut,
            @&#8203;portal-background 100%
        );
    }
    
    // Prettier 2.6.1
    TypeError: Cannot read properties of undefined (reading 'endOffset')
    
    // Prettier 2.6.2
    .background-gradient(@&#8203;cut) {
      background: linear-gradient(
        to right,
        @&#8203;white 0%,
        @&#8203;white (@&#8203;cut - 0.01%),
        @&#8203;portal-background @&#8203;cut,
        @&#8203;portal-background 100%
      );
    }
    
    Update meriyah to fix several bugs (#​12567 by @​fisker, fixes in meriyah by @​3cp)

    Fixes bugs when parsing following valid code:

    foo(await bar());
    
    const regex = /.*/ms;
    
    const element = <p>{/w/.test(s)}</p>;
    
    class A extends B {
      #privateMethod() {
        super.method();
      }
    }
    
    release-it/release-it

    v14.14.1

    Compare Source

    NOTE This is the latest release still supporting Node.js v10. Major issues reported in release-it v14 might still receive bug fixes and patch releases, but no new features.

    • Update dependencies (still supporting Node.js v10) (7018194)
    • Add note about using Inquirer.js in hooks (closes #​821) (2f10cc4)
    • Add comment re. quoting CLI hook arguments (closes #​865) (ea11a0d)
    • Also transfer tagMatch to release plugins (fixes #​885) (0e0ad33)
    • Downgrade mock-fs and install polyfill for Promise.allSettled (to support Node v10) (56f1ec7)
    • test: fix CI test for different Node versions (#​888) (e8a57cc)
    • chore(deps): downgrade inquirer from 8.2.2 to 8.2.0 to avoid dropping Node 10 support (#​887) (2a9a31c)
    npm/node-semver

    v7.3.6

    Compare Source

    vitest-dev/vitest

    v0.9.2

    Compare Source

    v0.9.1

    Compare Source

    Bug Fixes
    Features

    v0.9.0

    Compare Source

    Bug Fixes
    • vite-node: remove unsafe checks for inlining dependencies (#​1097) (c4a25ae)
    Features

    v0.8.5

    Compare Source

    Bug Fixes
    Features

    v0.8.4

    Compare Source

    Bug Fixes
    Features
    • add commands to run tests depending on changed files (#​1078) (3c965d4)
    • reprint all tests, if one of the test files was deleted (#​1081) (2ded624)

    v0.8.3

    Compare Source

    Bug Fixes
    Features

    v0.8.2

    Compare Source

    Bug Fixes

    Configuration

    📅 Schedule: 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.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

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

    opened by renovate[bot] 1
  • chore(deps): update all non-major dependencies

    chore(deps): update all non-major dependencies

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | happy-dom | ^2.53.1 -> ^2.55.0 | age | adoption | passing | confidence | | pnpm (source) | 6.32.2 -> 6.32.4 | age | adoption | passing | confidence | | release-it | ^14.13.1 -> ^14.14.0 | age | adoption | passing | confidence |


    Release Notes

    capricorn86/happy-dom

    v2.55.0

    Compare Source

    :art: Features
    • Adds support for HTMLBaseElement. (#​429)
    • Adds support for Node.baseURI. (#​429)

    v2.54.0

    Compare Source

    :art: Features
    • Adds support for HTMLInputElement.setCustomValidity(), HTMLInputElement.reportValidity() and HTMLInputElement.validationMessage. (#​442)
    pnpm/pnpm

    v6.32.4

    Compare Source

    Patch Changes
    • Show a friendly error message when it is impossible to get the current Git branch name during publish #​4488.
    • When checking if the lockfile is up-to-date, an empty dependenciesMeta field in the manifest should be satisfied by a not set field in the lockfile #​4463.
    • It should be possible to reference a workspace project that has no version specified in its package.json #​4487.

    v6.32.3

    Compare Source

    Patch Changes
    • 4941f31: The location of an injected directory dependency should be correctly located, when there is a chain of local dependencies (declared via the file: protocol`).

      The next scenario was not working prior to the fix. There are 3 projects in the same folder: foo, bar, qar.

      foo/package.json:

      {
        "name": "foo",
        "dependencies": {
          "bar": "file:../bar"
        },
        "dependenciesMeta": {
          "bar": {
            "injected": true
          }
        }
      }
      

      bar/package.json:

      {
        "name": "bar",
        "dependencies": {
          "qar": "file:../qar"
        },
        "dependenciesMeta": {
          "qar": {
            "injected": true
          }
        }
      }
      

      qar/package.json:

      {
        "name": "qar"
      }
      

      Related PR: #​4415.

    release-it/release-it

    v14.14.0

    Compare Source

    • Update dependencies (c61c780)
    • Minor edits to new gitlab milestones feature (63869b8)
    • Add gitlab.milestones option to associate milestones with a release (#​883) (af0882f)
    • More consistently use example.org in docs, links and even tests (3ccdef0)
    • Clarify the github.host config option (#​875) (6d7c3f2)

    Configuration

    📅 Schedule: 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.

    👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


    • [ ] If you want to rebase/retry this PR, click this checkbox.

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

    opened by renovate[bot] 1
  • chore(deps): update all non-major dependencies

    chore(deps): update all non-major dependencies

    WhiteSource Renovate

    This PR contains the following updates:

    | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | happy-dom | ^2.51.0 -> ^2.53.1 | age | adoption | passing | confidence | | vite | ^2.8.6 -> ^2.9.1 | age | adoption | passing | confidence | | vitest | ^0.8.0 -> ^0.8.1 | age | adoption | passing | confidence |


    Release Notes

    capricorn86/happy-dom

    v2.53.1

    Compare Source

    :construction_worker_man: Patch fixes
    • Adds support for sending in other values than strings as tag name to Document.createElement() and Document.createElementNS(). (#​422)

    v2.53.0

    Compare Source

    :art: Features
    • Adds support for setting and deleting values in the HTMLElement.dataset object. The changes will be reflected to the attributes of the element. (#​405)
    • Improves performance of Element.getAttributeNS() which is used in many places within Happy DOM. (#​405)
    :construction_worker_man: Patch fixes
    • Fixes issue with dataset keys not being in lower camel case. (#​435)

    v2.52.0

    Compare Source

    :art: Features
    • Adds support for Node.ELEMENT_NODE, Node.TEXT_NODE etc. on the instance. It it currently only available statically. (#​433)

    v2.51.1

    Compare Source

    :construction_worker_man: Patch fixes
    • Fixes issue with Document.activeElement not being the first custom element that has document as root node when the focused element is nestled in shadow roots. (#​434)
    vitejs/vite

    v2.9.1

    Compare Source

    v2.9.0

    Compare Source

    Faster Cold Start

    Before 2.9, the first time dev was run on a project Vite needed to perform a scan phase to discover dependencies and then pre-bundle them before starting the server. In 2.9 both scanning #​7379 and pre-bundling #​6758 of dependencies are now non-blocking, so the server starts right away during cold start. We also now allow requests to flow through the pipeline improving initial cold start load speed and increasing the chances of discovering new missing dependencies when re-processing and letting Vite populate the module graph and the browser to process files. In many cases, there is also no need to full-reload the page when new dependencies are discovered.

    CSS Sourcemap support during dev (experimental)

    Vite now supports CSS sourcemaps #​7173. This feature is still experimental, and it is disabled by default to avoid incurring a performance penalty for users that don't need it. To enable it, set css.devSourcemap to true.

    Avoid splitting vendor chunks by default

    Vite's default chunking strategy was a good fit for most SPAs, but it wasn't ideal in some other use cases. Vite doesn't have enough context to make the best decision here, so in Vite 2.9 the previous chunking strategy is now opt-in #​6534 and Vite will no longer split vendor libs in a separate chunk.

    Web Workers enhancements

    Web Workers now supports source map generation (see #​5417). The implementation is also now more robust, fixing several issues encountered in previous versions (#​6599).

    Raw Glob Imports

    Glob imports support for the raw modifier syntax has changed to using { as: 'raw' }, which works in the same way as the ?raw suffix in regular imports:

    const examples = import.meta.globEager('./examples/*.html', { as: 'raw' })
    

    The { assert: { type: 'raw' }} syntax introduced in v2.8 has been deprecated. See #​7017 for more information.

    New tools for Plugin and Framework Authors
    Client Server Communication API

    Vite now provides utilities for plugins to help handle the communication with clients connected to Vite's server #​7437. Reusing the open WebSocket connection between the server and clients several use cases can be simplified (vite-plugin-inspect, SliDev, and many others). Check out the Client Server Communication docs for more information.

    // Send a message from the client to the server
    if (import.meta.hot) {
      import.meta.hot.send('my:from-client', { msg: 'Hey!' })
    }
    
    // And listen to client messages in a plugin
      configureServer(server) {
        server.ws.on('my:from-client', (data, client) => {
          console.log('Message from client:', data.msg) // Hey!
          // ...
        })
      }
    
    importedCss and importedAssets to RenderedChunk type

    Replace the internal chunkToEmittedCssFileMap and chunkToEmittedAssetsMap variables with public properties added by Vite to RenderedChunk objects in the renderChunk phase. These is useful for Vite-based frameworks that generate their own HTML. See #​6629.

    Optimize Custom Extensions (experimental)

    A new optimizeDeps.extensions: string[] option is available to enable pre-bundling of custom extensions. A respective esbuild plugin is required to handle that extension. e.g. ['.svelte', '.svelte.md']. See #​6801 for more information.

    Bug Fixes
    Features
    Beta Changelogs
    2.9.0-beta.11 (2022-03-29)

    See 2.9.0-beta.11 changelog

    2.9.0-beta.10 (2022-03-28)

    See 2.9.0-beta.10 changelog

    2.9.0-beta.9 (2022-03-26)

    See 2.9.0-beta.9 changelog

    2.9.0-beta.8 (2022-03-24)

    See 2.9.0-beta.8 changelog

    2.9.0-beta.7 (2022-03-23)

    See 2.9.0-beta.7 changelog

    2.9.0-beta.6 (2022-03-22)

    See 2.9.0-beta.6 changelog

    2.9.0-beta.5 (2022-03-22)

    See 2.9.0-beta.5 changelog

    2.9.0-beta.4 (2022-03-19)

    See 2.9.0-beta.4 changelog

    2.9.0-beta.3 (2022-03-16)

    See 2.9.0-beta.3 changelog

    2.9.0-beta.2 (2022-03-14)

    See 2.9.0-beta.2 changelog

    2.9.0-beta.1 (2022-03-14)

    See 2.9.0-beta.1 changelog

    2.9.0-beta.0 (2022-03-09)

    See 2.9.0-beta.0 changelog

    2.8.6 (2022-03-01)

    Bug Fixes

    2.8.5 (2022-02-28)

    Bug Fixes
    • ?html-proxy with trailing = added by some servers (#​7093) (5818ac9)
    • allow optional trailing comma in asset import.meta.url (#​6983) (2debb9f)
    • cannot reassign process.env.NODE_ENV in ssr (#​6989) (983feb2)
    • config: Warn about terserOptions in more cases (#​7101) (79428ad)
    • don't override user config (#​7034) (8fd8f6e)
    • fileToBuiltUrl got undefined when file type is .ico (#​7106) (7a1a552)
    • glob: css imports injecting a ?used query to export the css string (#​6949) (0b3f4ef)
    • hmr: hmr style tag no support in html (#​7052) (a9dfce3)
    • image -> image/x-icon (#​7120) (065ceca)
    • import with query with exports field (#​7073) (88ded7f)
    • prebundle dep with colon (#​7006) (2136f2b)
    • recycle serve to avoid preventing Node self-exit (#​6895) (d6b2c53)
    • resolve @​import of the proxied