All Projects → elsassph → Haxe Modular

elsassph / Haxe Modular

Haxe-JS code splitting, NPM dependencies bundling, hot-reload

Programming Languages

javascript
184084 projects - #8 most used programming language
haxe
709 projects

Projects that are alternatives of or similar to Haxe Modular

Vueniverse
Full stack, user based, PWA, Vue template.
Stars: ✭ 339 (+205.41%)
Mutual labels:  code-splitting
Redux Dynamic Modules
Modularize Redux by dynamically loading reducers and middlewares.
Stars: ✭ 874 (+687.39%)
Mutual labels:  code-splitting
Hapi React Hot Loader Example
Simple React Hot Loading example with Hapi Server-side rendering
Stars: ✭ 44 (-60.36%)
Mutual labels:  code-splitting
Async Reactor
Render async Stateless Functional Components in React
Stars: ✭ 452 (+307.21%)
Mutual labels:  code-splitting
Webpackery
Webpack 4 Orchestration Layer allows for automated async code splitting of anything
Stars: ✭ 26 (-76.58%)
Mutual labels:  code-splitting
Hr4r
Example project - "Hot Reloading 4 RequireJS" front-end web applications & some extra code demonstrating hot-reloading for Node.js Express servers
Stars: ✭ 28 (-74.77%)
Mutual labels:  code-splitting
React Loadable
⏳ A higher order component for loading components with promises.
Stars: ✭ 16,238 (+14528.83%)
Mutual labels:  code-splitting
Reason Loadable
🔥 Suspense/Lazy for ReasonReact.
Stars: ✭ 88 (-20.72%)
Mutual labels:  code-splitting
Preact Lazy Route
Lazy load preact route components
Stars: ✭ 12 (-89.19%)
Mutual labels:  code-splitting
Typescript Hapi React Hot Loader Example
Simple TypeScript React Hot Loading example with Hapi Server-side rendering
Stars: ✭ 44 (-60.36%)
Mutual labels:  code-splitting
React Imported Component
✂️📦Bundler-independent solution for SSR-friendly code-splitting
Stars: ✭ 525 (+372.97%)
Mutual labels:  code-splitting
Loadable Components
The recommended Code Splitting library for React ✂️✨
Stars: ✭ 6,194 (+5480.18%)
Mutual labels:  code-splitting
Express React Boilerplate
🚀🚀🚀 This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: ✭ 32 (-71.17%)
Mutual labels:  code-splitting
React Router Server
Server Side Rendering library for React Router v4.
Stars: ✭ 443 (+299.1%)
Mutual labels:  code-splitting
React Boilerplate
Production-ready boilerplate for building universal web apps with React and Redux
Stars: ✭ 53 (-52.25%)
Mutual labels:  code-splitting
React Component Library
A project skeleton to get your very own React Component Library up and running using Rollup, Typescript, SASS + Storybook
Stars: ✭ 313 (+181.98%)
Mutual labels:  code-splitting
That React App You Want
That react app you always wanted: [email protected], [email protected], postCSS, purifycss, dll's and code splitting examples, bregh. Highly opinionated but you better like it.
Stars: ✭ 27 (-75.68%)
Mutual labels:  code-splitting
React Async Component
Resolve components asynchronously, with support for code splitting and advanced server side rendering use cases.
Stars: ✭ 1,441 (+1198.2%)
Mutual labels:  code-splitting
React Router Animation Examples
An example using React Router and React's Animations
Stars: ✭ 80 (-27.93%)
Mutual labels:  code-splitting
Redux Json Router
Declarative, Redux-first routing for React/Redux browser applications.
Stars: ✭ 37 (-66.67%)
Mutual labels:  code-splitting

Haxe Modular

TravisCI Build Status Haxelib Version npm Version Downloads Join the chat at https://gitter.im/haxe-react/haxe-modular

Code splitting and hot-reload for Haxe JavaScript applications.

Why?

If you use Haxe for JavaScript, directly or indirectly (React, OpenFl,...), then you probably want to:

  • make your web app load instantly,
  • make your HTML5 game load quicker,
  • load sections / features / mini-games on-demand.

Haxe has an excellent, compact and optimised JS output, but it's always a single file; even with good minification / gzip compression it can be a large payload.

Modular can split gigantic Haxe-JS outputs into load-on-demand features, without size/speed overhead, and without losing sourcemaps.

How?

import MyClass;
...
load(MyClass).then(function(_) {
	var c = new MyClass();
});

The approach is to reference one class asynchronously in your code:

  • at compile time, the dependency graph of the class is built and one additional JS file will be emitted (bundling this class and all its dependencies),
  • at run time, when the aynchronous reference is evaluated, the additional JS is loaded (once) automatically.

Where to start?

There are 2 ways to use Haxe Modular, depending on your project/toolchain/goals:

  1. standalone Modular; zero dependencies, for any Haxe-JS project,
  2. Webpack Haxe Loader; leverage the famous JS toolchain.

In both cases, it is advisable to read about the technical details:

What is the difference?

Both solutions:

  • use Modular splitting under the hood,
  • split automatically using a single hxml build configuration,
  • support NPM dependencies,
  • allow hot-reloading of code.

What should I use?

  1. Standalone Modular is an easy, drop-in, addition to a regular Haxe JS build process - it is very lightweight and unobstrusive, and you don't need to learn Webpack.

    Using NPM modules however requires a bit of ceremony: all the NPM dependencies have to be gathered (manually) in a libs.js which is loaded upfront.

  2. Webpack Haxe Loader is a more powerful setup but you'll have to learn Webpack. Webpack is a complex and large system offering vast possibilities from the JS ecosystem.

FAQ

Q: Where can I get more help? I have questions / issues...

Q: Is it only for React projects?

  • Of course not; anything targeting JavaScript can use it.
  • However it does offer React-specific additional features for code hot-reloading.

Q: Is it possible to minify the code?

Q: Can I extract a library/package from my code?

  • Yes: you can split libraries, but for technical reasons, extracting a library (e.g. many classes used across the application) has some limitations.

Q: Can I still use the includeFile macro to inject JS code in the output?

  • Yes, but only when the code is inserted at the top of the file; this is the default position when using --macro includeFile('my-lib.js').

Q: Does it support Haxe 4's ES6 output? (-D js-es=6)

  • Yes since 0.12.0
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].