这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@jgerigmeyer
Copy link
Member

One approach to fixing #311 (regression introduced in #277).

@jgerigmeyer jgerigmeyer requested a review from jamesnw April 8, 2025 18:51
@netlify
Copy link

netlify bot commented Apr 8, 2025

Deploy Preview for anchor-polyfill ready!

Name Link
🔨 Latest commit d8ff610
🔍 Latest deploy log https://app.netlify.com/sites/anchor-polyfill/deploys/67f572c26508960008498fc8
😎 Deploy Preview https://deploy-preview-312--anchor-polyfill.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.

@netlify
Copy link

netlify bot commented Apr 8, 2025

Deploy Preview for anchor-position-wpt canceled.

Name Link
🔨 Latest commit d8ff610
🔍 Latest deploy log https://app.netlify.com/sites/anchor-position-wpt/deploys/67f572c2fb1cf800081492ea

@jgerigmeyer jgerigmeyer linked an issue Apr 8, 2025 that may be closed by this pull request
Copy link
Contributor

@jamesnw jamesnw left a comment

Choose a reason for hiding this comment

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

I think this works. A few things I noticed-

  1. This doesn't remove the line from our generated sourcemaps, for instance in css-anchor-positioning-fn.js.map, so our sourcemaps may not be correct.

  2. There is still a call to SourceMapGenerator in the bundled plugin. This is from css-tree, and looks like it would only be called if we called generate({sourceMap: true}), which we are not. It would be nice if we could remove that codepath from our bundled css-tree, but I don't think that's necessary.

I think this is a reasonable approach. Thanks for tracking it down!

@jgerigmeyer
Copy link
Member Author

  • This doesn't remove the line from our generated sourcemaps, for instance in css-anchor-positioning-fn.js.map, so our sourcemaps may not be correct.

Oh, interesting -- I hadn't considered that. How big of a deal do we think that is? 🤔

rollup/plugins#1798

  • There is still a call to SourceMapGenerator in the bundled plugin. This is from css-tree, and looks like it would only be called if we called generate({sourceMap: true}), which we are not. It would be nice if we could remove that codepath from our bundled css-tree, but I don't think that's necessary.

Yeah, true. The codepath is 75 LOC -- not sure how far we want to go down this rabbit hole!

@jgerigmeyer jgerigmeyer merged commit 11a9e67 into main Apr 8, 2025
14 checks passed
@jgerigmeyer jgerigmeyer deleted the hotfix-build branch April 8, 2025 19:39
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.

sourcemap error when loading from unpkg

3 participants