KTL - Important KTL structural changes (completed) #35
Pinned
cortexrd
announced in
Announcements
Replies: 1 comment
-
Update, Jun 9, 2023 The transition has been completed successfully for all those who were using the former customization method. If some of you are having issues, let me know: [email protected]. Normand |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Audience concerned
This only affects the KTL users that have copied and customized their own version of the KTL_KnackApp.js file.
Reason
The method I proposed until now in the documentation to copy/modify the file is problematic. I knew it would become more and more challenging to maintain down the road as the original file would evolve over time and require all KTL users to import changes constantly to their modified copy. The risk of getting out of sync and causing crashes is high, and the job very tedious. I have this problem all the time myself. My version of this file in some apps is now at over 5K lines! So imagine what happens when I make a comparison between the two files (500 lines vs 5K lines) - I see hundreds of changed blocks of code that I need to check them one by one. This can take an hour easily, and will only get uglier as time goes on.
So I finally came up with an elegant solution.
On my side
The KTL_KnackApp.js file will be renamed to KTL_Defaults.js because it will better reflect its purpose. This new file will be loaded by KTL_Start.js, but invisible to the user. It will provide the default implementation of all the setups and callbacks to make sure the KTL always has all it needs to work properly. This file will evolve quickly but it's now my job only to keep it in sync.
On the KTL user's side
When a specific need to customize a default function arises, the KTL users will extract (copy/paste) from the KTL_Defaults.js file only what is needed to customize their app. This minimal "cherry picking" allows their own app file (MyApp.js for example) to be kept lean and clean. This file will be much smaller for the KTL portion - like maybe a few tens of lines instead of 500. The remaining vast majority will be your app code.
In your specific case
For all those like you who have been using the current method, you'll need to delete from your existing file all the unmodified and redundant code that is handled by the KLT_Defaults.js file, and add a small piece of code that I'll give you that is the secret sauce! I can assist in doing that cleanup job for you, or we can do it together if you prefer.
This solution provides the perfect decoupling between the two files, while maintaining the Dev and Hybrid modes of development.
Subscribe to get updates
It is strongly recommended that you subscribe to the announcements of this page to get the latest updates. I will soon add a Changelog section to let you know what has been added or changed, so you don't have to read through all the documentation over again.
Normand Defayette
Cortex R&D Inc.
ctrnd.com
Beta Was this translation helpful? Give feedback.
All reactions