Breaking change on 1.6.0 from 1.5.3
Hi, I just wanted to notify that it seems like a breaking change was made from 1.5.3 to 1.6.0 that was not mentioned in the change notes on GitHub Releases. The responsible commit seems to be https://github.com/kindspells/astro-shield/commit/5887b4d4f0f9bb32b36da97ed2ca1e1db5131fda which from the commit message seems innocent and only related to Vercel, but changes core things within the build process.
I am not familiar enough with the code, but it seems like the astro:build:done hook is now added in astro:config:setup, which causes breakage for users who are expecting their integration to run after Astro Shield. Now, since the build done step is being added later, it runs after all other integrations specified in the Astro config. People can work around this by instead injecting their build done step during config setup, like so:
const astroCSPHashExporterSetup: AstroIntegration = {
name: "astro-csp-hash-exporter",
hooks: {
"astro:config:setup": async ({ updateConfig }) => {
updateConfig({ integrations: [astroCSPHashExporter] });
},
},
};
Personally, I used this to generate my own file using the hashes module. It took me a while to understand what had changed, what was responsible, and how to fix it by going through the code myself. It would be very helpful if a note was added to the change notes indicating that this breaking change was made, and how to resolve it. Thank you for making such an amazing tool!
Hi @mastercoms , thank you for reporting this. I'm sorry for the inconvenience, I'll try to fix it ASAP.
I can introduce some conditional logic ensuring that the hack I introduced is only enabled by default for Vercel, and introduce an additional knob for those who want to enable it even when not deploying on Vercel.
Sounds good! Thanks for the quick response and no worries!
@mastercoms fixed.