I'm trying to get started trying to make a custom module so that I can make custom perspective components. I've watched the Inductive University videos and read the ignition SDK Programmers Guide as well as looking at the examples.
However, with all the extension and inheritance of files I feel I'm more confused than I began. it doesn't look that complicated I just don't feel like I understand the flow of the system. I've been reading through the Javadoc's and that's helped some, but I was hoping someone could help me better grasp the concepts or point me to some helpful information?
is there a way to look at the code for some of the existing components in perspective? are there any repositories that have good examples of custom components? I tried to look at the embr github code from Musson but that was confusing to me as well due to the complexity of it compared to the ignition sdk examples. if it's a complete fever dreams to start with making custom components is there somewhere I should start?
What do you mean by custom props?
Do you mean the properties that are shown for a component in designer, in the property tree?
No, I guess props is the wrong word entirely. I mean the components that are shown in the component pallet in perspective that you can drag onto the page.
Yeah, "props" is very specific concept in Perspective.
Have you checked out IA's example modules?
I also have my own example:
- It's primarily a monorepo example, which makes it more complicated. However, most of the complexity is hidden away in the build conventions and "just works".
- The build process for the
web resources is much simpler (WebPack =
).
yeah, I did look at the example I was unaware of your examples. I've been overlooking it and want to make sure my guestimations are correct, so you need 4 files for defining the component.
#1 the Json file that acts as the properties for the component which is props.json in your example.
#2 the JS or TS that defines the browser side which is the cool-button.tsx in your example.
#3 the module metadata and the set of browser resources that point to the first file after it's been
mounted which is Meta.kt in your example.
#4 the file that creates the Descriptor that is called by the hook to register the component? which is CoolButton.kt in your example
then in your hooks you just have it be registered on startup and removed on shutdown
am i missing something or is that most of the meat and potatoes of it?