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

fix: duplicate BuildOutput.publicAssets #951

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

1natsu172
Copy link
Contributor

@1natsu172 1natsu172 commented Aug 31, 2024

I was logging about the #938 and noticed this.

The BuildOutput.publicAssets is increasing with each rebuild. publicAssets should not need to be merged like BuildOutput.steps because the current implementation is making copies.

BEFORE

[12:12:06] WXT 0.19.8
[12:12:07] ✔ Started dev server @ http://localhost:3000
[12:12:07] ℹ Pre-rendering chrome-mv3 for development with Vite 5.3.5
[12:12:08] ✔ Built extension in 812 ms
  ├─ .output/chrome-mv3/manifest.json               1.04 kB  
  ├─ .output/chrome-mv3/popup.html                  636 B    
  ├─ .output/chrome-mv3/background.js               126.73 kB
  ├─ .output/chrome-mv3/chunks/popup-BxzUToPe.js    8.16 kB  
  ├─ .output/chrome-mv3/content-scripts/content.js  133.94 kB
  ├─ .output/chrome-mv3/icon/128.png                3.07 kB  
  ├─ .output/chrome-mv3/icon/16.png                 559 B    
  ├─ .output/chrome-mv3/icon/32.png                 916 B    
  ├─ .output/chrome-mv3/icon/48.png                 1.33 kB  
  ├─ .output/chrome-mv3/icon/96.png                 2.37 kB  
  └─ .output/chrome-mv3/wxt.svg                     1.07 kB  
Σ Total size: 279.83 kB                                              
[12:12:09] ✔ Opened browser in 1.379 s
server.currentOutput {
  manifest: {
    manifest_version: 3,
    name: 'wxt-starter',
    description: 'manifest.json description',
    version: '0.0.0',
    short_name: undefined,
    icons: {
      '16': 'icon/16.png',
      '32': 'icon/32.png',
      '48': 'icon/48.png',
      '96': 'icon/96.png',
      '128': 'icon/128.png'
    },
    commands: { 'wxt:reload-extension': [Object] },
    version_name: undefined,
    background: { type: undefined, service_worker: 'background.js' },
    action: {
      default_title: 'Default Popup Title',
      default_popup: 'popup.html'
    },
    host_permissions: [ '*://*.google.com/*', 'http://localhost/*' ],
    content_security_policy: {
      extension_pages: "script-src 'self' 'wasm-unsafe-eval' http://localhost:3000; object-src 'self';",
      sandbox: "script-src 'self' 'unsafe-inline' 'unsafe-eval' http://localhost:3000; sandbox allow-scripts allow-forms allow-popups allow-modals; child-src 'self';"
    },
    permissions: [ 'tabs', 'scripting' ]
  },
  steps: [
    { entrypoints: [Object], chunks: [Array] },
    { entrypoints: [Object], chunks: [Array] },
    { entrypoints: [Array], chunks: [Array] }
  ],
  publicAssets: [
    { type: 'asset', fileName: 'manifest.json' },
    { type: 'asset', fileName: 'wxt.svg' },
    { type: 'asset', fileName: 'icon/128.png' },
    { type: 'asset', fileName: 'icon/16.png' },
    { type: 'asset', fileName: 'icon/32.png' },
    { type: 'asset', fileName: 'icon/48.png' },
    { type: 'asset', fileName: 'icon/96.png' }
  ]
}
[12:12:11] ℹ Changed@: entrypoints/content.ts
[12:12:12] ✔ Reloaded: content
server.currentOutput {
  manifest: {
    manifest_version: 3,
    name: 'wxt-starter',
    description: 'manifest.json description',
    version: '0.0.0',
    short_name: undefined,
    icons: {
      '16': 'icon/16.png',
      '32': 'icon/32.png',
      '48': 'icon/48.png',
      '96': 'icon/96.png',
      '128': 'icon/128.png'
    },
    commands: { 'wxt:reload-extension': [Object] },
    version_name: undefined,
    background: { type: undefined, service_worker: 'background.js' },
    action: {
      default_title: 'Default Popup Title',
      default_popup: 'popup.html'
    },
    host_permissions: [ '*://*.google.com/*', 'http://localhost/*' ],
    content_security_policy: {
      extension_pages: "script-src 'self' 'wasm-unsafe-eval' http://localhost:3000; object-src 'self';",
      sandbox: "script-src 'self' 'unsafe-inline' 'unsafe-eval' http://localhost:3000; sandbox allow-scripts allow-forms allow-popups allow-modals; child-src 'self';"
    },
    permissions: [ 'tabs', 'scripting' ]
  },
  steps: [
    { entrypoints: [Object], chunks: [Array] },
    { entrypoints: [Array], chunks: [Array] },
    { entrypoints: [Object], chunks: [Array] }
  ],
  publicAssets: [
    { type: 'asset', fileName: 'manifest.json' },
    { type: 'asset', fileName: 'wxt.svg' },
    { type: 'asset', fileName: 'icon/128.png' },
    { type: 'asset', fileName: 'icon/16.png' },
    { type: 'asset', fileName: 'icon/32.png' },
    { type: 'asset', fileName: 'icon/48.png' },
    { type: 'asset', fileName: 'icon/96.png' },
    { type: 'asset', fileName: 'manifest.json' },
    { type: 'asset', fileName: 'wxt.svg' },
    { type: 'asset', fileName: 'icon/128.png' },
    { type: 'asset', fileName: 'icon/16.png' },
    { type: 'asset', fileName: 'icon/32.png' },
    { type: 'asset', fileName: 'icon/48.png' },
    { type: 'asset', fileName: 'icon/96.png' }
  ]
}
[12:12:14] ℹ Changed@: entrypoints/content.ts
[12:12:14] ✔ Reloaded: content

