Skip to content

Introduced @babel/polyfill package. - #3158

Closed
anthony-redFox wants to merge 4 commits into
less:3.xfrom
anthony-redFox:3.x
Closed

anthony-redFox wants to merge 4 commits into
less:3.xfrom
anthony-redFox:3.x

Conversation

@anthony-redFox

Copy link
Copy Markdown
Contributor

That need for usages babel package transpiler and so we can use ES6+ polyfills now
Removed promise package which included in @babel/polyfill

That need for usages babel package transpiler and so we can use ES6+ polyfills now
Removed promise package which included in @babel/polyfill
Remove testSyncronous test and moved to asynchronous way.
@anthony-redFox

Copy link
Copy Markdown
Contributor Author

@matthew-dean could you please take a look. Thanks

@matthew-dean

Copy link
Copy Markdown
Member

Few things:

  1. Instead of PromiseConstructor = Promise, you should be able to replace PromiseConstructor in code as well.
  2. Why were synchronous imports removed? I think sync import support was added for some special request for testing support. I'm not against rendering always being async, and modern testing tools should be able to handle async testing, but as there's no discussion about this, I'm hesitant about an uncommented breaking change in a PR.

Reviewing this further..... I think this misses the point of the Promise reference currently in the lib. It's to polyfill for the build output, not just (Node) runtime. Without any build files committed, it's not clear what the effect of this code is.

So there's a lot missing here that makes this seem like an unsafe PR currently.

@matthew-dean matthew-dean mentioned this pull request Jan 27, 2018
@anthony-redFox

anthony-redFox commented Jan 29, 2018 •

Copy link
Copy Markdown
Contributor Author

@matthew-dean thanks for review.

  1. Agree, fixed.
  2. Why were synchronous imports removed?
    • I really don't know why need synchronous solution and I think that the major release good place to remove it.
    • The JavaScript have only one main thread and good solution for asynchronously approach. I tried to promisify a render method like what to do in node.js.

So my opinion that, we should to use one way to transform less files and also we can subscribe on success through Promise or just async - await function. If you look on ES Modules works also async way and I think is good reason move to the same.

  1. Introduced babel/polyfill.
    • In general, that I know, less uses for transform in css by build procedure or watch files in development. @babel/polyfill it just part of ES6 & rollup #2691 issue for introduced ES6+ syntactics and we sure that all new features ES5+ are available. So after that we can remove standard implementation like Function.bind and use native or polyfill approach not worrying about supporting by Node or Browsers.
  • Another improvement that polyfills are not executed if native implementation of ES5+ implemented in current environment.

@matthew-dean if you have another opinion or reasons to don't do that, I ready to discuss with you.

@anthony-redFox

Copy link
Copy Markdown
Contributor Author

@matthew-dean please take a look. I need your approval to continue working on this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants