Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 11:54
    xg4 starred zloirock/core-js
  • 10:39
    andreialecu commented #573
  • 08:53
    junen0511 starred zloirock/core-js
  • 07:53
    domachine starred zloirock/core-js
  • 06:41
    peterhil starred zloirock/core-js
  • 05:48
    kamilic commented #719
  • 00:33

    zloirock on master

    map some old Android Browser ve… (compare)

  • 00:12
    zloirock commented #720
  • Dec 06 21:16
    bepetersn starred zloirock/core-js
  • Dec 06 20:27

    zloirock on master

    add one more missed Samsung map… (compare)

  • Dec 06 19:50
    zloirock edited #721
  • Dec 06 18:34

    zloirock on master

    update dependencies, fix a wron… (compare)

  • Dec 06 16:29
    zloirock edited #721
  • Dec 06 16:28
    zloirock labeled #721
  • Dec 06 16:28
    zloirock labeled #721
  • Dec 06 16:28
    zloirock opened #721
  • Dec 06 15:13
    ahmednabil950 starred zloirock/core-js
  • Dec 06 14:34
  • Dec 06 14:11
    fdc-viktor-luft commented #720
  • Dec 06 13:38
    zloirock labeled #720
Tom McKearney
@tommck
yeah.. babel-polyfill does
Andrew Koroluk
@Awk34
yep
Mikko Ahlroth
@Nicd
hello
does the Symbol polyfill permit Symbol keys for objects in IE11?
Denis Pushkarev
@zloirock
@Nicd yep.
Mikko Ahlroth
@Nicd
Niice, this saves my butt. Thanks!
Saul Hardman
@saulhardman
Hi, a question regarding web.dom.iterable: am I right in thinking that it polyfills NodeList.prototype.forEach()?
Saul Hardman
@saulhardman
@zloirock sorry to @, but could you enlighten me at all?
Denis Pushkarev
@zloirock
@saulhardman sorry for delayed reply. At this moment, NodeList#forEach is not polyfilled in core-js, most likely it will be added soon, related issues - #329 and babel/babel#6091.
hei-yu-fa
@hei-yu-fa
edge cannot find core-js/library/modules/es6.object.to-string.js?
Denis Pushkarev
@zloirock
@hei-yu-fa It's a cap for the library version, so it's just an empty file. As you can see, it exists. I don't know how you loading it, so I can't help.
Saul Hardman
@saulhardman
@zloirock thank you very much for the response, I'll keep an eye on the issue.
daurnimator
@daurnimator
-const apply = require('core-js/library/fn/reflect/apply');
-const construct = require('core-js/library/fn/reflect/construct');
+let apply, construct;
+if (typeof Reflect !== "undefined") {
+       apply = Reflect.apply;
+       construct = Reflect.construct;
+} else {
+       const fApply = Function.apply;
+       const bind = Function.bind;
+       apply = function(target, thisArgument, argumentsList) {
+               return fApply.call(target, thisArgument, argumentsList);
+       };
+       construct = function(target, argumentsList /*, newTarget */) {
+               switch (argumentsList.length) {
+                       case 0: return new target();
+                       case 1: return new target(argumentsList[0]);
+                       case 2: return new target(argumentsList[0], argumentsList[1]);
+                       case 3: return new target(argumentsList[0], argumentsList[1], argumentsList[2]);
+                       case 4: return new target(argumentsList[0], argumentsList[1], argumentsList[2], argumentsList[3]);
+               }
+               let $args = [null];
+               $args.push.apply($args, argumentsList);
+               return new (bind.apply(target, $args))();
+       };
+}
^^ Applying this diff saves my final (minified) bundled size 8KB.... Tell me how to avoid excising core.js
li.li
@lili21
Can I only import needed modules through script tag ?
Denis Pushkarev
@zloirock
@lili21 core-js use CommonJS, browsers does not support CommonJS natively, so you should bundle it before usage in script tag .
@daurnimator those entry points includes not only polyfills for Reflect.apply and Reflect.construct, they includes also all dependencies - for example, Function#bind polyfill. If you think that something included to your bundle is not required - feel free add a PR or open an issue.
imgregduh
@imgregduh
im getting a length exception on an array but in chrome its fine, I only see the problem in IE. Im using Angular 4 with the cli i have all the polyfills uncommented wondering if this is a polyfill related problem and that im missing something or not im using core-js 2.5.1
Sergiu
@csergiu
hey guys
can someone ELI5 what core-js is, or what a JS standard library is? thanks
Denis Pushkarev
@zloirock
@csergiu core-js is JS standard library polyfill by the latest ECMAScript spec and actual proposals. What is a standard library? https://en.wikipedia.org/wiki/Standard_library
@imgregduh please, tell us a little more info. A reproducible example or at least the error message could be useful.
plexigras
@plexigras
is there a library that checks if a feature is available
or even better one that tells me what to polyfill with which corejs module
Denis Pushkarev
@zloirock
@plexigras babel-preset-env with useBuiltins option automatically injects required core-js features, if you mean that.
Ilya Kantor
@iliakan
Denis?
@zloirock trying to pm you
plexigras
@plexigras
@zloirock i mean something like hasMap = () => tyepof Map === 'function' but instead of just for map for everything
Andrea Giammarchi
@WebReflection_twitter
Screen Shot 2018-07-03 at 12.22.09.png
anyone experiencing the same in IE8? patched timers break with ease through setTimeout(alert, 1000, Math.random()) or anything, really
source: https://unpkg.com/core-js-bundle right away (that also should probably have a browser field that points at the already minified, stable/beta version)
plexigras
@plexigras
is there something that tells me that 'features/array/fill' polyfills Array.fill
jacobg
@jacobg
Is there a polyfill for Element.prototype.remove? I didn’t see one.
Kyle Warren
@malectro
is there any way to force core-js to polyfill Promise in Chrome? i can't seem to get unhandledrejection to work in different environments, and it seems like Chrome is super strict about making this event is available only when a ton of obscure security conditions are met.
Andrea Giammarchi
@WebReflection
@jacobg FYI most modern DOM methods are in dom4 https://github.com/WebReflection/dom4#dom4
Markus Günther
@markusguenther

