Closed yeroc closed 7 years ago
It would be nice to keep backward compatibility if possible. Really Util._addEsriLoadHandler() and Util. _addRequiredPackage() are the only two functions with any dojo.require() code. Can we just version check and switch which loader is used based on version? Would you see any issues with this? I'd like to keep the public method definitions the same regardless.
I'm not sure. I don't have a simple stripped-down example to test from at this point, but I haven't been able to get the dojo.require()
style to work for me. I'm not sure if this is due to me using the xsiframe linker with super-dev mode in GWT 2.7 which doesn't support <script>
tags in module files, as a result I've been using ScriptInjector
to inject the ESRI JS. I wasn't able to get it to work by loading the JS via <script>
tag in my host page either.
BTW, the AMD style works with v3.4. At least with my (limited) testing.
Let's try to get a simple stripped down example and see what's needed. As for the super-dev mode, ya... proly need to document that. I have, in the past, created two module files in my main project. One using the xsiframe linker and pointing at a html file with all scripts included in the file for coding/dev. The other module is for building, uses the xs linker (cross-site.. compile to .js files), includes the script tags and points at a html w/o any script tags. Not ideal, but once setup, is a fast workflow. Please suggest newer documentation if/when you find a better way!
ESRI still supports the legacy
dojo.require()
way of loading dependencies but it's clear the way forward is to use AMD instead.@jrmerz what are your thoughts on switching over to the AMD style of loading dependencies? How far back are you wanting to maintain compatibility? All the way back to v3.4?