Closed green3g closed 7 years ago
I looked at that briefly back before creating this repo, and if I recall, asked @odoe if he had tried it yet, and I think he said he couldn't get it to work.
FYI - I talked to @odoe after you opened this issue a few weeks back, and there was a glimmer in his eye that indicated that there might be something else to try.
If we could get that to work, I'd say it's a better solution than what we're doing here.
That is excellent. I started looking into it, https://gist.github.com/roemhildtg/4dce79f9bffe74b99a6a6cea3f44604f but it gives an error about a plugin having system.register in it. I can't exactly recall the error message though.
I'll try to revisit this. I'll be spending the next couple of weeks working with Angular 2/SystemJS, so I'll try to work this in as well.
Cool. If that works, I assume that would be it's own repo, so I'm going to press ahead w/ a v1 for this lib as that is long overdue.
Coming out the dev conference... any update/progress on this effort? I read someone summarize the problem on twitter as it being about not being able to supply defaultJsExtension prop ANd another property on the systemjs config..
I'm not using Angular these days, and even if I was, I'd be using webpack to bundle my modules. I know that even in webpack apps, SystemJS can be used to lazy load bundles at runtime, but for lazy loading the ArcGIS API and modules, I'd use esri-loader. So I'm not actively working on this these days.
What is your use case? Are you using JSPM?
@tomwayson I'm using npm and stealjs, which is based on SystemJS but lets you load from node_modules.
Steal also transpiles es6 modules on the fly, so ultimately I'd like to do something like this:
import Map from 'esri/map';
// or
import Map from 'esri/map!esriPlugin';
where esriPlugin would be this repository as a system js plugin.
Finally, I have made a systemjs.loader.dojo.js plugin works with Angular v2.4.7 and ArcGIS API for Javascript v4.2, can load ArcGIS API on demand, do not need to load all required modules before the app boot, and there is a demo: ng2-esri-demo
Nice work @beginor!
I tried @beginor's demo app, and it seems to work other than this AoT build issue: https://github.com/beginor/ng2-esri-demo/issues/2
@diegohb and @roemhildtg I suggested you both give his gist (which I believe is based on @roemhildtg's gist above) a try in your own applications.
If the pattern works for you guys, then maybe you guys could work together to create a repository for and publish the plugin.
@tomwayson No, the demo can not build with aot (rollup).
It is just a SystemJS loader plugin, so the demo just works with SystemJS.
Anyone who knows how to build dojo with rollup?
I know how to not build dojo w/ rollup, which is probably the best strategy, and have an example repo. I don't think rollup is your problem (yet). See my comment: https://github.com/beginor/ng2-esri-demo/issues/2#issuecomment-280863333
Regardless of whether or not you choose to try and get the AoT build working, I think it's worthwhile to create a repo for the SystemJS plugin and publish it to make it easier for others to use.
npm package: https://www.npmjs.com/package/systemjs-plugin-dojo github repo: https://github.com/beginor/systemjs-plugin-dojo demo repo: https://github.com/beginor/ng2-esri-demo
Awesome work @beginor!
Would it be possible to convert this to a SystemJS Plugin? That way you could do something like this in your code, and you wouldn't have to pre-register any modules.