Skip to content

feat: Add more document methods for bindings/dom.ts #2336

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

Merged
merged 7 commits into from
Jul 20, 2022

Conversation

MaxGraey
Copy link
Member

@MaxGraey MaxGraey commented Jun 25, 2022

It should be a minimal set for some meaningful DOM manipulations

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@MaxGraey MaxGraey marked this pull request as ready for review June 25, 2022 08:54
@MaxGraey MaxGraey changed the title Add more document methods for bindings/dom.ts feat: Add more document methods for bindings/dom.ts Jun 27, 2022
@MaxGraey MaxGraey merged commit 96599c6 into AssemblyScript:main Jul 20, 2022
@MaxGraey MaxGraey deleted the more-dom-bindings branch July 20, 2022 12:02
@@ -115,6 +115,23 @@ export declare namespace String {
export function fromCodePoints(codepoints: i32[]): externref;
}

export declare namespace Object {
Copy link
Member

@trusktr trusktr Jul 25, 2022

Choose a reason for hiding this comment

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

These bindings only get us so far. We can't do anything with externref results directly in AssemblyScript code. For example, we can't write

const el = document.createElement('div')
el.setAttribute('foo', 'bar')
document.body.append(el)
document.body.lastElementChild === el //true

For this reason, we can't simply say that the loader API is obsolete. Loader API is needed in order to make realistic portable code that compiles to JS (without bindings) or WebAssembly (with bindings).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants