Skip to content

Conversation

@lihbr
Copy link
Member

@lihbr lihbr commented Dec 31, 2025

Resolves: #424

Description

It appears that treeshaking can leave artifacts in clauses when static checks come last. This PR fixes that by moving the NODE_ENV checks first, which should hopefully clean up the treeshaking artifacts.

See: https://rollupjs.org/repl/?version=4.54.0&shareable=eyJleGFtcGxlIjpudWxsLCJtb2R1bGVzIjpbeyJjb2RlIjoiaWYgKC8oPzwhXFwuY2RuKVxcLnByaXNtaWNcXC5pbyQvaS50ZXN0KG5ldyBVUkwoXCJoYXMgYXJ0aWZhY3RzXCIpLmhvc3RuYW1lKSAmJiBmYWxzZSkge31cblxuaWYgKGZhbHNlICYmIC8oPzwhXFwuY2RuKVxcLnByaXNtaWNcXC5pbyQvaS50ZXN0KG5ldyBVUkwoXCJhcnRpZmFjdC1mcmVlXCIpLmhvc3RuYW1lKSkge30iLCJpc0VudHJ5Ijp0cnVlLCJuYW1lIjoibWFpbi5qcyJ9XSwib3B0aW9ucyI6eyJvdXRwdXQiOnsiZm9ybWF0IjoiZXMifSwidHJlZXNoYWtlIjp0cnVlfX0=

Checklist

  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

npm install @prismicio/client@pr-425

How to QA 1

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

Copy link
Member

@angeloashmore angeloashmore left a comment

Choose a reason for hiding this comment

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

Wow, nice find! I guess it makes sense since the previous cases need to be evaluated.

@lihbr lihbr merged commit 2241765 into master Dec 31, 2025
11 checks passed
@lihbr lihbr deleted the lh/treeshaking branch December 31, 2025 23:26
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.

Regression in older Safari versions with 7.21.1 release: Lookbehind regex not supported

3 participants