fastled 1.2.96__py3-none-any.whl → 1.2.97__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,471 +1,471 @@
1
- Metadata-Version: 2.4
2
- Name: fastled
3
- Version: 1.2.96
4
- Summary: FastLED Wasm Compiler
5
- Home-page: https://github.com/zackees/fastled-wasm
6
- Maintainer: Zachary Vorhies
7
- License: BSD 3-Clause License
8
- Keywords: template-python-cmd
9
- Classifier: Programming Language :: Python :: 3
10
- Requires-Python: >=3.10
11
- Description-Content-Type: text/markdown
12
- License-File: LICENSE
13
- Requires-Dist: httpx>=0.28.1
14
- Requires-Dist: watchdog>=6.0.0
15
- Requires-Dist: docker>=7.1.0
16
- Requires-Dist: filelock>=3.16.1
17
- Requires-Dist: appdirs>=1.4.4
18
- Requires-Dist: rapidfuzz>=3.10.1
19
- Requires-Dist: progress>=1.6
20
- Requires-Dist: watchfiles>=1.0.5
21
- Requires-Dist: Flask>=3.0.0
22
- Requires-Dist: livereload
23
- Requires-Dist: fastled-wasm-server>=1.0.18
24
- Dynamic: home-page
25
- Dynamic: license-file
26
- Dynamic: maintainer
27
-
28
- # FastLED Wasm compiler
29
-
30
- [![Linting](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml)
31
- [![MacOS_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml)
32
- [![Ubuntu_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml)
33
- [![Win_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml)
34
- [![Test Build Executables](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml)
35
-
36
- [![Build and Push Multi Docker Image](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml)
37
- [![Publish Release](https://github.com/zackees/fastled-wasm/actions/workflows/publish_release.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/publish_release.yml)
38
- [![Build Webpage](https://github.com/zackees/fastled-wasm/actions/workflows/build_webpage.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_webpage.yml)
39
-
40
-
41
- ## Compile your FastLED sketch and run it on the Browser!!
42
-
43
- ![image](https://github.com/user-attachments/assets/243aeb4d-e42f-4cc3-9c31-0af51271f3e0)
44
-
45
- # Demo
46
-
47
- https://zackees.github.io/fastled-wasm/
48
-
49
-
50
- # About
51
-
52
- This python app will compile your FastLED style sketches into html/js/wasm output that runs directly in the browser.
53
-
54
- Compile times are extremely fast, thanks to aggressive object caching for C++ and sketch fingerprinting with a zip file cache. Recompilation of sketch files with minimal changes will occure in less than a second.
55
-
56
- If you have docker installed, the compiler will download the docker image and run a private local server on your machine. If you don't have Docker installed then the app will fall back to using the public web compiler.
57
-
58
- In every conceivable way, the local compiler will be much faster than the web version.
59
-
60
-
61
- # Install
62
-
63
- `pip install fastled`
64
-
65
- ### Ubuntu Binaries
66
-
67
- You can get the latest ubuntu binary of the FastLED cli compiler like this:
68
-
69
- ```
70
- curl -L https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/install_linux.sh | /bin/bash
71
- ```
72
-
73
- # Run
74
-
75
- ```bash
76
- cd mysketchdirectory
77
- fastled
78
- ```
79
-
80
- # Tutorial video
81
-
82
- **Note this video is a little outdated, you will install the app now with `pip install fastled` and run it like `fastled mysketchfolder`**
83
-
84
- https://github.com/user-attachments/assets/64ae0e6c-5f8b-4830-ab87-dcc25bc61218
85
-
86
-
87
-
88
- # Install
89
-
90
- ```bash
91
- pip install fastled
92
- ```
93
-
94
- **Note that you may need to install x86 docker emulation on Mac-m1 and later, as this is an x86 only image at the prsent.**
95
-
96
- # Command Line Use
97
-
98
- Change to the directory where the sketch lives and run, will run the compilation
99
- on the web compiler.
100
-
101
- ```bash
102
- # This will use the web-compiler, unless you have docker installed in which case a local
103
- # server will be instantiated automatically.
104
- cd <SKETCH-DIRECTORY>
105
- fastled
106
- ```
107
-
108
- Forces the local server to to spawn in order to run to do the compile.
109
-
110
- ```bash
111
- cd <SKETCH-DIRECTORY>
112
- fastled --local # if server doesn't already exist, one is created.
113
- ```
114
-
115
- You can also spawn a server in one process and then access it in another, like this:
116
-
117
- ```bash
118
- fastled --server # server will now run in the background.
119
- # now launch the client
120
- fastled examples/wasm --local # local will find the local server and use it to do the compile.
121
- ```
122
-
123
- After compilation a web browser windows will pop up. Changes to the sketch will automatically trigger a recompilation.
124
-
125
- # Python Api
126
-
127
- **Compiling through the api**
128
- ```python
129
-
130
- from fastapi import Api, CompileResult
131
-
132
- out: CompileResult = Api.web_compile("path/to/sketch")
133
- print(out.success)
134
- print(out.stdout)
135
-
136
- ```
137
-
138
- **Launching a compile server**
139
- ```python
140
-
141
- from fastapi import Api, CompileServer
142
-
143
- server: CompileServer = Api.spawn_server()
144
- print(f"Local server running at {server.url()}")
145
- server.web_compile("path/to/sketch") # output will be "path/to/sketch/fastled_js"
146
- server.stop()
147
- ```
148
-
149
- **Launching a server in a scope**
150
- ```python
151
-
152
- from fastapi import Api
153
-
154
- # Launching a server in a scope
155
- with Api.server() as server:
156
- server.web_compile("path/to/sketch")
157
-
158
- ```
159
-
160
- **Initializing a project example from the web compiler**
161
- ```python
162
-
163
- from fastapi import Api
164
-
165
- examples = Api.get_examples()
166
- print(f"Print available examples: {examples}")
167
- Api.project_init(examples[0])
168
-
169
-
170
- ```
171
-
172
- **Initializing a project example from the CompileServer**
173
- ```python
174
-
175
- from fastapi import Api
176
-
177
- with Api.server() as server:
178
- examples = server.get_examples()
179
- server.project_init(examples[0])
180
-
181
- ```
182
-
183
- **LiveClient will auto-trigger a build on code changes, just like the cli does**
184
- ```python
185
-
186
- # Live Client will compile against the web-compiler
187
- from fastapi import Api, LiveClient
188
- client: LiveClient = Api.live_client(
189
- "path/to/sketch_directory",
190
- )
191
- # Now user can start editing their sketch and it will auto-compile
192
- # ... after a while stop it like this.
193
- client.stop()
194
- ```
195
-
196
- **LiveClient with local CompileServer**
197
- ```python
198
-
199
- # Live Client will compile against a local server.
200
- from fastapi import Api, LiveClient
201
-
202
- with Api.server() as server:
203
- client: LiveClient = Api.live_client(
204
- "path/to/sketch_directory",
205
- host=server
206
- )
207
- # Now user can start editing their sketch and it will auto-compile
208
- # ... after a while stop it like this.
209
- client.stop()
210
- ```
211
-
212
- **Build Docker Image from a local copy of the FastLED repo**
213
- ```python
214
- from fastapi import Docker, Api
215
- container_name: str = Docker.spawn_server_from_fastled_repo()
216
- with Api.server(container_name=container_name) as server:
217
- ...
218
- ```
219
-
220
- # Features
221
-
222
- ## Hot reload by default
223
-
224
- Once launched, the compiler will remain open, listening to changes and recompiling as necessary, hot-reloading the sketch into the current browser.
225
-
226
- This style of development should be familiar to those doing web development.
227
-
228
- ## Hot Reload fastled/src when working in the FastLED repo
229
-
230
- If you launch `fastled` in the FastLED repo then this tool will automatically detect this and map the src directory into the
231
- host container. Whenever there are changes in the source code from the mapped directory, then these will be re-compiled
232
- on the next change or if you hit the space bar when prompted. Unlike a sketch folder, a re-compile on the FastLED src
233
- can be much longer, for example, if you modify a header file.
234
-
235
- ## Big Data in `/data` directory won't be round-tripped
236
-
237
- Huge blobs of data like video will absolutely kill the compile performance as these blobs would normally have to be shuffled
238
- back and forth. Therefore a special directory `data/` is implicitly used to hold this blob data. Any data in this directory
239
- will be replaced with a stub containing the size and hash of the file during upload. On download, these stubs are swapped back
240
- with their originals during decompression.
241
-
242
- The wasm compiler will recognize all files in the `data/` directory and generate a `files.json` manifest which can be used
243
- in your wasm sketch using an emulated SD card system mounted at `/data/` on the SD Card. In order to increase load speed, these
244
- files will be asynchronously streamed into the running sketch instance during runtime. Files named with *.json, *.csv, *.txt will be
245
- immediately injected in the app before setup() is called and can be used immediately in setup() in their entirety.
246
-
247
- All other files will be streamed in. The `Video` element in FastLED is designed to gracefully handle missing data streamed in through
248
- the file system.
249
-
250
- For an example of how to use this see `examples/SdCard` which is fully wasm compatible.
251
-
252
- ## Compile Speed
253
-
254
- There are three compile settings available to the user. The default is `--quick`. Aggressive optimizations are done with `--release` which will optimize for size, although the speed difference between `--release` and `--quick` seems negligible. But `--release` will produce a ~1/3 smaller binary. There is also `--debug`, which will include symbols necessary for debugging and getting the C++ function symbols working correctly in the browser during step-through debugging. In my personal tests it works better than expected, but don't expect to have gdb or msvc debugger level of the debugging experience.
255
-
256
- We use `ccache` to cache object files. This seems actually help a lot and is better than Platformio's method of tracking what needs to be rebuilt. This works as a two-tier cache system. What Platformio misses will be covered by ccache's more advanced file changing system.
257
-
258
- The compilation to wasm will happen under a lock. Removing this lock requires removing the Platformio toolchain as the compiler backend which enforces its own internal lock preventing parallel use.
259
-
260
- ## Sketch Cache
261
-
262
- Sketches are aggressively fingerprinted and stored in a cache. White space, comments, and other superficial data will be stripped out during pre-processing and minimization for fingerprinting. This source file decimation is only used for finger
263
- printing while the actual source files are sent to the compiler to preserve line numbers and file names.
264
-
265
- This pre-processing done is done via gcc and special regex's and will happen without a lock. This will allow you to have extremely quick recompiles for whitespace and changes in comments.
266
-
267
- ## Local compiles
268
-
269
- If the web compiler gets congested then it's recommended that you run the compiler locally. This requires docker and will be invoked whenever you pass in `--local`. This will first pull the most recent Docker image of the Fastled compiler, launch a webserver, and then connect to it with the client once it's been up.
270
-
271
- ## Auto updates
272
-
273
- In server mode, the git repository will be cloned as a side repo and then periodically updated and rsync'd to the src directory. This allows a long-running instance to stay updated.
274
-
275
- ## Compatibility with Arduino sketches
276
-
277
- The compatibility is pretty good. Most simple sketches should compile out of the box. Even some of the AVR platforms are stubbed out to make it work. For Arduino, the familiar `digitalWrite()`, `Serial.println()`, and other common functions work. Although `digitalRead()` will always return 0 and `analogRead()` will return random numbers.
278
-
279
- ### Faqs
280
-
281
- Q: How often is the docker image updated?
282
- A: It's scheduled for rebuild once a day at 3am Pacific time, and also on every change to this repo.
283
-
284
- Q: How can I run my own cloud instance of the FastLED wasm compiler?
285
- A: Render.com (which fastled is hosted on) or DigialOcean can accept a GitHub repo and auto-build the docker image.
286
-
287
- Q: Why does FastLED tend to become choppy when the browser is in the background?
288
- A: FastLED Wasm currently runs on the main thread and therefor Chrome will begin throttling the event loop when the browser is not in the foreground. The solution to this is to move FastLED to a web worker where it will get a background thread that Chrome / Firefox won't throttle.
289
-
290
- Q: Why does a long `delay()` cause the browser to freeze and become sluggish?
291
- A: `delay()` will block `loop()` which blocks the main thread of the browser. The solution is a webworker which will not affect the main thread performance of the browser.
292
-
293
-
294
- Q: How can I get the compiled size of my FastLED sketch smaller?
295
- A: A big chunk of space is being used by unnecessary javascript `emscripten` bundling. The wasm_compiler_settings.py file in the FastLED repo can tweak this.
296
-
297
-
298
- # Revisions
299
- * 1.2.31 - Bunch of fixes and ease of use while compiling code in the repo.
300
- * 1.2.22 - Prefer to use `live-server` from npm. If npm exists on the system then do a background install of `live-server` for next run.
301
- * 1.2.20 - Fixed up path issue for web browser launch for hot reload.
302
- * 1.2.19 - Compilation failure now overwrites the index.html file with error message.
303
- * 1.2.16 - Force mime types in web browser as some users may not have it correct in their registry.
304
- * 1.2.15 - Rewrote http server using flask. Reduced install size significantly.
305
- * 1.2.13 - More fixes for npm live-server, now uses `static-npm` to launch it.
306
- * 1.2.12 - Fixes for python npm for launching live-server
307
- * 1.2.10 - `fastled.Test` now allows you to spawn the http webserver on a folder with an index.html in it.
308
- * 1.2.7 - A bunch of fixes for MacOS and probably linux.
309
- * 1.2.6 - Now builds image from the project root of FastLED.
310
- * 1.1.25 - Fix up paths for `--init`
311
- * 1.1.24 - Mac/Linux now properly responds to ctrl-c when waiting for a key event.
312
- * 1.1.23 - Fixes missing `live-server` on platforms that don't have it already.
313
- * 1.2.22 - Added `--purge` and added docker api at __init__.
314
- * 1.2.00 - `fastled.exe` is now a signed binary on windows, however it's a self signed binary so you'll still get the warning on the first open. There's been a small api change between the server and the client for fetching projects.
315
- * 1.1.69 - Changed the binary name to `fastled.exe` instead of something like `fastled-windows-x64.exe`
316
- * 1.1.68 - Add a site builder to fastled.Test which generates a website with a bunch of demos. This is used to build the demo site automatically.
317
- * 1.1.67 - Pinned all the minimum versions of dependencies so we don't bind to an out of date py dep: https://github.com/zackees/fastled-wasm/issues/3
318
- * 1.1.61 - Excluded non compiling examples from the Test object as part of the api - no sense in having them if they won't compile.
319
- * 1.1.60 - Platform executables (macos-arm/macos-x86/windows/linux-x86) now auto building with each release. Add tests.
320
- * 1.1.52 - Add linux-arm
321
- * 1.1.49 - Try again.
322
- * 1.1.46 - Add mac x86 exe
323
- * 1.1.45 - Another try for web publishing from github.
324
- * 1.1.42 - Second test for web publishing from github.
325
- * 1.1.41 - Platform executable (through pyinstaller) now enabled.
326
- * 1.1.40 - Remove `sketch_directory` from Api object. This was only needed before we had a client/server architecture.
327
- * 1.1.39 - Added `LiveClient`, `fastled.Api.live_server()` will spawn it. Allows user to have a live compiling client that re-triggers a compile on file changes.
328
- * 1.1.38 - Cleanup the `fastled.Api` object and streamline for general use.
329
- * 1.1.37 - `Test.test_examples()` is now unit tested to work correctly.
330
- * 1.1.36 - We now have an api. `from fastled import Api` and `from fastled import Test` for testing.
331
- * 1.1.35 - When searching for files cap the limit at a high amount to prevent hang.
332
- * 1.1.34 - On windows check to make sure we are in linux container mode, if not try to switch and if that fails then use `--web` compiler.
333
- * 1.1.33 - Auto updating frequency has been reduced from one hour to one day. To update immediatly use `--update`.
334
- * 1.1.32 - `--init` now asks for which example you want, then tells you where the example was downloaded to. No longer auto-compiles.
335
- * 1.1.31 - `--local` is auto-enabled if docker is installed, use `--web` to force web compiler. Updating is much more pretty.
336
- * 1.1.30 - Added `--init` to initialize a demo project.
337
- * 1.1.29 - Remove annoying dbg messages i left in.
338
- * 1.1.28 - Adds cache control headers to the live server to disable all caching in the live browser.
339
- * 1.1.27 - Fixed `--interactive` so that it now works correctly.
340
- * 1.1.25 - Improved detecting which sketch directory the user means by fuzzy matching.
341
- * 1.1.24 - Adds progress spinning bar for pulling images, which take a long time.
342
- * 1.1.23 - Various fixes for MacOS
343
- * 1.1.22 - Selecting sketch now allows strings and narrowing down paths if ambiguity
344
- * 1.1.21 - Now always watches for space/enter key events to trigger a recompile.
345
- * 1.1.20 - Fixed a regression for 1.1.16 involving docker throwing an exception before DockerManager.is_running() could be called so it can be launched.
346
- * 1.1.19 - Automatically does a limit searches for sketch directories if you leave it blank.
347
- * 1.1.18 - Fixes for when the image has never been downloaded.
348
- * 1.1.17 - Added `--update` and `--no-auto-update` to control whether the compiler in docker mode will try to update.
349
- * 1.1.16 - Rewrote docker logic to use container suspension and resumption. Much much faster.
350
- * 1.1.15 - Fixed logic for considering ipv6 addresses. Auto selection of ipv6 is now restored.
351
- * 1.1.14 - Fixes for regression in using --server and --localhost as two instances, this is now under test.
352
- * 1.1.13 - Disable the use of ipv6. It produces random timeouts on the onrender server we are using for the web compiler.
353
- * 1.1.12 - By default, fastled will default to the web compiler. `--localhost` to either attach to an existing server launched with `--server` or else one will be created automatically and launched.
354
- * 1.1.11 - Dev improvement: FastLED src code volume mapped into docker will just in time update without having to manually trigger it.
355
- * 1.1.10 - Swap large assets with embedded placeholders. This helps video sketches upload and compile instantly. Assets are re-added on after compile artifacts are returned.
356
- * 1.1.9 - Remove auto server and instead tell the user corrective action to take.
357
- * 1.1.8 - Program now knows it's own version which will be displayed with help file. Use `--version` to get it directly.
358
- * 1.1.7 - Sketch cache re-enabled, but selectively invalidated on cpp/h updates. Cleaned up deprecated args. Fixed double thread running for containers that was causing slowdown.
359
- * 1.1.6 - Use the fast src volume map allow quick updates to fastled when developing on the source code.
360
- * 1.1.5 - Filter out hidden files and directories from being included in the sketch archive sent to the compiler.
361
- * 1.1.4 - Fix regression introduced by testing out ipv4/ipv6 connections from a thread pool.
362
- * 1.1.3 - Live editing of *.h and *.cpp files is now possible. Sketch cache will be disabled in this mode.
363
- * 1.1.2 - `--server` will now volume map fastled src directory if it detects this. This was also implemented on the docker side.
364
- * 1.1.1 - `--interactive` is now supported to debug the container. Volume maps and better compatibilty with ipv4/v6 by concurrent connection finding.
365
- * 1.1.0 - Use `fastled` as the command for the wasm compiler.
366
- * 1.0.17 - Pulls updates when necessary. Removed dependency on keyring.
367
- * 1.0.16 - `fastled-wasm` package name has been changed to `fled`
368
- * 1.0.15 - `fled` is an alias of `fastled-wasm` and will eventually replace it. `--web-host` was folded into `--web`, which if unspecified will attempt to run a local docker server and fallback to the cloud server if that fails. Specifying `--web` with no arguments will default to the cloud server while an argument (like `localhost`) will cause it to bind to that already running server for compilation.
369
- * 1.0.14 - For non significant changes (comments, whitespace) in C++/ino/*.h files, compilation is skipped. This significantly reduces load on the server and prevents unnecessary local client browser refreshes.
370
- * 1.0.13 - Increase speed of local compiles by running the server version of the compiler so it can keep it's cache and not have to pay docker startup costs because now it's a persistant server until exit.
371
- * 1.0.12 - Added suppport for compile modes. Pass in `--release`, `--quick`, `--debug` for different compile options. We also support `--profile` to profile the build process.
372
- * 1.0.11 - `--web` compile will automatically be enabled if the local build using docker fails.
373
- * 1.0.10 - Watching files is now available for `--web`
374
- * 1.0.9 - Enabled web compile. Access it with `--web` or `--web-host`
375
- * 1.0.8 - Allow more than one fastled-wasm browser instances to co-exist by searching for unused ports after 8081.
376
- * 1.0.7 - Docker multi image build implemented, tool now points to new docker image compile.
377
- * 1.0.6 - Removed `--no-open` and `--watch`, `--watch` is now assumed unless `--just-compile` is used.
378
- * 1.0.5 - Implemented `--update` to update the compiler image from the docker registry.
379
- * 1.0.4 - Implemented `--watch` which will watch for changes and then re-launch the compilation step.
380
- * 1.0.3 - Integrated `live-server` to launch when available.
381
- * 1.0.2 - Small bug with new installs.
382
- * 1.0.1 - Re-use is no longer the default, due to problems.
383
- * 1.0.0 - Initial release.
384
-
385
-
386
- # TODO
387
- * `live-server --https --cert=localhost.pem --key=localhost-key.pem --port=5500`
388
- * `live-server --port=8416 --host=localhost . --https --cert=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost-key.pem --key=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost.pem --no-browser`
389
-
390
-
391
-
392
- live-server --https --port=8416 --host=localhost . --cert=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost-key.pem --key=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost.pem --no-browser
393
-
394
-
395
- live-server --https --cert=src/fastled/assets/localhost.pem --key=src/fastled/assets/localhost-key.pem --port=5500
396
-
397
-
398
- ## Performance
399
-
400
- ```
401
- ###############################
402
- # Build started with command: #
403
- # pio run -v #
404
- ###############################
405
-
406
- 0.41 Warning! Ignore unknown configuration option `build_dir` in section [env:wasm]
407
- 0.41 Warning! Ignore unknown configuration option `force_verbose` in section [env:wasm]
408
- 0.41 Processing wasm (platform: native; extra_scripts: post:wasm_compiler_flags.py; lib_compat_mode: off; build_flags: -std=c++17, -DFASTLED_NO_PINMAP, -DHAS_HARDWARE_PIN_SUPPORT, -DFASTLED_FORCE_SOFTWARE_SPI, -I/js/src/platforms/wasm/compiler; custom_wasm_export_name: fastled; lib_deps: FastLED=symlink://fastled; build_dir: build/wasm; force_verbose: yes)
409
- 0.41 --------------------------------------------------------------------------------
410
- 0.99 LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
411
- 0.99 LDF Modes: Finder ~ chain, Compatibility ~ off
412
- 0.99 Found 1 compatible libraries
413
- 0.99 Scanning dependencies...
414
- 1.40 Dependency Graph
415
- 1.40 |-- FastLED @ 3.9.16 (License: MIT, Path: /js/fastled)
416
- 1.49 Building in release mode
417
- 1.49
418
- 1.49 #########################
419
- 1.49 # C++/C Compiler Flags: #
420
- 1.49 #########################
421
- 1.49
422
- 1.49 CC/CXX flags:
423
- 1.49 -DFASTLED_ENGINE_EVENTS_MAX_LISTENERS=50
424
- 1.49 -DFASTLED_FORCE_NAMESPACE=1
425
- 1.49 -DFASTLED_USE_PROGMEM=0
426
- 1.49 -O1
427
- 1.49 -DUSE_OFFSET_CONVERTER=0
428
- 1.49 -std=gnu++17
429
- 1.49 -fpermissive
430
- 1.49 -Wno-constant-logical-operand
431
- 1.49 -Wnon-c-typedef-for-linkage
432
- 1.49 -Werror=bad-function-cast
433
- 1.49 -Werror=cast-function-type
434
- 1.49 -I
435
- 1.49 src
436
- 1.49 -I/js/src/platforms/wasm/compiler
437
- 1.49
438
- 1.49 #################
439
- 1.49 # Linker Flags: #
440
- 1.49 #################
441
- 1.49
442
- 1.49 --bind
443
- 1.49 -fuse-ld=lld
444
- 1.49 -sWASM=1
445
- 1.49 -sALLOW_MEMORY_GROWTH=1
446
- 1.49 -sINITIAL_MEMORY=134217728
447
- 1.49 -sEXPORTED_RUNTIME_METHODS=['ccall','cwrap','stringToUTF8','lengthBytesUTF8']
448
- 1.49 -sEXPORTED_FUNCTIONS=['_malloc','_free','_extern_setup','_extern_loop','_fastled_declare_files']
449
- 1.49 --no-entry
450
- 1.49 -sERROR_ON_WASM_CHANGES_AFTER_LINK
451
- 1.49 -sMODULARIZE=1
452
- 1.49 -sEXPORT_NAME=fastled
453
- 1.49 -o
454
- 1.49 /js/.pio/build/wasm/fastled.js
455
- 1.49
456
- 1.49 ##########################
457
- 1.49 # FastLED Library Flags: #
458
- 1.49 ##########################
459
- 1.49
460
- 1.49 --bind
461
- 1.49 -Wl,--whole-archive,-fuse-ld=lld
462
- 1.49 -Werror=bad-function-cast
463
- 1.49 -Werror=cast-function-type
464
- 1.49
465
- 1.49 ################
466
- 1.49 # End of Flags #
467
- 1.49 ################
468
- 1.49
469
- 2.20 ccache em++ -o .pio/build/wasm/program --bind -fuse-ld=lld -sWASM=1 -sALLOW_MEMORY_GROWTH=1 -sINITIAL_MEMORY=134217728 -sEXPORTED_RUNTIME_METHODS=['ccall','cwrap','stringToUTF8','lengthBytesUTF8'] -sEXPORTED_FUNCTIONS=['_malloc','_free','_extern_setup','_extern_loop','_fastled_declare_files'] --no-entry -sERROR_ON_WASM_CHANGES_AFTER_LINK -sMODULARIZE=1 -sEXPORT_NAME=fastled -o /js/.pio/build/wasm/fastled.js .pio/build/wasm/libbb9/fastled/FastLED.o .pio/build/wasm/libbb9/fastled/bitswap.o .pio/build/wasm/libbb9/fastled/cled_controller.o .pio/build/wasm/libbb9/fastled/colorpalettes.o .pio/build/wasm/libbb9/fastled/crgb.o .pio/build/wasm/libbb9/fastled/fl/allocator.o .pio/build/wasm/libbb9/fastled/fl/audio.o .pio/build/wasm/libbb9/fastled/fl/bilinear_expansion.o .pio/build/wasm/libbb9/fastled/fl/blur.o .pio/build/wasm/libbb9/fastled/fl/bytestreammemory.o .pio/build/wasm/libbb9/fastled/fl/colorutils.o .pio/build/wasm/libbb9/fastled/fl/downscale.o .pio/build/wasm/libbb9/fastled/fl/engine_events.o .pio/build/wasm/libbb9/fastled/fl/fft.o .pio/build/wasm/libbb9/fastled/fl/fft_impl.o .pio/build/wasm/libbb9/fastled/fl/file_system.o .pio/build/wasm/libbb9/fastled/fl/fill.o .pio/build/wasm/libbb9/fastled/fl/five_bit_hd_gamma.o .pio/build/wasm/libbb9/fastled/fl/gradient.o .pio/build/wasm/libbb9/fastled/fl/json.o .pio/build/wasm/libbb9/fastled/fl/leds.o .pio/build/wasm/libbb9/fastled/fl/line_simplification.o .pio/build/wasm/libbb9/fastled/fl/noise_woryley.o .pio/build/wasm/libbb9/fastled/fl/ptr.o .pio/build/wasm/libbb9/fastled/fl/raster_sparse.o .pio/build/wasm/libbb9/fastled/fl/rectangular_draw_buffer.o .pio/build/wasm/libbb9/fastled/fl/screenmap.o .pio/build/wasm/libbb9/fastled/fl/sin32.o .pio/build/wasm/libbb9/fastled/fl/str.o .pio/build/wasm/libbb9/fastled/fl/strstream.o .pio/build/wasm/libbb9/fastled/fl/stub_main.o .pio/build/wasm/libbb9/fastled/fl/tile2x2.o .pio/build/wasm/libbb9/fastled/fl/time_alpha.o .pio/build/wasm/libbb9/fastled/fl/transform.o .pio/build/wasm/libbb9/fastled/fl/type_traits.o .pio/build/wasm/libbb9/fastled/fl/ui.o .pio/build/wasm/libbb9/fastled/fl/wave_simulation.o .pio/build/wasm/libbb9/fastled/fl/wave_simulation_real.o .pio/build/wasm/libbb9/fastled/fl/xmap.o .pio/build/wasm/libbb9/fastled/fl/xymap.o .pio/build/wasm/libbb9/fastled/fl/xypath.o .pio/build/wasm/libbb9/fastled/fl/xypath_impls.o .pio/build/wasm/libbb9/fastled/fl/xypath_renderer.o .pio/build/wasm/libbb9/fastled/fx/2d/blend.o .pio/build/wasm/libbb9/fastled/fx/2d/noisepalette.o .pio/build/wasm/libbb9/fastled/fx/2d/scale_up.o .pio/build/wasm/libbb9/fastled/fx/2d/wave.o .pio/build/wasm/libbb9/fastled/fx/frame.o .pio/build/wasm/libbb9/fastled/fx/fx_engine.o .pio/build/wasm/libbb9/fastled/fx/time.o .pio/build/wasm/libbb9/fastled/fx/video.o .pio/build/wasm/libbb9/fastled/fx/video/frame_interpolator.o .pio/build/wasm/libbb9/fastled/fx/video/frame_tracker.o .pio/build/wasm/libbb9/fastled/fx/video/pixel_stream.o .pio/build/wasm/libbb9/fastled/fx/video/video_impl.o .pio/build/wasm/libbb9/fastled/hsv2rgb.o .pio/build/wasm/libbb9/fastled/lib8tion.o .pio/build/wasm/libbb9/fastled/noise.o .pio/build/wasm/libbb9/fastled/platforms.o .pio/build/wasm/libbb9/fastled/platforms/arm/k20/clockless_objectfled.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/clockless_i2s_esp32s3.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/i2s/i2s_esp32dev.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/rmt_4/idf4_rmt.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/rmt_4/idf4_rmt_impl.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/rmt_5/idf5_rmt.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/rmt_5/strip_rmt.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/spi_ws2812/strip_spi.o .pio/build/wasm/libbb9/fastled/platforms/wasm/active_strip_data.o .pio/build/wasm/libbb9/fastled/platforms/wasm/compiler/Arduino.o .pio/build/wasm/libbb9/fastled/platforms/wasm/engine_listener.o .pio/build/wasm/libbb9/fastled/platforms/wasm/fs_wasm.o .pio/build/wasm/libbb9/fastled/platforms/wasm/js.o .pio/build/wasm/libbb9/fastled/platforms/wasm/timer.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/audio.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/button.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/checkbox.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/description.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/number_field.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/slider.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/title.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/ui_internal.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/ui_manager.o .pio/build/wasm/libbb9/fastled/power_mgt.o .pio/build/wasm/libbb9/fastled/rgbw.o .pio/build/wasm/libbb9/fastled/sensors/digital_pin.o .pio/build/wasm/libbb9/fastled/sensors/pir.o .pio/build/wasm/libbb9/fastled/simplex.o .pio/build/wasm/libbb9/fastled/third_party/cq_kernel/cq_kernel.o .pio/build/wasm/libbb9/fastled/third_party/cq_kernel/kiss_fft.o .pio/build/wasm/libbb9/fastled/third_party/cq_kernel/kiss_fftr.o .pio/build/wasm/libbb9/fastled/third_party/espressif/led_strip/src/led_strip_api.o .pio/build/wasm/libbb9/fastled/third_party/espressif/led_strip/src/led_strip_rmt_dev.o .pio/build/wasm/libbb9/fastled/third_party/espressif/led_strip/src/led_strip_rmt_encoder.o .pio/build/wasm/libbb9/fastled/third_party/espressif/led_strip/src/led_strip_spi_dev.o .pio/build/wasm/libbb9/fastled/third_party/object_fled/src/OjectFLED.o .pio/build/wasm/libbb9/fastled/transpose8x1_noinline.o .pio/build/wasm/libbb9/fastled/wiring.o .pio/build/wasm/src/wasm.ino.o -L.pio/build/wasm
470
- 3.61 ========================= [SUCCESS] Took 3.20 seconds =========================
471
- ```
1
+ Metadata-Version: 2.4
2
+ Name: fastled
3
+ Version: 1.2.97
4
+ Summary: FastLED Wasm Compiler
5
+ Home-page: https://github.com/zackees/fastled-wasm
6
+ Maintainer: Zachary Vorhies
7
+ License: BSD 3-Clause License
8
+ Keywords: template-python-cmd
9
+ Classifier: Programming Language :: Python :: 3
10
+ Requires-Python: >=3.10
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: httpx>=0.28.1
14
+ Requires-Dist: watchdog>=6.0.0
15
+ Requires-Dist: docker>=7.1.0
16
+ Requires-Dist: filelock>=3.16.1
17
+ Requires-Dist: appdirs>=1.4.4
18
+ Requires-Dist: rapidfuzz>=3.10.1
19
+ Requires-Dist: progress>=1.6
20
+ Requires-Dist: watchfiles>=1.0.5
21
+ Requires-Dist: Flask>=3.0.0
22
+ Requires-Dist: livereload
23
+ Requires-Dist: fastled-wasm-server>=1.0.18
24
+ Dynamic: home-page
25
+ Dynamic: license-file
26
+ Dynamic: maintainer
27
+
28
+ # FastLED Wasm compiler
29
+
30
+ [![Linting](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml)
31
+ [![MacOS_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml)
32
+ [![Ubuntu_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml)
33
+ [![Win_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml)
34
+ [![Test Build Executables](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml)
35
+
36
+ [![Build and Push Multi Docker Image](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml)
37
+ [![Publish Release](https://github.com/zackees/fastled-wasm/actions/workflows/publish_release.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/publish_release.yml)
38
+ [![Build Webpage](https://github.com/zackees/fastled-wasm/actions/workflows/build_webpage.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_webpage.yml)
39
+
40
+
41
+ ## Compile your FastLED sketch and run it on the Browser!!
42
+
43
+ ![image](https://github.com/user-attachments/assets/243aeb4d-e42f-4cc3-9c31-0af51271f3e0)
44
+
45
+ # Demo
46
+
47
+ https://zackees.github.io/fastled-wasm/
48
+
49
+
50
+ # About
51
+
52
+ This python app will compile your FastLED style sketches into html/js/wasm output that runs directly in the browser.
53
+
54
+ Compile times are extremely fast, thanks to aggressive object caching for C++ and sketch fingerprinting with a zip file cache. Recompilation of sketch files with minimal changes will occure in less than a second.
55
+
56
+ If you have docker installed, the compiler will download the docker image and run a private local server on your machine. If you don't have Docker installed then the app will fall back to using the public web compiler.
57
+
58
+ In every conceivable way, the local compiler will be much faster than the web version.
59
+
60
+
61
+ # Install
62
+
63
+ `pip install fastled`
64
+
65
+ ### Ubuntu Binaries
66
+
67
+ You can get the latest ubuntu binary of the FastLED cli compiler like this:
68
+
69
+ ```
70
+ curl -L https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/install_linux.sh | /bin/bash
71
+ ```
72
+
73
+ # Run
74
+
75
+ ```bash
76
+ cd mysketchdirectory
77
+ fastled
78
+ ```
79
+
80
+ # Tutorial video
81
+
82
+ **Note this video is a little outdated, you will install the app now with `pip install fastled` and run it like `fastled mysketchfolder`**
83
+
84
+ https://github.com/user-attachments/assets/64ae0e6c-5f8b-4830-ab87-dcc25bc61218
85
+
86
+
87
+
88
+ # Install
89
+
90
+ ```bash
91
+ pip install fastled
92
+ ```
93
+
94
+ **Note that you may need to install x86 docker emulation on Mac-m1 and later, as this is an x86 only image at the prsent.**
95
+
96
+ # Command Line Use
97
+
98
+ Change to the directory where the sketch lives and run, will run the compilation
99
+ on the web compiler.
100
+
101
+ ```bash
102
+ # This will use the web-compiler, unless you have docker installed in which case a local
103
+ # server will be instantiated automatically.
104
+ cd <SKETCH-DIRECTORY>
105
+ fastled
106
+ ```
107
+
108
+ Forces the local server to to spawn in order to run to do the compile.
109
+
110
+ ```bash
111
+ cd <SKETCH-DIRECTORY>
112
+ fastled --local # if server doesn't already exist, one is created.
113
+ ```
114
+
115
+ You can also spawn a server in one process and then access it in another, like this:
116
+
117
+ ```bash
118
+ fastled --server # server will now run in the background.
119
+ # now launch the client
120
+ fastled examples/wasm --local # local will find the local server and use it to do the compile.
121
+ ```
122
+
123
+ After compilation a web browser windows will pop up. Changes to the sketch will automatically trigger a recompilation.
124
+
125
+ # Python Api
126
+
127
+ **Compiling through the api**
128
+ ```python
129
+
130
+ from fastapi import Api, CompileResult
131
+
132
+ out: CompileResult = Api.web_compile("path/to/sketch")
133
+ print(out.success)
134
+ print(out.stdout)
135
+
136
+ ```
137
+
138
+ **Launching a compile server**
139
+ ```python
140
+
141
+ from fastapi import Api, CompileServer
142
+
143
+ server: CompileServer = Api.spawn_server()
144
+ print(f"Local server running at {server.url()}")
145
+ server.web_compile("path/to/sketch") # output will be "path/to/sketch/fastled_js"
146
+ server.stop()
147
+ ```
148
+
149
+ **Launching a server in a scope**
150
+ ```python
151
+
152
+ from fastapi import Api
153
+
154
+ # Launching a server in a scope
155
+ with Api.server() as server:
156
+ server.web_compile("path/to/sketch")
157
+
158
+ ```
159
+
160
+ **Initializing a project example from the web compiler**
161
+ ```python
162
+
163
+ from fastapi import Api
164
+
165
+ examples = Api.get_examples()
166
+ print(f"Print available examples: {examples}")
167
+ Api.project_init(examples[0])
168
+
169
+
170
+ ```
171
+
172
+ **Initializing a project example from the CompileServer**
173
+ ```python
174
+
175
+ from fastapi import Api
176
+
177
+ with Api.server() as server:
178
+ examples = server.get_examples()
179
+ server.project_init(examples[0])
180
+
181
+ ```
182
+
183
+ **LiveClient will auto-trigger a build on code changes, just like the cli does**
184
+ ```python
185
+
186
+ # Live Client will compile against the web-compiler
187
+ from fastapi import Api, LiveClient
188
+ client: LiveClient = Api.live_client(
189
+ "path/to/sketch_directory",
190
+ )
191
+ # Now user can start editing their sketch and it will auto-compile
192
+ # ... after a while stop it like this.
193
+ client.stop()
194
+ ```
195
+
196
+ **LiveClient with local CompileServer**
197
+ ```python
198
+
199
+ # Live Client will compile against a local server.
200
+ from fastapi import Api, LiveClient
201
+
202
+ with Api.server() as server:
203
+ client: LiveClient = Api.live_client(
204
+ "path/to/sketch_directory",
205
+ host=server
206
+ )
207
+ # Now user can start editing their sketch and it will auto-compile
208
+ # ... after a while stop it like this.
209
+ client.stop()
210
+ ```
211
+
212
+ **Build Docker Image from a local copy of the FastLED repo**
213
+ ```python
214
+ from fastapi import Docker, Api
215
+ container_name: str = Docker.spawn_server_from_fastled_repo()
216
+ with Api.server(container_name=container_name) as server:
217
+ ...
218
+ ```
219
+
220
+ # Features
221
+
222
+ ## Hot reload by default
223
+
224
+ Once launched, the compiler will remain open, listening to changes and recompiling as necessary, hot-reloading the sketch into the current browser.
225
+
226
+ This style of development should be familiar to those doing web development.
227
+
228
+ ## Hot Reload fastled/src when working in the FastLED repo
229
+
230
+ If you launch `fastled` in the FastLED repo then this tool will automatically detect this and map the src directory into the
231
+ host container. Whenever there are changes in the source code from the mapped directory, then these will be re-compiled
232
+ on the next change or if you hit the space bar when prompted. Unlike a sketch folder, a re-compile on the FastLED src
233
+ can be much longer, for example, if you modify a header file.
234
+
235
+ ## Big Data in `/data` directory won't be round-tripped
236
+
237
+ Huge blobs of data like video will absolutely kill the compile performance as these blobs would normally have to be shuffled
238
+ back and forth. Therefore a special directory `data/` is implicitly used to hold this blob data. Any data in this directory
239
+ will be replaced with a stub containing the size and hash of the file during upload. On download, these stubs are swapped back
240
+ with their originals during decompression.
241
+
242
+ The wasm compiler will recognize all files in the `data/` directory and generate a `files.json` manifest which can be used
243
+ in your wasm sketch using an emulated SD card system mounted at `/data/` on the SD Card. In order to increase load speed, these
244
+ files will be asynchronously streamed into the running sketch instance during runtime. Files named with *.json, *.csv, *.txt will be
245
+ immediately injected in the app before setup() is called and can be used immediately in setup() in their entirety.
246
+
247
+ All other files will be streamed in. The `Video` element in FastLED is designed to gracefully handle missing data streamed in through
248
+ the file system.
249
+
250
+ For an example of how to use this see `examples/SdCard` which is fully wasm compatible.
251
+
252
+ ## Compile Speed
253
+
254
+ There are three compile settings available to the user. The default is `--quick`. Aggressive optimizations are done with `--release` which will optimize for size, although the speed difference between `--release` and `--quick` seems negligible. But `--release` will produce a ~1/3 smaller binary. There is also `--debug`, which will include symbols necessary for debugging and getting the C++ function symbols working correctly in the browser during step-through debugging. In my personal tests it works better than expected, but don't expect to have gdb or msvc debugger level of the debugging experience.
255
+
256
+ We use `ccache` to cache object files. This seems actually help a lot and is better than Platformio's method of tracking what needs to be rebuilt. This works as a two-tier cache system. What Platformio misses will be covered by ccache's more advanced file changing system.
257
+
258
+ The compilation to wasm will happen under a lock. Removing this lock requires removing the Platformio toolchain as the compiler backend which enforces its own internal lock preventing parallel use.
259
+
260
+ ## Sketch Cache
261
+
262
+ Sketches are aggressively fingerprinted and stored in a cache. White space, comments, and other superficial data will be stripped out during pre-processing and minimization for fingerprinting. This source file decimation is only used for finger
263
+ printing while the actual source files are sent to the compiler to preserve line numbers and file names.
264
+
265
+ This pre-processing done is done via gcc and special regex's and will happen without a lock. This will allow you to have extremely quick recompiles for whitespace and changes in comments.
266
+
267
+ ## Local compiles
268
+
269
+ If the web compiler gets congested then it's recommended that you run the compiler locally. This requires docker and will be invoked whenever you pass in `--local`. This will first pull the most recent Docker image of the Fastled compiler, launch a webserver, and then connect to it with the client once it's been up.
270
+
271
+ ## Auto updates
272
+
273
+ In server mode, the git repository will be cloned as a side repo and then periodically updated and rsync'd to the src directory. This allows a long-running instance to stay updated.
274
+
275
+ ## Compatibility with Arduino sketches
276
+
277
+ The compatibility is pretty good. Most simple sketches should compile out of the box. Even some of the AVR platforms are stubbed out to make it work. For Arduino, the familiar `digitalWrite()`, `Serial.println()`, and other common functions work. Although `digitalRead()` will always return 0 and `analogRead()` will return random numbers.
278
+
279
+ ### Faqs
280
+
281
+ Q: How often is the docker image updated?
282
+ A: It's scheduled for rebuild once a day at 3am Pacific time, and also on every change to this repo.
283
+
284
+ Q: How can I run my own cloud instance of the FastLED wasm compiler?
285
+ A: Render.com (which fastled is hosted on) or DigialOcean can accept a GitHub repo and auto-build the docker image.
286
+
287
+ Q: Why does FastLED tend to become choppy when the browser is in the background?
288
+ A: FastLED Wasm currently runs on the main thread and therefor Chrome will begin throttling the event loop when the browser is not in the foreground. The solution to this is to move FastLED to a web worker where it will get a background thread that Chrome / Firefox won't throttle.
289
+
290
+ Q: Why does a long `delay()` cause the browser to freeze and become sluggish?
291
+ A: `delay()` will block `loop()` which blocks the main thread of the browser. The solution is a webworker which will not affect the main thread performance of the browser.
292
+
293
+
294
+ Q: How can I get the compiled size of my FastLED sketch smaller?
295
+ A: A big chunk of space is being used by unnecessary javascript `emscripten` bundling. The wasm_compiler_settings.py file in the FastLED repo can tweak this.
296
+
297
+
298
+ # Revisions
299
+ * 1.2.31 - Bunch of fixes and ease of use while compiling code in the repo.
300
+ * 1.2.22 - Prefer to use `live-server` from npm. If npm exists on the system then do a background install of `live-server` for next run.
301
+ * 1.2.20 - Fixed up path issue for web browser launch for hot reload.
302
+ * 1.2.19 - Compilation failure now overwrites the index.html file with error message.
303
+ * 1.2.16 - Force mime types in web browser as some users may not have it correct in their registry.
304
+ * 1.2.15 - Rewrote http server using flask. Reduced install size significantly.
305
+ * 1.2.13 - More fixes for npm live-server, now uses `static-npm` to launch it.
306
+ * 1.2.12 - Fixes for python npm for launching live-server
307
+ * 1.2.10 - `fastled.Test` now allows you to spawn the http webserver on a folder with an index.html in it.
308
+ * 1.2.7 - A bunch of fixes for MacOS and probably linux.
309
+ * 1.2.6 - Now builds image from the project root of FastLED.
310
+ * 1.1.25 - Fix up paths for `--init`
311
+ * 1.1.24 - Mac/Linux now properly responds to ctrl-c when waiting for a key event.
312
+ * 1.1.23 - Fixes missing `live-server` on platforms that don't have it already.
313
+ * 1.2.22 - Added `--purge` and added docker api at __init__.
314
+ * 1.2.00 - `fastled.exe` is now a signed binary on windows, however it's a self signed binary so you'll still get the warning on the first open. There's been a small api change between the server and the client for fetching projects.
315
+ * 1.1.69 - Changed the binary name to `fastled.exe` instead of something like `fastled-windows-x64.exe`
316
+ * 1.1.68 - Add a site builder to fastled.Test which generates a website with a bunch of demos. This is used to build the demo site automatically.
317
+ * 1.1.67 - Pinned all the minimum versions of dependencies so we don't bind to an out of date py dep: https://github.com/zackees/fastled-wasm/issues/3
318
+ * 1.1.61 - Excluded non compiling examples from the Test object as part of the api - no sense in having them if they won't compile.
319
+ * 1.1.60 - Platform executables (macos-arm/macos-x86/windows/linux-x86) now auto building with each release. Add tests.
320
+ * 1.1.52 - Add linux-arm
321
+ * 1.1.49 - Try again.
322
+ * 1.1.46 - Add mac x86 exe
323
+ * 1.1.45 - Another try for web publishing from github.
324
+ * 1.1.42 - Second test for web publishing from github.
325
+ * 1.1.41 - Platform executable (through pyinstaller) now enabled.
326
+ * 1.1.40 - Remove `sketch_directory` from Api object. This was only needed before we had a client/server architecture.
327
+ * 1.1.39 - Added `LiveClient`, `fastled.Api.live_server()` will spawn it. Allows user to have a live compiling client that re-triggers a compile on file changes.
328
+ * 1.1.38 - Cleanup the `fastled.Api` object and streamline for general use.
329
+ * 1.1.37 - `Test.test_examples()` is now unit tested to work correctly.
330
+ * 1.1.36 - We now have an api. `from fastled import Api` and `from fastled import Test` for testing.
331
+ * 1.1.35 - When searching for files cap the limit at a high amount to prevent hang.
332
+ * 1.1.34 - On windows check to make sure we are in linux container mode, if not try to switch and if that fails then use `--web` compiler.
333
+ * 1.1.33 - Auto updating frequency has been reduced from one hour to one day. To update immediatly use `--update`.
334
+ * 1.1.32 - `--init` now asks for which example you want, then tells you where the example was downloaded to. No longer auto-compiles.
335
+ * 1.1.31 - `--local` is auto-enabled if docker is installed, use `--web` to force web compiler. Updating is much more pretty.
336
+ * 1.1.30 - Added `--init` to initialize a demo project.
337
+ * 1.1.29 - Remove annoying dbg messages i left in.
338
+ * 1.1.28 - Adds cache control headers to the live server to disable all caching in the live browser.
339
+ * 1.1.27 - Fixed `--interactive` so that it now works correctly.
340
+ * 1.1.25 - Improved detecting which sketch directory the user means by fuzzy matching.
341
+ * 1.1.24 - Adds progress spinning bar for pulling images, which take a long time.
342
+ * 1.1.23 - Various fixes for MacOS
343
+ * 1.1.22 - Selecting sketch now allows strings and narrowing down paths if ambiguity
344
+ * 1.1.21 - Now always watches for space/enter key events to trigger a recompile.
345
+ * 1.1.20 - Fixed a regression for 1.1.16 involving docker throwing an exception before DockerManager.is_running() could be called so it can be launched.
346
+ * 1.1.19 - Automatically does a limit searches for sketch directories if you leave it blank.
347
+ * 1.1.18 - Fixes for when the image has never been downloaded.
348
+ * 1.1.17 - Added `--update` and `--no-auto-update` to control whether the compiler in docker mode will try to update.
349
+ * 1.1.16 - Rewrote docker logic to use container suspension and resumption. Much much faster.
350
+ * 1.1.15 - Fixed logic for considering ipv6 addresses. Auto selection of ipv6 is now restored.
351
+ * 1.1.14 - Fixes for regression in using --server and --localhost as two instances, this is now under test.
352
+ * 1.1.13 - Disable the use of ipv6. It produces random timeouts on the onrender server we are using for the web compiler.
353
+ * 1.1.12 - By default, fastled will default to the web compiler. `--localhost` to either attach to an existing server launched with `--server` or else one will be created automatically and launched.
354
+ * 1.1.11 - Dev improvement: FastLED src code volume mapped into docker will just in time update without having to manually trigger it.
355
+ * 1.1.10 - Swap large assets with embedded placeholders. This helps video sketches upload and compile instantly. Assets are re-added on after compile artifacts are returned.
356
+ * 1.1.9 - Remove auto server and instead tell the user corrective action to take.
357
+ * 1.1.8 - Program now knows it's own version which will be displayed with help file. Use `--version` to get it directly.
358
+ * 1.1.7 - Sketch cache re-enabled, but selectively invalidated on cpp/h updates. Cleaned up deprecated args. Fixed double thread running for containers that was causing slowdown.
359
+ * 1.1.6 - Use the fast src volume map allow quick updates to fastled when developing on the source code.
360
+ * 1.1.5 - Filter out hidden files and directories from being included in the sketch archive sent to the compiler.
361
+ * 1.1.4 - Fix regression introduced by testing out ipv4/ipv6 connections from a thread pool.
362
+ * 1.1.3 - Live editing of *.h and *.cpp files is now possible. Sketch cache will be disabled in this mode.
363
+ * 1.1.2 - `--server` will now volume map fastled src directory if it detects this. This was also implemented on the docker side.
364
+ * 1.1.1 - `--interactive` is now supported to debug the container. Volume maps and better compatibilty with ipv4/v6 by concurrent connection finding.
365
+ * 1.1.0 - Use `fastled` as the command for the wasm compiler.
366
+ * 1.0.17 - Pulls updates when necessary. Removed dependency on keyring.
367
+ * 1.0.16 - `fastled-wasm` package name has been changed to `fled`
368
+ * 1.0.15 - `fled` is an alias of `fastled-wasm` and will eventually replace it. `--web-host` was folded into `--web`, which if unspecified will attempt to run a local docker server and fallback to the cloud server if that fails. Specifying `--web` with no arguments will default to the cloud server while an argument (like `localhost`) will cause it to bind to that already running server for compilation.
369
+ * 1.0.14 - For non significant changes (comments, whitespace) in C++/ino/*.h files, compilation is skipped. This significantly reduces load on the server and prevents unnecessary local client browser refreshes.
370
+ * 1.0.13 - Increase speed of local compiles by running the server version of the compiler so it can keep it's cache and not have to pay docker startup costs because now it's a persistant server until exit.
371
+ * 1.0.12 - Added suppport for compile modes. Pass in `--release`, `--quick`, `--debug` for different compile options. We also support `--profile` to profile the build process.
372
+ * 1.0.11 - `--web` compile will automatically be enabled if the local build using docker fails.
373
+ * 1.0.10 - Watching files is now available for `--web`
374
+ * 1.0.9 - Enabled web compile. Access it with `--web` or `--web-host`
375
+ * 1.0.8 - Allow more than one fastled-wasm browser instances to co-exist by searching for unused ports after 8081.
376
+ * 1.0.7 - Docker multi image build implemented, tool now points to new docker image compile.
377
+ * 1.0.6 - Removed `--no-open` and `--watch`, `--watch` is now assumed unless `--just-compile` is used.
378
+ * 1.0.5 - Implemented `--update` to update the compiler image from the docker registry.
379
+ * 1.0.4 - Implemented `--watch` which will watch for changes and then re-launch the compilation step.
380
+ * 1.0.3 - Integrated `live-server` to launch when available.
381
+ * 1.0.2 - Small bug with new installs.
382
+ * 1.0.1 - Re-use is no longer the default, due to problems.
383
+ * 1.0.0 - Initial release.
384
+
385
+
386
+ # TODO
387
+ * `live-server --https --cert=localhost.pem --key=localhost-key.pem --port=5500`
388
+ * `live-server --port=8416 --host=localhost . --https --cert=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost-key.pem --key=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost.pem --no-browser`
389
+
390
+
391
+
392
+ live-server --https --port=8416 --host=localhost . --cert=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost-key.pem --key=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost.pem --no-browser
393
+
394
+
395
+ live-server --https --cert=src/fastled/assets/localhost.pem --key=src/fastled/assets/localhost-key.pem --port=5500
396
+
397
+
398
+ ## Performance
399
+
400
+ ```
401
+ ###############################
402
+ # Build started with command: #
403
+ # pio run -v #
404
+ ###############################
405
+
406
+ 0.41 Warning! Ignore unknown configuration option `build_dir` in section [env:wasm]
407
+ 0.41 Warning! Ignore unknown configuration option `force_verbose` in section [env:wasm]
408
+ 0.41 Processing wasm (platform: native; extra_scripts: post:wasm_compiler_flags.py; lib_compat_mode: off; build_flags: -std=c++17, -DFASTLED_NO_PINMAP, -DHAS_HARDWARE_PIN_SUPPORT, -DFASTLED_FORCE_SOFTWARE_SPI, -I/js/src/platforms/wasm/compiler; custom_wasm_export_name: fastled; lib_deps: FastLED=symlink://fastled; build_dir: build/wasm; force_verbose: yes)
409
+ 0.41 --------------------------------------------------------------------------------
410
+ 0.99 LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
411
+ 0.99 LDF Modes: Finder ~ chain, Compatibility ~ off
412
+ 0.99 Found 1 compatible libraries
413
+ 0.99 Scanning dependencies...
414
+ 1.40 Dependency Graph
415
+ 1.40 |-- FastLED @ 3.9.16 (License: MIT, Path: /js/fastled)
416
+ 1.49 Building in release mode
417
+ 1.49
418
+ 1.49 #########################
419
+ 1.49 # C++/C Compiler Flags: #
420
+ 1.49 #########################
421
+ 1.49
422
+ 1.49 CC/CXX flags:
423
+ 1.49 -DFASTLED_ENGINE_EVENTS_MAX_LISTENERS=50
424
+ 1.49 -DFASTLED_FORCE_NAMESPACE=1
425
+ 1.49 -DFASTLED_USE_PROGMEM=0
426
+ 1.49 -O1
427
+ 1.49 -DUSE_OFFSET_CONVERTER=0
428
+ 1.49 -std=gnu++17
429
+ 1.49 -fpermissive
430
+ 1.49 -Wno-constant-logical-operand
431
+ 1.49 -Wnon-c-typedef-for-linkage
432
+ 1.49 -Werror=bad-function-cast
433
+ 1.49 -Werror=cast-function-type
434
+ 1.49 -I
435
+ 1.49 src
436
+ 1.49 -I/js/src/platforms/wasm/compiler
437
+ 1.49
438
+ 1.49 #################
439
+ 1.49 # Linker Flags: #
440
+ 1.49 #################
441
+ 1.49
442
+ 1.49 --bind
443
+ 1.49 -fuse-ld=lld
444
+ 1.49 -sWASM=1
445
+ 1.49 -sALLOW_MEMORY_GROWTH=1
446
+ 1.49 -sINITIAL_MEMORY=134217728
447
+ 1.49 -sEXPORTED_RUNTIME_METHODS=['ccall','cwrap','stringToUTF8','lengthBytesUTF8']
448
+ 1.49 -sEXPORTED_FUNCTIONS=['_malloc','_free','_extern_setup','_extern_loop','_fastled_declare_files']
449
+ 1.49 --no-entry
450
+ 1.49 -sERROR_ON_WASM_CHANGES_AFTER_LINK
451
+ 1.49 -sMODULARIZE=1
452
+ 1.49 -sEXPORT_NAME=fastled
453
+ 1.49 -o
454
+ 1.49 /js/.pio/build/wasm/fastled.js
455
+ 1.49
456
+ 1.49 ##########################
457
+ 1.49 # FastLED Library Flags: #
458
+ 1.49 ##########################
459
+ 1.49
460
+ 1.49 --bind
461
+ 1.49 -Wl,--whole-archive,-fuse-ld=lld
462
+ 1.49 -Werror=bad-function-cast
463
+ 1.49 -Werror=cast-function-type
464
+ 1.49
465
+ 1.49 ################
466
+ 1.49 # End of Flags #
467
+ 1.49 ################
468
+ 1.49
469
+ 2.20 ccache em++ -o .pio/build/wasm/program --bind -fuse-ld=lld -sWASM=1 -sALLOW_MEMORY_GROWTH=1 -sINITIAL_MEMORY=134217728 -sEXPORTED_RUNTIME_METHODS=['ccall','cwrap','stringToUTF8','lengthBytesUTF8'] -sEXPORTED_FUNCTIONS=['_malloc','_free','_extern_setup','_extern_loop','_fastled_declare_files'] --no-entry -sERROR_ON_WASM_CHANGES_AFTER_LINK -sMODULARIZE=1 -sEXPORT_NAME=fastled -o /js/.pio/build/wasm/fastled.js .pio/build/wasm/libbb9/fastled/FastLED.o .pio/build/wasm/libbb9/fastled/bitswap.o .pio/build/wasm/libbb9/fastled/cled_controller.o .pio/build/wasm/libbb9/fastled/colorpalettes.o .pio/build/wasm/libbb9/fastled/crgb.o .pio/build/wasm/libbb9/fastled/fl/allocator.o .pio/build/wasm/libbb9/fastled/fl/audio.o .pio/build/wasm/libbb9/fastled/fl/bilinear_expansion.o .pio/build/wasm/libbb9/fastled/fl/blur.o .pio/build/wasm/libbb9/fastled/fl/bytestreammemory.o .pio/build/wasm/libbb9/fastled/fl/colorutils.o .pio/build/wasm/libbb9/fastled/fl/downscale.o .pio/build/wasm/libbb9/fastled/fl/engine_events.o .pio/build/wasm/libbb9/fastled/fl/fft.o .pio/build/wasm/libbb9/fastled/fl/fft_impl.o .pio/build/wasm/libbb9/fastled/fl/file_system.o .pio/build/wasm/libbb9/fastled/fl/fill.o .pio/build/wasm/libbb9/fastled/fl/five_bit_hd_gamma.o .pio/build/wasm/libbb9/fastled/fl/gradient.o .pio/build/wasm/libbb9/fastled/fl/json.o .pio/build/wasm/libbb9/fastled/fl/leds.o .pio/build/wasm/libbb9/fastled/fl/line_simplification.o .pio/build/wasm/libbb9/fastled/fl/noise_woryley.o .pio/build/wasm/libbb9/fastled/fl/ptr.o .pio/build/wasm/libbb9/fastled/fl/raster_sparse.o .pio/build/wasm/libbb9/fastled/fl/rectangular_draw_buffer.o .pio/build/wasm/libbb9/fastled/fl/screenmap.o .pio/build/wasm/libbb9/fastled/fl/sin32.o .pio/build/wasm/libbb9/fastled/fl/str.o .pio/build/wasm/libbb9/fastled/fl/strstream.o .pio/build/wasm/libbb9/fastled/fl/stub_main.o .pio/build/wasm/libbb9/fastled/fl/tile2x2.o .pio/build/wasm/libbb9/fastled/fl/time_alpha.o .pio/build/wasm/libbb9/fastled/fl/transform.o .pio/build/wasm/libbb9/fastled/fl/type_traits.o .pio/build/wasm/libbb9/fastled/fl/ui.o .pio/build/wasm/libbb9/fastled/fl/wave_simulation.o .pio/build/wasm/libbb9/fastled/fl/wave_simulation_real.o .pio/build/wasm/libbb9/fastled/fl/xmap.o .pio/build/wasm/libbb9/fastled/fl/xymap.o .pio/build/wasm/libbb9/fastled/fl/xypath.o .pio/build/wasm/libbb9/fastled/fl/xypath_impls.o .pio/build/wasm/libbb9/fastled/fl/xypath_renderer.o .pio/build/wasm/libbb9/fastled/fx/2d/blend.o .pio/build/wasm/libbb9/fastled/fx/2d/noisepalette.o .pio/build/wasm/libbb9/fastled/fx/2d/scale_up.o .pio/build/wasm/libbb9/fastled/fx/2d/wave.o .pio/build/wasm/libbb9/fastled/fx/frame.o .pio/build/wasm/libbb9/fastled/fx/fx_engine.o .pio/build/wasm/libbb9/fastled/fx/time.o .pio/build/wasm/libbb9/fastled/fx/video.o .pio/build/wasm/libbb9/fastled/fx/video/frame_interpolator.o .pio/build/wasm/libbb9/fastled/fx/video/frame_tracker.o .pio/build/wasm/libbb9/fastled/fx/video/pixel_stream.o .pio/build/wasm/libbb9/fastled/fx/video/video_impl.o .pio/build/wasm/libbb9/fastled/hsv2rgb.o .pio/build/wasm/libbb9/fastled/lib8tion.o .pio/build/wasm/libbb9/fastled/noise.o .pio/build/wasm/libbb9/fastled/platforms.o .pio/build/wasm/libbb9/fastled/platforms/arm/k20/clockless_objectfled.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/clockless_i2s_esp32s3.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/i2s/i2s_esp32dev.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/rmt_4/idf4_rmt.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/rmt_4/idf4_rmt_impl.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/rmt_5/idf5_rmt.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/rmt_5/strip_rmt.o .pio/build/wasm/libbb9/fastled/platforms/esp/32/spi_ws2812/strip_spi.o .pio/build/wasm/libbb9/fastled/platforms/wasm/active_strip_data.o .pio/build/wasm/libbb9/fastled/platforms/wasm/compiler/Arduino.o .pio/build/wasm/libbb9/fastled/platforms/wasm/engine_listener.o .pio/build/wasm/libbb9/fastled/platforms/wasm/fs_wasm.o .pio/build/wasm/libbb9/fastled/platforms/wasm/js.o .pio/build/wasm/libbb9/fastled/platforms/wasm/timer.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/audio.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/button.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/checkbox.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/description.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/number_field.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/slider.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/title.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/ui_internal.o .pio/build/wasm/libbb9/fastled/platforms/wasm/ui/ui_manager.o .pio/build/wasm/libbb9/fastled/power_mgt.o .pio/build/wasm/libbb9/fastled/rgbw.o .pio/build/wasm/libbb9/fastled/sensors/digital_pin.o .pio/build/wasm/libbb9/fastled/sensors/pir.o .pio/build/wasm/libbb9/fastled/simplex.o .pio/build/wasm/libbb9/fastled/third_party/cq_kernel/cq_kernel.o .pio/build/wasm/libbb9/fastled/third_party/cq_kernel/kiss_fft.o .pio/build/wasm/libbb9/fastled/third_party/cq_kernel/kiss_fftr.o .pio/build/wasm/libbb9/fastled/third_party/espressif/led_strip/src/led_strip_api.o .pio/build/wasm/libbb9/fastled/third_party/espressif/led_strip/src/led_strip_rmt_dev.o .pio/build/wasm/libbb9/fastled/third_party/espressif/led_strip/src/led_strip_rmt_encoder.o .pio/build/wasm/libbb9/fastled/third_party/espressif/led_strip/src/led_strip_spi_dev.o .pio/build/wasm/libbb9/fastled/third_party/object_fled/src/OjectFLED.o .pio/build/wasm/libbb9/fastled/transpose8x1_noinline.o .pio/build/wasm/libbb9/fastled/wiring.o .pio/build/wasm/src/wasm.ino.o -L.pio/build/wasm
470
+ 3.61 ========================= [SUCCESS] Took 3.20 seconds =========================
471
+ ```