Skip to content

Commit 978c0fc

Browse files
committed
Version 2.0 release
1 parent 199acfc commit 978c0fc

File tree

7 files changed

+64
-27
lines changed

7 files changed

+64
-27
lines changed

examples/minimal/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
<div id="app" style="height: 100vh">
99
<!-- Webamp will attempt to center itself within this div -->
1010
</div>
11-
<script src="https://unpkg.com/webamp@1.4.2/built/webamp.bundle.min.js"></script>
12-
<script>
13-
const Webamp = window.Webamp;
11+
<script type="module">
12+
import Webamp from "https://unpkg.com/webamp@next";
1413
const webamp = new Webamp({
1514
initialTracks: [
1615
{

examples/minimalMilkdrop/index.html

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,52 @@
88
<div id="app" style="height: 100vh">
99
<!-- Webamp will attempt to center itself within this div -->
1010
</div>
11-
<script src="https://unpkg.com/webamp@1.5.0/built/webamp.bundle.min.js"></script>
12-
<script src="https://unpkg.com/butterchurn@2.6.7/lib/butterchurn.min.js"></script>
13-
<script src="https://unpkg.com/butterchurn-presets@2.4.7/lib/butterchurnPresets.min.js"></script>
14-
<script>
15-
const Webamp = window.Webamp;
11+
<script type="module">
12+
/**
13+
* Webamp now includes an ESModule build, so you can import it directly. I
14+
* haven't validated full backwards compatibility with all the ways people
15+
* can import Webamp, so I haven't shipped this as the default build yet,
16+
* but it's on NPM as: `webamp@0.0.0-next-361ce79`.
17+
*
18+
* Changelog since the version you have can be found here:
19+
* https://github.com/captbaritone/webamp/blob/master/packages/webamp/CHANGELOG.md
20+
*/
21+
import Webamp from "https://unpkg.com/webamp@next";
22+
23+
/**
24+
* Butterchurn is not being actively maintained, but it is still works
25+
* great. Before it went into maintenance mode Jordan Berg (different
26+
* Jordan) cut a beta release of a version with the faster/more secure
27+
* eel->Wasm compiler that I wrote, so we use `butterchurn@3.0.0-beta.3`.
28+
*
29+
* Blog post about the eel->Wasm compiler here:
30+
* https://jordaneldredge.com/blog/speeding-up-winamps-music-visualizer-with-webassembly/
31+
*
32+
* This version is still using AMD modules, so it will write the export to
33+
* `window.butterchurn`. This is a pretty chunky files, so you way want to
34+
* find a way to lazy load it inside `importButterchurn` below.
35+
* Unfortunately, it's not an ES module, so I wasn't able to call
36+
* `import()` on it without some kind of bundler.
37+
*/
38+
import "https://unpkg.com/butterchurn@3.0.0-beta.3/dist/butterchurn.min.js";
39+
const butterchurn = window.butterchurn;
40+
41+
/**
42+
* This module, `butterchurn-presets@3.0.0-beta.4` contains a curated set
43+
* of awesome Butterchurn presets that have been packaged up to work with
44+
* the new compiler. This module is also packaged as an AMD module, so
45+
* when imported without a bundler it will write the export to `window`. I
46+
* think the package was never that thoughtfully built, so the export name
47+
* is, confusingly `window.base`. If that's a problem, using a bundler
48+
* might help.
49+
*
50+
* As audio plays, Webamp will randomly cycle through these presets with a
51+
* cool transition effect. You can also press "l" while the Milkdrop
52+
* window is open to open Milkdrop's preset selection menu.
53+
*/
54+
import "https://unpkg.com/butterchurn-presets@3.0.0-beta.4/dist/base.js";
55+
const butterchurnPresets = window.base.default;
56+
1657
const webamp = new Webamp({
1758
initialTracks: [
1859
{
@@ -28,14 +69,10 @@
2869
},
2970
],
3071
__butterchurnOptions: {
31-
importButterchurn: () => Promise.resolve(window.butterchurn),
72+
importButterchurn: () => Promise.resolve(butterchurn),
3273
getPresets: () => {
33-
const presets = window.butterchurnPresets.getPresets();
34-
return Object.keys(presets).map((name) => {
35-
return {
36-
name,
37-
butterchurnPresetObject: presets[name],
38-
};
74+
return Object.entries(butterchurnPresets).map(([name, preset]) => {
75+
return { name, butterchurnPresetObject: preset };
3976
});
4077
},
4178
butterchurnOpen: true,

examples/minimalWindowLayout/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
<div id="app" style="height: 100vh">
99
<!-- Webamp will attempt to center itself within this div -->
1010
</div>
11-
<script src="https://unpkg.com/webamp@0.0.0-next-6d0ec37b/built/webamp.bundle.min.js"></script>
12-
<script>
13-
const Webamp = window.Webamp;
11+
<script type="module">
12+
import Webamp from "https://unpkg.com/webamp@next";
1413
const webamp = new Webamp({
1514
windowLayout: {
1615
main: {

examples/multipleSkins/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
<div id="app" style="height: 100vh">
99
<!-- Webamp will attempt to center itself within this div -->
1010
</div>
11-
<script src="https://unpkg.com/webamp@1.4.2/built/webamp.bundle.min.js"></script>
12-
<script>
13-
const Webamp = window.Webamp;
11+
<script type="module">
12+
import Webamp from "https://unpkg.com/webamp@next";
1413
const webamp = new Webamp({
1514
// Optional. An array of objects representing skins.
1615
// These will appear in the "Options" menu under "Skins".

examples/multipleTracks/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
<div id="app" style="height: 100vh">
99
<!-- Webamp will attempt to center itself within this div -->
1010
</div>
11-
<script src="https://unpkg.com/webamp@1.4.2/built/webamp.bundle.min.js"></script>
12-
<script>
13-
const Webamp = window.Webamp;
11+
<script type="module">
12+
import Webamp from "https://unpkg.com/webamp@next";
1413
const webamp = new Webamp({
1514
/**
1615
* Here we list three tracks. Note that the `metaData` fields and

packages/webamp/CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
## Upcoming [UNRELEASED] (`webamp@next`)
22

3+
_No changes yet._
4+
5+
## 2.0.0 [CURRENT]
6+
37
### Features
48

59
- Allow a single mouse drag across the EQ to set all values [#1180](https://github.com/captbaritone/webamp/pull/1180)
@@ -15,11 +19,11 @@
1519
### Internal Improvements:
1620

1721
- Upgrade to React 18, React Redux, 8 and Redux 4.1
18-
- Bundle with Parcel instead of Webpack
22+
- Bundle with Rollup instead of Webpack
1923
- Build public Typescript directly from source annotations.
2024
- We no longer transform object spreads since they have broad support in browsers.
2125

22-
## 1.5.0 [CURRENT]
26+
## 1.5.0
2327

2428
### Features
2529

packages/webamp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webamp",
3-
"version": "1.5.0",
3+
"version": "2.0.0",
44
"description": "Winamp 2 implemented in HTML5 and JavaScript",
55
"files": [
66
"built",

0 commit comments

Comments
 (0)