Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joshtynjala/openfl-genes-sample
A sample OpenFL project that uses the Genes library to generate ES Modules instead of plain JS
https://github.com/joshtynjala/openfl-genes-sample
es-modules haxe openfl openfl-samples
Last synced: about 2 months ago
JSON representation
A sample OpenFL project that uses the Genes library to generate ES Modules instead of plain JS
- Host: GitHub
- URL: https://github.com/joshtynjala/openfl-genes-sample
- Owner: joshtynjala
- Created: 2022-02-11T19:12:02.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-16T22:15:10.000Z (about 1 year ago)
- Last Synced: 2024-10-30T08:26:04.618Z (3 months ago)
- Topics: es-modules, haxe, openfl, openfl-samples
- Language: HTML
- Homepage:
- Size: 19.5 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# Compile OpenFL with Genes Sample
Compiles an [OpenFL](https://openfl.org/) project using the [Genes](https://lib.haxe.org/p/genes) library. When a button is clicked, a new module is loaded from the server at runtime.
Genes modifies the behavior of the Haxe compiler to split the generated JavaScript into modern [modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), instead of a single monolithic bundle. This makes it easier to integrate Haxe projects with other tooling from the JavaScript ecosystem.
Sample created by [Josh Tynjala](https://twitter.com/joshtynjala), the author of [Feathers UI](https://feathersui.com/).
## Usage
Add the [genes](https://lib.haxe.org/p/genes) Haxelib to your _project.xml_ file:
```xml
```
Copy the _templates_ directory from this repository to your project. Then, add the following element to your _project.xml_ file:
```xml
```
That's it! You don't need to do anything special to build and run.
```sh
openfl test html5 -debug
```### Bundlers
To use a bundler with the JavaScript modules generated with Genes, check out the following projects.
- [webpack-openfl-loader](https://github.com/feathersui/webpack-openfl-loader)
- [vite-plugin-openfl](https://github.com/feathersui/vite-plugin-openfl)## Requirements
- Genes 0.4.4 or newer
- Lime 8.0.0 or newer## Credits
Sample created by [Josh Tynjala](https://github.com/sponsors/joshtynjala), the author of [Feathers UI](https://feathersui.com/) and core contributor to [OpenFL](https://openfl.org/).