Skip to content

Commit

Permalink
Prefer JavaScript UMD modules spec
Browse files Browse the repository at this point in the history
It appears that Webpack is already handling the UMD import/export specification correctly when compiling the assets within Amber. In the amber.js websocket file, both UMD and common JS are present, and non-identical as both `class Channel` and `class Socket` are exported in the UMD format but only Socket is exported as CommonJS. A side-effect of this is that the `module.exports` object is transpiled into the bundle as Webpack has already defaulted to using UMD.

This commit simply removes the CommonJS export definition.
  • Loading branch information
jackturnbull committed Jan 7, 2019
1 parent c993acd commit ef0b73e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions assets/js/amber.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,6 @@ export class Socket {
}
}

module.exports = {
Socket: Socket
}


/**
* Allows delete links to post for security and ease of use similar to Rails jquery_ujs
*/
Expand Down
2 changes: 1 addition & 1 deletion assets/js/amber.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "amber",
"version": "0.8.0",
"version": "0.8.1",
"description": "Front-end configuration for Amber Framework",
"private": true,
"author": "Amber",
Expand Down

0 comments on commit ef0b73e

Please sign in to comment.