AFTER

[12:11:13] WXT 0.19.8
[12:11:13] ✔ Started dev server @ http://localhost:3000
[12:11:13] ℹ Pre-rendering chrome-mv3 for development with Vite 5.3.5
[12:11:14] ✔ Built extension in 444 ms
  ├─ .output/chrome-mv3/manifest.json               1.04 kB  
  ├─ .output/chrome-mv3/popup.html                  636 B    
  ├─ .output/chrome-mv3/background.js               126.73 kB
  ├─ .output/chrome-mv3/chunks/popup-BxzUToPe.js    8.16 kB  
  ├─ .output/chrome-mv3/content-scripts/content.js  133.94 kB
  ├─ .output/chrome-mv3/icon/128.png                3.07 kB  
  ├─ .output/chrome-mv3/icon/16.png                 559 B    
  ├─ .output/chrome-mv3/icon/32.png                 916 B    
  ├─ .output/chrome-mv3/icon/48.png                 1.33 kB  
  ├─ .output/chrome-mv3/icon/96.png                 2.37 kB  
  └─ .output/chrome-mv3/wxt.svg                     1.07 kB  
Σ Total size: 279.83 kB                                              
[12:11:15] ✔ Opened browser in 1.252 s
server.currentOutput {
  manifest: {
    manifest_version: 3,
    name: 'wxt-starter',
    description: 'manifest.json description',
    version: '0.0.0',
    short_name: undefined,
    icons: {
      '16': 'icon/16.png',
      '32': 'icon/32.png',
      '48': 'icon/48.png',
      '96': 'icon/96.png',
      '128': 'icon/128.png'
    },
    commands: { 'wxt:reload-extension': [Object] },
    version_name: undefined,
    background: { type: undefined, service_worker: 'background.js' },
    action: {
      default_title: 'Default Popup Title',
      default_popup: 'popup.html'
    },
    host_permissions: [ '*://*.google.com/*', 'http://localhost/*' ],
    content_security_policy: {
      extension_pages: "script-src 'self' 'wasm-unsafe-eval' http://localhost:3000; object-src 'self';",
      sandbox: "script-src 'self' 'unsafe-inline' 'unsafe-eval' http://localhost:3000; sandbox allow-scripts allow-forms allow-popups allow-modals; child-src 'self';"
    },
    permissions: [ 'tabs', 'scripting' ]
  },
  steps: [
    { entrypoints: [Object], chunks: [Array] },
    { entrypoints: [Object], chunks: [Array] },
    { entrypoints: [Array], chunks: [Array] }
  ],
  publicAssets: [
    { type: 'asset', fileName: 'manifest.json' },
    { type: 'asset', fileName: 'wxt.svg' },
    { type: 'asset', fileName: 'icon/128.png' },
    { type: 'asset', fileName: 'icon/16.png' },
    { type: 'asset', fileName: 'icon/32.png' },
    { type: 'asset', fileName: 'icon/48.png' },
    { type: 'asset', fileName: 'icon/96.png' }
  ]
}
[12:11:31] ℹ Changed@: entrypoints/content.ts
[12:11:31] ✔ Reloaded: content
server.currentOutput {
  manifest: {
    manifest_version: 3,
    name: 'wxt-starter',
    description: 'manifest.json description',
    version: '0.0.0',
    short_name: undefined,
    icons: {
      '16': 'icon/16.png',
      '32': 'icon/32.png',
      '48': 'icon/48.png',
      '96': 'icon/96.png',
      '128': 'icon/128.png'
    },
    commands: { 'wxt:reload-extension': [Object] },
    version_name: undefined,
    background: { type: undefined, service_worker: 'background.js' },
    action: {
      default_title: 'Default Popup Title',
      default_popup: 'popup.html'
    },
    host_permissions: [ '*://*.google.com/*', 'http://localhost/*' ],
    content_security_policy: {
      extension_pages: "script-src 'self' 'wasm-unsafe-eval' http://localhost:3000; object-src 'self';",
      sandbox: "script-src 'self' 'unsafe-inline' 'unsafe-eval' http://localhost:3000; sandbox allow-scripts allow-forms allow-popups allow-modals; child-src 'self';"
    },
    permissions: [ 'tabs', 'scripting' ]
  },
  steps: [
    { entrypoints: [Object], chunks: [Array] },
    { entrypoints: [Array], chunks: [Array] },
    { entrypoints: [Object], chunks: [Array] }
  ],
  publicAssets: [
    { type: 'asset', fileName: 'manifest.json' },
    { type: 'asset', fileName: 'wxt.svg' },
    { type: 'asset', fileName: 'icon/128.png' },
    { type: 'asset', fileName: 'icon/16.png' },
    { type: 'asset', fileName: 'icon/32.png' },
    { type: 'asset', fileName: 'icon/48.png' },
    { type: 'asset', fileName: 'icon/96.png' }
  ]
}
[12:11:35] ℹ Changed@: entrypoints/content.ts
[12:11:36] ✔ Reloaded: content

