babel / babel/babel-polyfills

[improvement] we can provide a convenient tips that can show current project do not support some EcmaScipt, and guide user update related packages

Open
#139 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
357
Forks
62
PR merge metrics
No merged PRs in 30d

Description

when i see `Object.hasOwn`, I try it in my project, but I do not know if it can be support. I analyse `@babel/preset-env` and find `@babel/helper-define-polyfill-provider`. I find `entry` or `usage-global` or `usage-pure` both call `@babel/helper-define-polyfill-provider` 's `shouldInjectPolyfill` methods. in this, we can console tips to guide users what EcmaScript is not support and what to do that user to do. for example

![image](https://user-images.githubusercontent.com/38429620/182994969-c53c6c26-8ce8-4c63-83db-76bff4f91d00.png)

Contributor guide

Open the contributing guide

Research direction

Start by reading @babel/helper-define-polyfill-provider's shouldInjectPolyfill method and compare how the entry, usage-global, and usage-pure strategies reach it. The issue does not name files or tests; done would require an agreed diagnostic that identifies unsupported ECMAScript features and tells users which related packages or targets to update.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.