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

feat: Add ECMAScript 6 (ES6) support #255

Merged
merged 3 commits into from
Jul 7, 2024
Merged

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Jul 6, 2024

New Pull Request Checklist

Issue Description

The code base doesn't support async/await since babel didn't support it in the runtimegenerator. We could update babel but I don't think project needs to be trancompiled. The test suite ran against /src instead of /lib so this error didn't get caught

*/node_modules/@parse/push-adapter/lib/WEB.js:59
var _ref = _asyncToGenerator( /#PURE/regeneratorRuntime.mark(function _callee(data, devices) {
^

Closes: #256

Approach

  • Add "type": "module" to package.json to enable ES6
  • Remove babel transcompiler
  • Remove unused files
  • Randomize test suite
  • Use C8 for test coverage
  • Bump testing dependencies
  • Improve CI npm cache

TODOs before merging

  • Add tests
  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)

Copy link

parse-github-assistant bot commented Jul 6, 2024

Thanks for opening this pull request!

  • 🎉 We are excited about your hands-on contribution!

Copy link

codecov bot commented Jul 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.10%. Comparing base (915d9af) to head (43a9b47).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     parse-community/Parse-SDK-JS#255      +/-   ##
==========================================
- Coverage   91.78%   90.10%   -1.68%     
==========================================
  Files           8        8              
  Lines         499     1274     +775     
==========================================
+ Hits          458     1148     +690     
- Misses         41      126      +85     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dplewis dplewis requested review from mtrezza and a team July 6, 2024 17:28
@dplewis dplewis mentioned this pull request Jul 6, 2024
4 tasks
package.json Show resolved Hide resolved
@dplewis dplewis requested a review from mtrezza July 6, 2024 22:37
@mtrezza mtrezza changed the title feat: Add ES6 Support feat: Add ECMAScript 6 (ES6) support Jul 7, 2024
@mtrezza mtrezza merged commit bee437a into parse-community:master Jul 7, 2024
4 checks passed
@mtrezza mtrezza mentioned this pull request Jul 7, 2024
@dplewis dplewis deleted the es6 branch July 7, 2024 10:46
parseplatformorg pushed a commit that referenced this pull request Jul 7, 2024
# [6.3.0](6.2.0...6.3.0) (2024-07-07)

### Features

* Add ECMAScript 6 (ES6) support ([#255](#255)) ([bee437a](bee437a))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.3.0

@Moumouls
Copy link
Member

Not sure to understand why it was switched to ESM since Parse Server is not a module and there is plenty of issues with ESM currently waiting for NodeJS in node 23-24 fix.

On my side Jest is failing due to ESM in CommonJs project.

Parse custom ESM detection fail for example in jest since JEST return a custom error when you try to import an ESM in Common JS. I'll fix my fork to support the jest error, a dedicated PR should be done on parse for proper ESM detection

@Moumouls
Copy link
Member

it seems that jest just exit if he detect ESM in commonjs, so the error detection don't work

@mtrezza
Copy link
Member

mtrezza commented Nov 20, 2024

Are you referring to the CI tests? They seem to work.

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

Successfully merging this pull request may close these issues.

regeneratorRuntime is not defined
4 participants