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

Add missing things in core-js-pure 3 #198

Merged
merged 7 commits into from
Jan 25, 2024

Conversation

liuxingbaoyu
Copy link
Member

Fixes: #166

It seems that issues is not the optimization logic, but that we don't define the data of corejs-pure.

@liuxingbaoyu liuxingbaoyu changed the title Add missing things in pure Add missing things in core-js 3 pure Jan 22, 2024
@liuxingbaoyu liuxingbaoyu changed the title Add missing things in core-js 3 pure Add missing things in core-js-pure 3 Jan 22, 2024
@@ -355,7 +355,7 @@ export const StaticProperties: ObjectMap2<CoreJSPolyfillDescriptor> = {
},

ArrayBuffer: {
isView: define(null, ["es.array-buffer.is-view"]),
isView: define("array-buffer/is-view", ["es.array-buffer.is-view"]),
Copy link
Member

Choose a reason for hiding this comment

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

It's missed in the pure version.

Copy link
Member Author

Choose a reason for hiding this comment

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

image
Is it unavailable?

Copy link
Member

Choose a reason for hiding this comment

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

groupBy: define(null, ["es.map.group-by", ...MapDependencies]),
keyBy: define(null, ["esnext.map.key-by", ...MapDependencies]),
of: define(null, ["esnext.map.of", ...MapDependencies]),
from: define("map/from", ["esnext.map.from", ...MapDependencies]),
Copy link
Member

Choose a reason for hiding this comment

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

.from and .of are present in all collections.

@zloirock
Copy link
Member

Yes, it looks like a partial workaround.

"es.promise.any",
"es.aggregate-error",
...PromiseDependenciesWithIterators,
]),
race: define(null, PromiseDependenciesWithIterators),
try: define(null, ["esnext.promise.try", ...PromiseDependencies]),
try: define("promise/try", ["esnext.promise.try", ...PromiseDependencies]),
withResolvers: define(null, [
Copy link
Member

Choose a reason for hiding this comment

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

It's also a static method - it was added recently, but with Map.groupBy situation the same.

_WeakMap.from;
_ArrayBuffer$isView;
Uint8Array.from;
Uint8Array.of;
Copy link
Member Author

Choose a reason for hiding this comment

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

Is this expected? I didn't find the corresponding file.

Copy link
Member

@zloirock zloirock Jan 22, 2024

Choose a reason for hiding this comment

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

All typed array features are not polyfilled in the pure version.

@nicolo-ribaudo
Copy link
Member

Thank you!

@nicolo-ribaudo nicolo-ribaudo merged commit 599f7c4 into babel:main Jan 25, 2024
7 checks passed
@zloirock
Copy link
Member

.from and .of are present in all collections.

That means that those entries should be defined for all collections, not removed from Map -)

@liuxingbaoyu
Copy link
Member Author

.from and .of are present in all collections.

That means that those entries should be defined for all collections, not removed from Map -)

Oops, I just tested that Map.from/Map.of does not exist.

@zloirock zloirock mentioned this pull request Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

usage-pure has incorrect optimization logic
3 participants