Code Monkey home page Code Monkey logo

Comments (6)

lizaiv77 avatar lizaiv77 commented on September 24, 2024 1

@0xtr

Is there a goal to make the tooling output usable immediately after generation?
Generator does not know anything about use cases implemented by a component, it does not know how to give meaningful names to elements, what methods it needs etc. So we always assumed that whatever is generated is later adjusted manually or with generator config next to a Page Object, see docs https://utam.dev/tools/generator-content if development pipeline means to generate every time you build code.
We currently explore AI driven generation for Lightning Components, but we first release it internally for our engineers, we do not know yet if/when it will be available outside Salesforce.

from utam-java.

jimevans avatar jimevans commented on September 24, 2024

@0xtr When you say "in the repo, run utam-compile.js," to which repo are you referring? There is no utam-compile.js in this repo that I'm aware of. Also, what is the structure of the JSON file that you are attempting to compile with the UTAM compiler?

It sounds like you're using a generator of some sort to parse the LWC markup into JSON, which is then passed to the JSON compiler. If that's the case, the bug may be in the generator, and not the UTAM compiler. Can you share the information about how you're generating the JSON input?

from utam-java.

lizaiv77 avatar lizaiv77 commented on September 24, 2024

@0xtr
I see what you mean - in generated JSON element name is "failure.id" hence the error as it's not valid.

"elements": [
                {
                    "public": true,
                    "name": "failure.id",

We might fix it sometime, but it's definitely not high on priority list because generated content is usually edited before using it. Please manually replace generated element name to whatever is appropriate, for example to "failureId"

from utam-java.

0xtr avatar 0xtr commented on September 24, 2024

@0xtr When you say "in the repo, run utam-compile.js," to which repo are you referring? There is no utam-compile.js in this repo that I'm aware of. Also, what is the structure of the JSON file that you are attempting to compile with the UTAM compiler?

It sounds like you're using a generator of some sort to parse the LWC markup into JSON, which is then passed to the JSON compiler. If that's the case, the bug may be in the generator, and not the UTAM compiler. Can you share the information about how you're generating the JSON input?

Sorry, poor phrasing by myself there - in the same directory, that should be. I'm running it in one of my company's repos. I'm using the generator from https://www.npmjs.com/package/utam. Unless I've misunderstood the documentation there's no equivalent tooling for generating LWC->JSON that fits into the Java toolchain similarly?

This is the JSON file structure with other unrelated elements removed:

{
    "description": {
        "author": "UTAM generator",
        "text": [
            "Page Object: comp_name"
        ]
    },
    "shadow": {
        "elements": [
            <cut>
            {
                "name": "list",
                "type": [],
                "selector": {
                    "css": "ul"
                },
                "elements": [
                    {
                        "public": true,
                        "name": "listItems",
                        "type": [
                            "actionable",
                            "clickable"
                        ],
                        "selector": {
                            "css": "li",
                            "returnAll": true
                        }
                    },
                    {
                        "public": true,
                        "name": "listItemByIndex",
                        "type": [
                            "actionable",
                            "clickable"
                        ],
                        "selector": {
                            "css": "li:nth-of-type(%d)",
                            "args": [
                                {
                                    "name": "index",
                                    "type": "number"
                                }
                            ]
                        },
                        "elements": [
                            {
                                "public": true,
                                "name": "failure.id",
                                "type": [
                                    "actionable",
                                    "clickable"
                                ],
                                "selector": {
                                    "css": "a"
                                }
                            }
                        ]
                    }
                ]
            },
            <cut>
        ]
    }
}

from utam-java.

0xtr avatar 0xtr commented on September 24, 2024

@0xtr I see what you mean - in generated JSON element name is "failure.id" hence the error as it's not valid.

"elements": [
                {
                    "public": true,
                    "name": "failure.id",

We might fix it sometime, but it's definitely not high on priority list because generated content is usually edited before using it. Please manually replace generated element name to whatever is appropriate, for example to "failureId"

Will do, thank you. Is there a goal to make the tooling output usable immediately after generation? Having to edit the files manually means I am unlikely to update them very often unless something breaks; as an example, in this single repo I have 183 utam.json files generated via the utam npm command, and there are other repos.

from utam-java.

0xtr avatar 0xtr commented on September 24, 2024

@lizaiv77 Good to know, thanks. I'll close this then if the intention is to edit compiler output for now.

from utam-java.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.