nuxt-community / sentry-module

Sentry module for Nuxt 2
https://sentry.nuxtjs.org
MIT License
500 stars 113 forks source link

chore(deps): update dependency defu to v6.1.3 #607

Closed renovate[bot] closed 11 months ago

renovate[bot] commented 1 year ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
defu 6.1.2 -> 6.1.3 age adoption passing confidence

Release Notes

unjs/defu (defu) ### [`v6.1.3`](https://togithub.com/unjs/defu/blob/HEAD/CHANGELOG.md#v613) [Compare Source](https://togithub.com/unjs/defu/compare/v6.1.2...v6.1.3) [compare changes](https://togithub.com/unjs/defu/compare/v6.1.2...v6.1.3) ##### 🩹 Fixes - Only merge plain objects ([#​111](https://togithub.com/unjs/defu/pull/111)) ##### πŸ“– Documentation - Update badges ([581dd92](https://togithub.com/unjs/defu/commit/581dd92)) - Fix typo ([#​96](https://togithub.com/unjs/defu/pull/96)) - Fix the result of the array merging ([#​99](https://togithub.com/unjs/defu/pull/99)) - Fix typo ([#​107](https://togithub.com/unjs/defu/pull/107)) ##### πŸ“¦ Build - Backward compatible cjs entry ([#​110](https://togithub.com/unjs/defu/pull/110)) ##### 🏑 Chore - Update dependencies ([63d0e8e](https://togithub.com/unjs/defu/commit/63d0e8e)) - Enable ts strict mode ([82d68c7](https://togithub.com/unjs/defu/commit/82d68c7)) - Fix tests ([59d0f6a](https://togithub.com/unjs/defu/commit/59d0f6a)) ##### 🎨 Styles - Format with prettier v3 ([32650f1](https://togithub.com/unjs/defu/commit/32650f1)) ##### ❀️ Contributors - Pooya Parsa ([@​pi0](http://github.com/pi0)) - Abdul Al-Hasany - Kricsleo - Donald Shtjefni ([@​dnldsht](http://github.com/dnldsht)) - SΓ©bastien Chopin

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.



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

github-actions[bot] commented 1 year ago

size-limit report πŸ“¦

Path Size
fixture: base 381.53 KB (0%)
fixture: lazy 386.28 KB (0%)
fixture: tracing 401.72 KB (0%)
fixture: lazy+tracing 406.43 KB (0%)
rchl commented 11 months ago

@pi0 I suppose "Only merge plain objects (#​111)" is considered a bugfix but maybe you are interested in knowing that it breaks testing here.

The code is roughly:

const config = await import(`${dir}/fixture/${fixture ? fixture + '/' : ''}nuxt.config.cjs`)

const result = defu(override, config)

and those are logged objects:

  override: {
    sentry: {
      dsn: 'http://acacaeaccacacacabcaacdacdacadaca@localhost:58160/000001'
    }
  },
  config: [Object: null prototype] [Module] {
    rootDir: [Getter],
    telemetry: [Getter],
    dev: [Getter],
    render: [Getter],
    modules: [Getter],
    sentry: [Getter],
    publicRuntimeConfig: [Getter],
    default: {
      rootDir: '/usr/local/workspace/nuxt/sentry-module/test/fixture/lazy',
      telemetry: false,
      dev: false,
      render: [Object],
      modules: [Array],
      sentry: [Object],
      publicRuntimeConfig: [Object]
    }
  },
  result: {
    sentry: {
      dsn: 'http://acacaeaccacacacabcaacdacdacadaca@localhost:58160/000001'
    }
  }

So the object returned from async import is strangely not a POD and it fails. Not sure if that's normal for async import or it's because of running within jest but I guess it's an interesting case where this bug fix is a breaking change.

rchl commented 11 months ago

I'm adding a workaround for this but I wonder whether this apparent fix should be adjusted to work in this case...

I'm gonna do:

  // Returned object has "Module" type which defu ignores because it's not plain object.
  // Copy properties to the new object so that the object is not ignored.
  const config = Object.assign({}, await import(`${dir}/fixture/${fixture ? fixture + '/' : ''}nuxt.config.cjs`))