Hello,

thanks for creating the package. I am actually updating from version 2.4.1 to the latest version. But with version 3 I get errors.
With version 2.6.5 everything works fine... do you have a upgrade guide.


ERROR in ./polyfills.js
Module not found: Error: Can't resolve 'core-js/es6/math' in '/Users/markusgunther/Development/neos-lucern/Packages/Application/Neos.Neos.Ui'
 @ ./polyfills.js 7:0-27
 @ multi ./polyfills.js ./packages/neos-ui-ckeditor-bindings/src/index.js

ERROR in ./node_modules/recharts/es6/polyfill.js
Module not found: Error: Can't resolve 'core-js/es6/math' in '/Users/markusgunther/Development/neos-lucern/Packages/Application/Neos.Neos.Ui/node_modules/recharts/es6'
 @ ./node_modules/recharts/es6/polyfill.js 1:0-26
 @ ./node_modules/recharts/es6/index.js
 @ ./packages/neos-ui-views/src/Data/TimeSeriesView/index.js
 @ ./packages/neos-ui-views/src/manifest.js
 @ ./packages/neos-ui/src/index.js
 @ multi ./packages/neos-ui/src/index.js

ERROR in ./polyfills.js
Module not found: Error: Can't resolve 'core-js/es6/symbol' in '/Users/markusgunther/Development/neos-lucern/Packages/Application/Neos.Neos.Ui'
 @ ./polyfills.js 9:0-29
 @ multi ./polyfills.js ./packages/neos-ui-ckeditor-bindings/src/index.js

ERROR in ./node_modules/react-keydown/es/lib/keys.js
Module not found: Error: Can't resolve 'core-js/es6/symbol' in '/Users/markusgunther/Development/neos-lucern/Packages/Application/Neos.Neos.Ui/node_modules/react-keydown/es/lib'
 @ ./node_modules/react-keydown/es/lib/keys.js 1:0-28
 @ ./node_modules/react-keydown/es/index.js
 @ ./packages/react-ui-components/src/SelectBox/index.js
 @ ./packages/neos-ui-ckeditor5-bindings/src/EditorToolbar/StyleSelect.js
 @ ./packages/neos-ui-ckeditor5-bindings/src/manifest.richtextToolbar.js
 @ ./packages/neos-ui-ckeditor5-bindings/src/manifest.js
 @ ./packages/neos-ui/src/index.js
 @ multi ./packages/neos-ui/src/index.js
import "core-js/es6"; does not help by the way
Denis Pushkarev
@zloirock
@markusguenther see https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md. For almost all cases is enough to replace core-js/es6/something to core-js/es/something.
Markus Günther
@markusguenther
Thanks Denis, I will try it :)
ONAM Exchange
@OnamOfficial
Hey Guys, i keep getting this issues. New to Nuxt/Vue

Server
Compiled successfully in 2.78s

ERROR Failed to compile with 32 errors friendly-errors 06:07:13

