aws-samples / aws-sdk-js-notes-app

A simple note taking application using modular AWS SDK for JavaScript (v3)
Other
81 stars 30 forks source link

Use React with snowpack instead of webpack #2

Closed trivikr closed 3 years ago

trivikr commented 3 years ago

Is your feature request related to a problem? Please describe.

CRA is way to bloated. The commands take time to run. It also has too many dependencies, some of them get security warnings from time-to-time. Here's an article from Feb 2019 which goes through CRA dependencies in detail: https://hackernoon.com/create-react-app-is-way-too-bloated-5db07c3511

Describe the solution you'd like

Use a faster frontend build tool like Snowpack.

Describe alternatives you've considered

Stick with create-react-app. It's slow and bloted, but stable and gets work done.

Additional context

Snowpack attempts in workshop repo https://github.com/aws-samples/aws-sdk-js-v3-workshop/issues/231

trivikr commented 3 years ago

The build fails with the following error:

[snowpack] Failed to load ../../node_modules/@aws-sdk/util-user-agent-browser/dist/es/index.js
  'parse' is not exported by ../../node_modules/bowser/src/bowser.js, imported by ../../node_modules/@aws-sdk/util-user-agent-browser/dist/es/index.js
[snowpack] Install failed.

Being discussed in https://github.com/snowpackjs/snowpack/discussions/2114 Experimental commits in https://github.com/trivikr/aws-sdk-js-todo-app/commits/react-snowpack-app

trivikr commented 3 years ago

The issue with default import was fixed in https://github.com/aws/aws-sdk-js-v3/pull/1991, and released with @aws-sdk/*@3.5.0

The new issue is with third-party dependency microphone-stream

ReferenceError: Buffer is not defined
    at http://localhost:8080/_snowpack/pkg/microphone-stream.js:6675:16
trivikr commented 3 years ago

Closing, as frontend was moved to vite in https://github.com/aws-samples/aws-sdk-js-notes-app/pull/37