Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KDL 1.0 Compliance #6

Closed
zkat opened this issue Sep 12, 2021 · 8 comments
Closed

KDL 1.0 Compliance #6

zkat opened this issue Sep 12, 2021 · 8 comments

Comments

@zkat
Copy link
Member

zkat commented Sep 12, 2021

Hi! Since this was originally written, KDL has stabilized to 1.0.0. No further changes should be made to spec so it should be safe to update + finalize kdljs to the 1.0 spec!

Please let me know if you have any questions or if there's anything I can do to help!

@larsgw
Copy link
Collaborator

larsgw commented Sep 12, 2021

I still wonder whether I should change the parser output to better support value tags, and in the future the query spec. Right now it's just a bunch of objects. Node tags could be another property, value tags could be handled based on user-supplied callbacks (or opt-in defaults) and queries could be loose functions taking the document as an argument. But I could also make classes.

@zkat
Copy link
Member Author

zkat commented Sep 12, 2021

I mean I think as long as you're parsing the spec, it's fine to throw away tags, in general? Though for kdljs itself it might be good to just shove that metadata into a type property?

@larsgw
Copy link
Collaborator

larsgw commented Sep 12, 2021

Maybe valueOf() is good enough to just change to classes and have the API be almost the same? Like, would new Value(10) + 2 work? I haven't used it that much before and maybe it'd just be weird. I guess typeof breaks (or does it use valueOf too?)

@larsgw
Copy link
Collaborator

larsgw commented Sep 12, 2021

How would that look then?

{
  node: 'foo',
  values: [1, 2],
  properties: { foo: 'bar' },
  type: {
    name: 'node-tag',
    values: [null, 'i32'],
    properties: { foo: 'url' }
  }
}

@zkat
Copy link
Member Author

zkat commented Sep 12, 2021

that doesn't look too shabby if you're willing to expose your guts.

It might be nice for kdljs to start supporting stuff through queries, though? And just plain methods instead of just giving you a whole structure?

@larsgw
Copy link
Collaborator

larsgw commented Sep 16, 2021

I released v0.1.0 for now with parsing compliance, I'll deal with query, schema and tag support later.

@larsgw
Copy link
Collaborator

larsgw commented Sep 16, 2021

(v0.1.1 now because I messed up the formatter)

@zkat
Copy link
Member Author

zkat commented Sep 16, 2021

I think that's good enough for me if you want to close this issue! The other stuff can come later :)

@larsgw larsgw closed this as completed Sep 16, 2021
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

No branches or pull requests

2 participants