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

preserveEntrySignatures: exports-only #3820

Closed
guybedford opened this issue Oct 11, 2020 · 2 comments · Fixed by #3823
Closed

preserveEntrySignatures: exports-only #3820

guybedford opened this issue Oct 11, 2020 · 2 comments · Fixed by #3823

Comments

@guybedford
Copy link
Contributor

guybedford commented Oct 11, 2020

Feature Use Case

preserveEntrySignatures is a really nice API for selecting when facades are really needed (and it turns out not so much!).

But turning on 'allow-extension' might still cause issues for some facades where the exact names might be needed.

Feature Proposal

The proposal is for an exports-only setting, which would effectively follow 'strict' for all entry modules that have exports, but set it to 'allow-extension' for all entry modules that have any exports.

This way the top-level "exportless" entry point always gets collapsed, but we avoid risk for other types of chunks.

@lukastaegert
Copy link
Member

Sounds sensible and could be a good default for the next major version. Thus we could also avoid the ugly warning you get when an entry point has no exports.

@lukastaegert
Copy link
Member

I created a PR for this because I think it will be a good default for the next major version of Rollup: #3823.

but we avoid risk for other types of chunks.

Note that the preserveSignatures option only every had an effect on static entry points anyway. Dynamic entry points and internal namespace imports always have their signature preserved as Rollup will just create a namespace object if the signature would be polluted: https://rollupjs.org/repl/?version=2.31.0&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmltcG9ydCgnLiUyRmR5bmFtaWMuanMnKS50aGVuKGNvbnNvbGUubG9nKSUzQiUyMiUyQyUyMmlzRW50cnklMjIlM0F0cnVlJTdEJTJDJTdCJTIybmFtZSUyMiUzQSUyMmR5bmFtaWMuanMlMjIlMkMlMjJjb2RlJTIyJTNBJTIyaW1wb3J0JTIwJTdCc2hhcmVkJTdEJTIwZnJvbSUyMCcuJTJGc2hhcmVkLWxpYiclM0IlNUNuZXhwb3J0JTIwY29uc3QlMjB2YWx1ZSUyMCUzRCUyMCd0aGVyZSUyMHNob3VsZCUyMGJlJTIwbm8lMjBvdGhlciUyMGV4cG9ydHMnJTNCJTVDbiU1Q25jb25zb2xlLmxvZyhzaGFyZWQpJTNCJTVDbmltcG9ydCgnLiUyRnBvbGx1dGluZy1keW5hbWljLmpzJykudGhlbihjb25zb2xlLmxvZyklM0IlMjIlMkMlMjJpc0VudHJ5JTIyJTNBZmFsc2UlN0QlMkMlN0IlMjJuYW1lJTIyJTNBJTIycG9sbHV0aW5nLWR5bmFtaWMuanMlMjIlMkMlMjJjb2RlJTIyJTNBJTIyaW1wb3J0JTIwJTdCc2hhcmVkJTdEJTIwZnJvbSUyMCcuJTJGc2hhcmVkLWxpYiclM0IlNUNuY29uc29sZS5sb2coc2hhcmVkKSUzQiUyMiUyQyUyMmlzRW50cnklMjIlM0FmYWxzZSU3RCUyQyU3QiUyMm5hbWUlMjIlM0ElMjJzaGFyZWQtbGliLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmV4cG9ydCUyMGNvbnN0JTIwc2hhcmVkJTIwJTNEJTIwJ3NoYXJlZCclM0IlMjIlN0QlNUQlMkMlMjJvcHRpb25zJTIyJTNBJTdCJTIyZm9ybWF0JTIyJTNBJTIyZXMlMjIlMkMlMjJuYW1lJTIyJTNBJTIybXlCdW5kbGUlMjIlMkMlMjJhbWQlMjIlM0ElN0IlMjJpZCUyMiUzQSUyMiUyMiU3RCUyQyUyMmdsb2JhbHMlMjIlM0ElN0IlN0QlN0QlMkMlMjJleGFtcGxlJTIyJTNBbnVsbCU3RA==

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants