You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These are a bit tricky, increase complexity and build size.
These can be split into two categories:
nullish coalesce & optional chaining polyfills
Bundler-related polyfills
The first category is actually disallowed by eslint rules, as the polyfills increase bundle size considerably when used. We do not use any nullish coalesce/optional chaining in all core/browser SDKs, only in node & nextjs.
I propose to remove these polyfills in v8, if we decide to bump the min. Node version to 14+. Node 14 supports both nullish coalescing as well as optional chaining.
I propose to leave the eslint rules for core/browser SDKs in place, but simply rely on them to ensure we don't use them outside of node context. We also have tests covering that the ES5 CDN bundles are valid ES5, which should cover any regressions there. This allows us to get rid of these polyfills:
I propose we investigate if we can solve this with rollup instead.
Benefits of dropping the polyfills
Reduced complexity in our codebase & build
No need to have non-canonical exports (currently polyfills are imported directly from e.g. @sentry/utils/esm/buildPolyfills/index.js which is not ideal)
Reduced bundle size/increased performance for platforms that do support these (e.g. newer node) - can use native instead of polyfilled code
Browser/core packages already don't use these features, so no migration work necessary there
The text was updated successfully, but these errors were encountered:
Currently, we include a few polyfills in our build:
These are a bit tricky, increase complexity and build size.
These can be split into two categories:
The first category is actually disallowed by eslint rules, as the polyfills increase bundle size considerably when used. We do not use any nullish coalesce/optional chaining in all core/browser SDKs, only in node & nextjs.
I propose to remove these polyfills in v8, if we decide to bump the min. Node version to 14+. Node 14 supports both nullish coalescing as well as optional chaining.
I propose to leave the eslint rules for core/browser SDKs in place, but simply rely on them to ensure we don't use them outside of node context. We also have tests covering that the ES5 CDN bundles are valid ES5, which should cover any regressions there. This allows us to get rid of these polyfills:
The other category of polyfills:
I propose we investigate if we can solve this with rollup instead.
Benefits of dropping the polyfills
@sentry/utils/esm/buildPolyfills/index.js
which is not ideal)The text was updated successfully, but these errors were encountered: