Updated 031 Automatic import of custom code during compilation in JCB (markdown)

Amigo 2019-07-13 10:18:34 +02:00
parent ee12da5a7e
commit f4a430dfc3
1 changed files with 5 additions and 8 deletions

@ -61,17 +61,14 @@ Now let's go back to the code. It inserted the code in the correct place, moved
[00:11:32](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m32s)
Let's look at inserting. Remember, don't put code close to each other within at least eight lines. So 1, 2, 3, 4, 5, 6, 7, 8. From this line another set may be inserted or another section of code may either be inserted or replaced . [00:11:58](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m58s) The reason is that the fingerprint that it creates above the insertion, is sometimes up to 8 lines long. It could happen that it uses from the selected area(see video) and turn out to be an error when changes are made. It will interpret that this code has also been affected and will not find it. That is one of the limitations that these code insertions that is done either by replacing or inserting a portion of text script, can only be inserted up to eight lines apart. Let's do an insertion over here(see video). It is inserted and a comment placed in. Then save and compile.<<<<<<<<<
Let's look at inserting. Remember, don't put code close to each other within at least eight lines. So 1, 2, 3, 4, 5, 6, 7, 8. From this line another set may be inserted or another section of code may either be inserted or replaced . [00:11:58](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h11m58s) The reason is that the fingerprint that it creates above the insertion, is sometimes up to 8 lines long. It could happen that it uses from the selected area(see video) and turn out to be an error when changes are made. It will interpret that this code has also been affected and will not find it. That is one of the limitations that these code insertions that is done either by replacing or inserting a portion of text script, can only be inserted up to eight lines apart. Let's do an insertion over here(see video). It is inserted and a comment placed in. Then save and compile.
### Checking The Custom Code Tab For New Entry Before New Installation
[00:13:46](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h13m46s)
Before we install it, we can just again go check whether everything was done as expected. Yes the insertion was grabbed. It was added to the database and it is there. [00:14:04](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m04s) It has the hash target, with insertion we only need where it starts not where it ends. And so we can close that. Now simply install that component. Let's go look at the code. It did added the replacement script, change it from replace to replaced. It's added the inserted script from insert to inserted. [00:14:34](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m34s) If you want to make a change to it, we're again just add these diamonds here(<>). Make our change. Save the file of course, and compile. Let's check whether the work was updated. Great it's updated the work in the database. So let's install the component. Let's go look at the code again. Wonderful it's added it back. All seems well. [00:15:18](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m18s)
Before we install it, it is important to check whether everything was done as expected. The insertion has been grabbed and added to the database. [00:14:04](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m04s) It has the hash# target. With insertion we only need where it starts not where it ends and so that can be closed. Now simply install that component. Go look at the code. It did add the replacement script, change it from 'replace' to 'replaced'. It has added the inserted script from 'insert' to 'inserted'. [00:14:34](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h14m34s) If a change need to be made to it, just add these diamonds (<>). Make the change. Save the file and compile. Check whether the work was updated. Install the component. Take a look at the code again. It is added it back. [00:15:18](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m18s)
We are working on another part of this implementation if so for some reason this code above it changes. It will give you a notice on compilation, that there is been a change to the fingerprint and it could not find the insertion area. It will still add the code on the line number, but it will be escaped. So that it doesn't change or hurt any of the code that still there. The same goes with replacement code. [00:15:50](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m50s) Since it is replacing code, it is a little bit more tricky. So we'll still add it into the line, but we will not remove the old code. I'm still going to be working a bit on that. It needs some fine tuning. I would like your feedback if you think there's a better way. I'm always open for ideas. We are very happy to announce that component builder can now automatically extract custom code from your component while in development. [00:16:21](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m21s) We'll add a switch that when your ready to distribute your component, you could simply say you know that it's no longer in production. And then when you compile it, it will actually not add these placeholders anymore. Please give me your comments at Github. There is actually an issue open there called automatic import of custom code during compilation. [00:16:51](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m51s) You'll see that there's quite a few been said. You can simply add your your comments and feedback to this ticket or to issue 37. Since the tutorial be on YouTube possibly by the time you view it, it is closed. You're still welcome to go and make any comments on the closed issue if you like.
If for some reason this code above it changes, there is another part of this implementation that will give a notice on compilation that there has been a change to the fingerprint and it could not find the insertion area. It will still add the code on the line number, but it will be escaped. So that it doesn't change or influence any of the code that still there. The same applies to the replacement code. [00:15:50](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h15m50s) Since it is replacing code, it is a little bit more tricky. So it will still be added into the line, but the old code will not be removed. It needs some fine tuning. Any feedback would be appreciated.
**Component Builder can now automatically extract Custom code from a component while in development.** [00:16:21](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m21s) A switch has been added, that when you are ready to distribute your component, you can say that you are aware that it is no longer in production. When it is compiled, it will not add these placeholders anymore. Please give your comments at Github. [00:16:51](https://www.youtube.com/watch?v=DFMfIl-VkSk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&t=00h16m51s)