These dependencies were not found: friendly-errors 06:07:13
friendly-errors 06:07:13

  • core-js/modules/es6.array.find in ./.nuxt/client.js friendly-errors 06:07:13
  • core-js/modules/es6.array.iterator in ./.nuxt/client.js, ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./.nuxt/components/nuxt-error.vue?vue&type=script&lang=js&
  • core-js/modules/es6.date.to-string in ./.nuxt/utils.js friendly-errors 06:07:13
  • core-js/modules/es6.function.name in ./.nuxt/client.js friendly-errors 06:07:13
  • core-js/modules/es6.object.assign in ./.nuxt/client.js, ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./.nuxt/components/nuxt-error.vue?vue&type=script&lang=js&
  • core-js/modules/es6.object.keys in ./.nuxt/utils.js friendly-errors 06:07:13
  • core-js/modules/es6.object.to-string in ./.nuxt/client.js friendly-errors 06:07:13
  • core-js/modules/es6.promise in ./.nuxt/client.js, ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./.nuxt/components/nuxt-error.vue?vue&type=script&lang=js&
  • core-js/modules/es6.regexp.constructor in ./.nuxt/utils.js friendly-errors 06:07:13
  • core-js/modules/es6.regexp.match in ./.nuxt/client.js friendly-errors 06:07:13
  • core-js/modules/es6.regexp.replace in ./.nuxt/utils.js friendly-errors 06:07:13
  • core-js/modules/es6.regexp.search in ./.nuxt/utils.js friendly-errors 06:07:13
  • core-js/modules/es6.regexp.split in ./.nuxt/utils.js friendly-errors 06:07:13
  • core-js/modules/es6.regexp.to-string in ./.nuxt/utils.js friendly-errors 06:07:13
  • core-js/modules/es6.string.includes in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js friendly-errors 06:07:13
  • core-js/modules/es6.string.iterator in ./.nuxt/utils.js friendly-errors 06:07:13
  • core-js/modules/es6.string.repeat in ./.nuxt/utils.js friendly-errors 06:07:13
  • core-js/modules/es6.string.starts-with in ./.nuxt/utils.js friendly-errors 06:07:13
  • core-js/modules/es6.symbol in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js friendly-errors 06:07:13
  • core-js/modules/es7.array.includes in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js friendly-errors 06:07:13
  • core-js/modules/es7.promise.finally in ./.nuxt/client.js, ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./.nuxt/components/nuxt-error.vue?vue&type=script&lang=js&
  • core-js/modules/es7.symbol.async-iterator in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js
  • core-js/modules/web.dom.iterable in ./.nuxt/client.js, ./.nuxt/components/nuxt-link.client.js friendly-errors 06:07:13
                                                                                                     friendly-errors 06:07:13
    To install them, you can run: npm install --save core-js/modules/es6.array.find core-js/modules/es6.array.iterator core-js/modules/es6.date.to-string core-js/modules/es6.function.name core-js/modules/es6.object.assign core-js/modules/es6.object.keys core-js/modules/es6.object.to-string core-js/modu
Denis Pushkarev
@zloirock
@OnamOfficial see nuxt/nuxt.js#5313
Seems in nuxt was missed direct setting of core-js@2 dependency.
Dimitar Danailov
@dimitardanailov

Greetings,

I can't find document related with those errors:

Module not found: Error: Can't resolve 'core-js/fn/weak-map'
Module not found: Error: Can't resolve 'core-js/fn/promise'

My project uses babel7 and webpack 4.

The entry point uses:

import "core-js/stable"

Babel configuration:

{
  "plugins": [
    ["@babel/transform-runtime", {
      "corejs": 3,
    }]
  ],
  "presets": [
    "@babel/preset-react",
    [
      "@babel/preset-env",
      {
        "targets": {
          "node": "10.16"
        },
        "corejs": "3",
        "useBuiltIns": "entry"
      }
    ]
  ]
}
Denis Pushkarev
@zloirock
  • You should use corejs option only in one place - in @babel/preset-env or in @babel/transform-runtime.
  • Seems you or one of your dependencies use obsolete core-js@2 somewhere without explicit adding of this dependency.
@dimitardanailov ^
Robert Concepcion III
@rob2d
hi guys. Any chance to get latest commit into an NPM release? It seems can't use Git URLs as dependencies with Lerna on package.json yet, and the Promise polyfill missing that was patched recently even breaks Edge 😕
Denis Pushkarev
@zloirock
What do you mean?
Krikor Krikorian
@todoconk
Hi there! I need to know why I'm using core-js@3.4.1 and adding to webpack entrypoint vendors: 'core-js/fn/map' it works, in your docs I should change it for 'core-js/features/map', but with 'core-js/fn/map' it still works, why ?
Tamas Eppel
@peletomi

hello! I have moved my project from core-js 2 to core-js 3, and now I receive the following error
Module not found: Error: Can't resolve 'core-js/modules/web.dom.iterable'

my imports are

import 'core-js'
import 'core-js/modules/web.dom-collections.iterator'
import 'regenerator-runtime/runtime'