Skip to content

Conversation

@Bashamega
Copy link
Contributor

Bashamega and others added 4 commits June 21, 2025 09:57
- Introduced new types in "addedTypes.kdl", including mixins, enums, and interfaces relevant to web APIs.
- Removed deprecated types and interfaces from "removedTypes.kdl", streamlining the codebase and ensuring compatibility with current standards.
@github-actions
Copy link
Contributor

github-actions bot commented Jul 1, 2025

Thanks for the PR!

This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged.

@saschanaz
Copy link
Contributor

Err, I was saying that I'd like to add a new topic-separated files in KDL, not converting existing monolithic file to KDL.

@@ -0,0 +1,1650 @@
mixins
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this formatting a mistake? This is pretty unreadable, way worse than described in the linked issue with the braces and so on

@Bashamega
Copy link
Contributor Author

I understand @saschanaz
I am just converting the data for now, and trying to see if it works, when It works I will split them into sub files

@saschanaz
Copy link
Contributor

Sounds good, but let's do it one by one in each PR so that the PR can be reviewed and merged separately!

@saschanaz
Copy link
Contributor

saschanaz commented Jul 1, 2025

(I think we don't need to keep quirks like methods.method in KDL, we can skip that in KDL and convert to the existing JSON format (we'll need such conversion as KDL parse result itself will never be compatible as-is.)

@Bashamega
Copy link
Contributor Author

Hello @saschanaz
Currently, I am working on the read function.
And I found an issue with KDL that I can't find a fix for.
Some arrays only have one item, so KDL doesn't treat it as an array.
How can I make it an array?
I can only come up with one solution, which is when I want an array with one item and another item called, for example, KDLARRAY, and we will drop it when converting.
If you have a better solution, please tell me

@saschanaz
Copy link
Contributor

What arrays are we talking about and what exact result are you getting?

@Bashamega
Copy link
Contributor Author

Bashamega commented Jul 4, 2025

Like this @saschanaz


We are getting:

{
	"param": "options"
}

@saschanaz
Copy link
Contributor

But that's not KDL input?

@saschanaz
Copy link
Contributor

(But I think we can defer the removedTypes part, it just has different form)

@Bashamega
Copy link
Contributor Author

But that's not KDL input?

The input is:

{
	"param": ["options"]
}

The issue is that KDL doesn't understand arrays for one item very well

@saschanaz
Copy link
Contributor

That still doesn't seem like a valid KDL input? Parsing it causes errors.

Again let's skip removedItems for now.

@Bashamega
Copy link
Contributor Author

Bashamega commented Jul 5, 2025

There is the same issue with added types.
KDL:

AbstractWorker {
      events {
        event {
          name "error"
          type "ErrorEvent"
        }
      }
    }

Original JSON:

"AbstractWorker": {
                "events": {
                    "event": [
                        {
                            "name": "error",
                            "type": "ErrorEvent"
                        }
                    ]
                }
            },

KDL to json:

AbstractWorker: { events: { event: { name: 'error', type: 'ErrorEvent' } } },

I could only find on solution, which is using an extra item that is ignored when compiling back the json.
I hope the issues is clear now @saschanaz

@saschanaz
Copy link
Contributor

I think that's a quirk that I don't really want to copy into KDL.

interface-mixin AbstractWorker {
  event {
    name "error"
    type "ErrorEvent"
  }
}

This should be perfectly fine.

@saschanaz
Copy link
Contributor

saschanaz commented Jul 5, 2025

Or go even further.

interface-mixin AbstractWorker {
  event error type="ErrorEvent"
}

@Bashamega
Copy link
Contributor Author

Okay

@Bashamega
Copy link
Contributor Author

I have converted a portion of the file to the format you suggested @saschanaz
Do you think this is the correct format, and I should convert the rest to this?

@Bashamega
Copy link
Contributor Author

Also do you think this is more readable @jakebailey

@saschanaz
Copy link
Contributor

Mostly looks good with a few comments:

  • overrideSignatures should probably a member instead of a property
  • interface-enum should be just enum

I should convert the rest to this?

If you mean the other object types like interface and namespace, then yes.

I think the migration should happen only progressively with topics rather than converting the whole file at once, that's explicitly not a goal.

@Bashamega
Copy link
Contributor Author

I have made sure everything is working in this pr.
I will split it to smaller chunks now.

@Bashamega Bashamega closed this Jul 6, 2025
@Bashamega Bashamega mentioned this pull request Jul 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants