-
-
Notifications
You must be signed in to change notification settings - Fork 796
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 support for ESM modules #1397
Conversation
b04a53e
to
2c7f143
Compare
@dnalborczyk I see you've been making some refactoring of the repo that is related to this PR. I solved all conflicts and made sure the tests are passing. The only thing missing from this PR are some regression tests... Edit: windows is failing ><;; |
OK, fixed windows CI and added tests for running under |
sorry, was just reading this. @perrin4869 could you hold on for just a moment. most of the refactoring (babel removal, esm-only-module) stuff is done, but there's a couple albeit minor things missing: logging needs a cleanup (not quite sure why yet, I believe serverless v3 added a different logging?) as well as re-activating unit tests (and some other few tests I deactivated). should be hopefully done soon. |
@perrin4869 just had a quick look. I believe a better way to implement this is something along the lines of:
you can take a look here: https://github.com/aws/aws-lambda-nodejs-runtime-interface-client the problem is that this is not the latest version which actually runs in a lambda container I believe, since I have to find the latest runtime someone extracted from the current lambda container. |
Yeah, rather than |
@dnalborczyk done! |
09602c2
to
a4c218c
Compare
Hey @perrin4869, if Except for that, I tried the PR in my projects and it worked perfect. Very happy of removing webpack/babel from my serverless life. Good work! |
@tinchoz49 oh nice catch! But that's a problem in the master branch ;) |
ah ok, something to change when was merged. Another thing is that in some files is using the old __dirname and throws me an error in my handlers. |
if you really want this working right now, I recommend you use the patch in #1014 with |
@dnalborczyk merged the latest changes in master and fixed the tests, will be happy if you can review this :) |
thank you @perrin4869 ! it's the next feature on the list. give me a couple days, just need to release v9.1 |
@perrin4869 I just noticed that I added a code review but forgot to hit "send" (request changes). 😞 I added esm support as part of using the I hope by using thank you for putting in the work and spearheading the effort! |
@dnalborczyk No, thank you for the effort in updating this module properly!
I don't know if it is within the scope of this module to add the ability to load |
I was wondering what that was about. it's definitely interesting. I wonder if the |
Fixes #1014
Edit: oops clicked enter before writing the explanation
I tried out the
jest-light-runner
as a way to not break the jest test suite and enable usingimports
at the same time.The unit tests are passing, but I am stuck right now due to nicolo-ribaudo/jest-light-runner#36
I will come back to this and try to iron it out once I figure that problem out, and add some tests