Copy link

netlify bot commented Aug 31, 2024

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 75eb239
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/66d74142a37ea80008510494
😎 Deploy Preview https://deploy-preview-951--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@1natsu172
Copy link
Contributor Author

I don't know if this will solve his problem with #938. The problem of multiple Changed: logs on my machine is continuing.


BTW: Why CI failed at doc build 🤷 lockfile degradation occurs again?

@1natsu172 1natsu172 changed the title fix: fix duplicate publicAssets of BuildOutput fix: fix duplicate BuildOutput.publicAssets Aug 31, 2024
@1natsu172 1natsu172 changed the title fix: fix duplicate BuildOutput.publicAssets fix: duplicate BuildOutput.publicAssets Aug 31, 2024
Copy link
Collaborator

@aklinker1 aklinker1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find! I'll fix the checks.

Copy link

codecov bot commented Sep 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.84%. Comparing base (eb65d0b) to head (75eb239).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #951      +/-   ##
==========================================
- Coverage   81.95%   81.84%   -0.11%     
==========================================
  Files         125      125              
  Lines        6612     6605       -7     
  Branches     1102     1098       -4     
==========================================
- Hits         5419     5406      -13     
- Misses       1179     1185       +6     
  Partials       14       14              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aklinker1
Copy link
Collaborator

BTW: Why CI failed at doc build 🤷 lockfile degradation occurs again?

Yeah, looks like it. Time to switch to bun lol. I only ever have this happen with pnpm, when both Vite and Rollup are installed :/

@1natsu172
Copy link
Contributor Author

Heh, It's degrated by unbuild patch bump 026f782, but it looks like a pnpm bug. Let's go to bun 🥟

@aklinker1
Copy link
Collaborator

aklinker1 commented Sep 3, 2024

Already fixed it on main, so merging with main branch fixes it.

Let's go to bun 🥟

The one thing holding me back is that it doesn't have built-in version management, which I think is important for open-source projects with lots of people contributing :/

@aklinker1 aklinker1 merged commit da0acce into wxt-dev:main Sep 3, 2024
14 checks passed
@1natsu172
Copy link
Contributor Author

Yes, it's to be an internal breaking change. bun's problem is that not in corepack. Everyone needs to have their own global bun. 😫

@aklinker1
Copy link
Collaborator

Released in v0.19.9

@1natsu172 1natsu172 deleted the fix-duplicate-publicAssets branch November 15, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants