Hello,
I am currently trying to create a new data service using Yeoman, however when I create the data service I am getting significantly different questions than I have previously gotten in the LEAF tutorial and in the LEAF documentation. Do you know whether this is a new feature of LEAF 3.7 or if there’s a way to get back to that type of generator?
Thanks!
Old way:
New Way:
Hi Zachary,
You are correct, with LEAF 3.7 the LEAF Service Generators have undergone changes to reduce code complexity and ultimately improve the generator experience. You can read more about the Service Generators here and we are currently working on updating the LEAF training materials to align with the changes.
You can list all the published generators with:
leafctl generators list-published
If you needed to utilize, for example, the 3.5.1 service generators you could install them with the following command:
leafctl generators add --add-version 3.5.1
Let us know if you have any further questions!
1 Like
I have been trying to run another version than 3.7 by doing yo @leaf-platform/data-service@3.5.1 but I am still getting the same results. Is the only other way to do it by using leafctl?
It sounds like you still need to install the 3.5.1 generators. It’s always recommended you first uninstall any existing LEAF Service Generators:
yarn global remove @leaf-platform/service-generators
Then, if you prefer not to use leafctl you can use yarn to install the 3.5.1 generators:
yarn global add @leaf-platform/service-generators@3.5.1
You should then be able to generate a 3.5.1 data-service with:
yo @leaf-platform/data-service
-Steve
Also just wanted to chime in on choosing versions. 3.5 isn’t an LTS and is a few quarters old now, so it will lose support at the end of 2022. I’d suggest either using the latest long-term support (LTS) release, with the 3.6 release being current LTS, or the latest non-LTS release, 3.7. Read more about LEAF’s release management here.
LTSs are supported for 3 years and generally should be used for products that are deployed or nearing deployment. LEAF puts out one LTS release per year. Products that are earlier on in development should maybe favor latest releases, even non-LTSs like 3.7, to get access to the latest features. And then when nearing deployment, hop to the next LTS once it’s available.
Like @Steven.S.Tidd mentioned, the generators went through a pretty big overhaul in 3.7, and to do so, we skipped a 3.6 release so we could only put out the big improvement once it was ready. If you need to use 3.6, I would suggest using a 3.7 generator and downgrading to 3.6 rather than upgrading from 3.5, as the downgrade is somewhat trivial and still leaves you with the better generated code.
1 Like
Thanks Mark I will try using the 3.7 generator then.
1 Like