Comments (11)
I'm currently using systemjs-builder
through cbuild
to bundle systemjs-hot-reloader
(the version in your PR that's not merged yet). The script is here (bundle-reloader
) and the resulting bundle is here with a corresponding autogenerated config.js
.
cbuild
is basically a wrapper around systemjs-builder
that finds packages installed using npm
. It attaches to the builder's normalize
hook so any missing files are looked up using browser-resolve
and if found, reported to the builder so it bundles them and added to config.js
so SystemJS knows how to transform their paths also at run-time.
I think it works nicely at the moment. With a prebuilt bundle, Babel is then not needed for developing with hot reloading.
from systemjs-hmr.
cbuild is really interesting. I've been wanting to build a very similar thing for a few weeks now. And I'd really like to speak to you about a bit of possible collaboration. I've sent you a PM on gitter.
With regards to using it here, I still want to babel/rollup, for the following reasons.
- I'm not wanting to bundle a bunch of external deps. Just some simple code splitting in the project.
- I don't particularly want to have the module exporting a
System.register
api - I want to make use of babel transforms here
- Rollup is the simplest way I know how to do what I want
cbuild for me feels like it would be better suited to bundling at the application level
from systemjs-hmr.
Yes, it's meant for app level and bundling the reloader was basically a free side effect. If there's a way to create a more minimalistic bundle and with fewer tools, that would be better. systemjs-builder
is a bit bloated IMO (depends on Babel and Traceur) but for bigger apps I can't think of an alternative that would play as nicely with SystemJS at run-time.
from systemjs-hmr.
I think actually that the best way to build this will be with systemjs-builder
don't know why I didn't think of this before
from systemjs-hmr.
I'm experimenting with using jspm bundle in conjunction with systemjs-hmr & systemjs-hot-reloader. It feels like it shouldn't take much changes, but I haven't gotten it working yet.
from systemjs-hmr.
Does it complain that it can't find @hot
?
from systemjs-hmr.
If so, add '@hot': {'build': false}
to your meta
in your config
from systemjs-hmr.
Ah, I don't have a build config yet as I am still using the CLI, "jspm bundle". I did "jspm bundle client/**/* - [systemjs-hmr]" and it worked (I'm still on [email protected]).
The way I have it working now seems nice. With everything besides systemjs-hmr in the bundle, initial load is fast, and the hot reload works on individual files so I can see changes immediately and keep my state. Still trying to muddle through more issues though (currently having trouble with hot reload getting bugged out once I rebuild the bundle). Ideally I'll have "jspm bundle --watch" going so that I don't have to deal with stale bundled code later when doing a full refresh.
from systemjs-hmr.
@mavericken the beta version of jspm
supports this, it has a --watch flag.
Before trying this be aware that it uses a slightly different config. Install it by npm install jspm@beta
.
More info: jspm.io/0.17-beta-guide/
from systemjs-hmr.
I am using the --watch flag. Current problem is that as soon as the bundle.js changes, hot reload breaks completely. It seems I can rather easily work around it by just filtering out bundle.js changes, but trying to figure out the actual problem.
Edit: I figured it out that bug, fix pull request available here: #13
from systemjs-hmr.
Bundling via rollup
from systemjs-hmr.
Related Issues (20)
- Better Error Handling HOT 1
- Preemptive File Loading HOT 6
- Deleting old source maps HOT 4
- Add debounce
- Next Major (systemjs-hmr and systems-hot-reloader) HOT 6
- TypeError: Object.values is not a function HOT 4
- parentKey.indexOf is not a function HOT 5
- TypeError: Cannot read property '__reload' of undefined HOT 1
- reload deps children HOT 4
- Display err.originalErr HOT 2
- The systemjs-hmr polyfill must be loading after SystemJS has loaded HOT 8
- Every other hot reload fails with browser exception HOT 12
- New release 2.0.10 HOT 1
- systemjs-hmr is searching for Maintainers!
- script errors on load? HOT 3
- SystemJS 0.21.X HOT 2
- __unload function and AMD HOT 3
- Support SystemJS >= 2.0.0
- Rollup and import { module } from '@hot' HOT 1
- Question with @hot HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from systemjs-hmr.