Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please explain the changes you made here.
This adds a bundler in regards to the issue brought up in #67
The WebSDK library did not work with Webpack 5 due to file extensions missing for modules. The solution the developer provided was to add a
.js
file extension within the.ts
file. The reason they do this is because tsc (Typescript Compiler) does not add the.js
extension onto imports, and will not change.ts
imports into.js
imports. See the below linkmicrosoft/TypeScript#16577 (comment)
The developer was kind enough to provide the above solution, which does work, but is not a long term solution to the real issue: That we need to bundle the code.
tsc
is a compiler, but it isn’t a bundler, which means that it does not do the following: Polyfill old code. We specify ES6 in our TSConfig, but tsc actually won’t handle cases where ES7+ code is used (e.g. Object.entries). This means Square cannot target browsers and instead the code may break with slightly older browsers (1+ year old) if Square is not careful.Does this close any currently open issues?
Yes: #67