I have some small Canjs projects using old Steal.
I want to switch to new Steal now (and ultimately to the DoneJS envireonment).
Before I bother you with detailed questions, I have some general ones:
- Are there any migration tips other than this:
I have problems to load the modules or files in the old places.
- Is it to early to switch to DoneJS?
I have tested one demo install donejs-chat.
But what is the best way to migrate my old projects?
I try to migrate an old CanJS/Steal project to use the new steal.
This was my old folder structure:
I installed steal and jquery with npm in this structure.
I tried different settings in package.json and stealconfig.js and without any at all. But it did not work out.
What are the settings I have to use in stealconfig.js oder package.json in order to be able to load my old canjs-stuff and the old modules?
In order to reduce everything to the basics I made another test app with the following structure.
stealconfig.js is loaded.
But no matter what I do (with “map” and “path”) steal always tries to load jquery from:
I feel that I am on the wrong track here somewhere.
Do you have any idea where I might getting wrong?
The code works if I write this in myapp.js:
import $ from “jquery”;
$(’#eingabe’).html(“das ist gut”);
So it must be something missing to load dependencies the old steal way, right?
What does your stealconfig.js look like? Upgrading shouldn’t be too hard. The hardest part is if you are using a lot of
I made a very simple setup. So to test first. So there are no .thens or anything strange…
With this import:
import $ from “jquery”;
the stealconfig works like this:
or like this:
But if I try to steal like this:
it does not work.
steal tries to load jquery from:
You also want to add a map for jquery like:
If you switch to another format like CommonJS you wouldn’t need this map, it’s only needed for when you do:
I did try several map and paths variations. But I must have combined them wrongly.
It loads jquery now in my small test. But if I try to apply it to my old project, I still get a strange behavior:
A dozen of js-files are loaded. It guess nothing is missing.
However, no js is executed? I get no error in the console (and also no steal.dev.log’s).
I tried so many different settings or setups. To be honest I am a bit at a loss where to start really…
Your old project might have something like:
Get rid of the
* (flatten this config) and also get rid of the
.js on both sides. Same for paths, except leave the
.js on the right side in that case.
Otherwise can’t help without more specific details. If this is a project for your company know that we do consulting, so you might be able to hire us to help you upgrade if that’s needed.