aheissenberger / serverless-appsync-offline

Serverless AWS AppSync Offline Plugin - Allow to run AppSync locally for serverless framework
MIT License
90 stars 25 forks source link

AWS-Utils is deprecated #40

Open mcroker opened 5 years ago

mcroker commented 5 years ago

The folks over at https://github.com/ConduitVC/aws-utils have published the following depreciation notice...

AppSync Emulator Deprecation notice We've worked with AWS over the last few months to transition ownership of the emulator directly into Amplify's (and AWS) hands.

Please see: https://www.linkedin.com/feed/update/urn:li:activity:6565000058121572352 for details. We will be deprecating the package shortly.

I know I'm fighting against the flow by not wanting to use amplify - but currently it is too limiting for my purpose; I think serverless-framework is a better fit for my needs... I wondered if you had any thoughts on how this impacts serverless-appsync-offline

marcoreni commented 4 years ago

+1 on this one, aws-utils lacks several features added in Appsync (eg. Pipelines).

Apparently the amplify-cli repo has a "util mock" plugin that provides offline functionalities. Maybe it can be used to replace aws-utils?

Ref: https://github.com/aws-amplify/amplify-cli/tree/master/packages/amplify-util-mock

aheissenberger commented 4 years ago

@marcoreni there is even a separate package for the simulator - maybe I find some time to look into this in the next weeks

FilipPyrek commented 4 years ago

@aheissenberger @marcoreni Also huge +1 because I stumbled upon an issue with @conduitvc/appsync-emulator-serverless. And when I wanted to fix the issue in the package, I discovered that the package has been deprecated. 😱

So replacing @conduitvc/appsync-emulator-serverless would be very welcomed. 🙇


The issue with @conduitvc/appsync-emulator-serverless:

Recently @conduitvc/appsync-emulator-serverless started to escape JSON from the data sources with HTML entities.

When I used for example $util.toJson($context.result) in VTL template - it replaced "a": "b" output to "a": "b" - which is absolutely incorrect.

I discovered that @conduitvc/appsync-emulator-serverless uses old version of velocityjs which by default has escape parameter set to true. In version 2.0.0 of velocityjs the escape parameter set by default to false.

Version 2.0.0 of velocityjs: https://github.com/shepherdwind/velocity.js/commit/ba00784962ceeb1a7c7e448f452c5ffb83fbc5cb#diff-04c6e90faac2675aa89e2176d2eec7d8R114

Hotfix:

aheissenberger commented 4 years ago

@FilipPyrek have you tried to fix this with selected dependency resolution - I did this with yarn for other packages and it worked very well - I only use yarn so you have to find out how this works with npm: https://yarnpkg.com/lang/en/docs/selective-version-resolutions/

FilipPyrek commented 4 years ago

@aheissenberger thanks for suggestion. Anyway I think that best overall solution will be getting rid of @conduitvc/appsync-emulator-serverless...

bboure commented 4 years ago

Hi all, I was facing the same issues as you all since the deprecation of the emulator. I had a look into amplify-appsync-simulator and started making a simple wrapper around it for serverless and serverless-appsync-plugin. Check it out and leave me some feedback.

https://github.com/bboure/serverless-appsync-simulator

marcoreni commented 4 years ago

Thanks for your effort @bboure! I'll test this on monday and I'll give you feedbacks