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

Missing summary tag #40

Open
believer opened this issue Jul 23, 2023 · 4 comments
Open

Missing summary tag #40

believer opened this issue Jul 23, 2023 · 4 comments

Comments

@believer
Copy link

The summary tag seems to be missing in the intrinsic elements' definition. This is used together with details, which does exist in the definitions.

<details>
    <summary>Custom title for the details element</summary>
    Details that are shown when expanded.
</details>

I can create a PR if the issue is valid. I think there's only a summary: HtmlTag; missing, since the summary tag only includes the global attributes.

Thanks for a great library!

@arthurfiorette
Copy link

Hey @believer, I'm maintaining a fork (https://github.com/kitajs/html) which already has summary support.

This library seems to be unmaintained, (no license, #23, no fragment support...) I'm maintaining @kitajs/html with some extra features I wanted to add, like fragments, more performant, a pre-compiled mode, null/undefined handling, preact (h) build systems compatible and more...

I'm open to creating a PR to this repo if requested.

@believer
Copy link
Author

@arthurfiorette Hey! Thanks for creating your fork, it works great. I had to adjust the getting started steps slightly to get it working (it might be because I'm using Bun?).

The steps are similar to the getting started steps in typed-html:

// tsconfig.json
{
  "compilerOptions": {
    "jsx": "react",
    "jsxFactory": "elements.createElement"
  }
}

// Use in file
import * as elements from '@kitajs/html'

@arthurfiorette
Copy link

arthurfiorette commented Jul 30, 2023

@believer thanks for your heads up! Things should now be fixed at v1.3.1.

P.S: I think you should now be able to go back to the README setup, as the example above will not works with fragments :)

@believer
Copy link
Author

believer commented Jul 31, 2023

@arthurfiorette Thanks for the quick update, but I still can't get it to work. If I only use jsx and reactNamespace in tsconfig.json from the README I get Can't find variable: React when I try to run the app. Adding the optional options makes no difference.

My entire tsconfig, which came from running bun init, looks like:

{
  "compilerOptions": {
    "lib": ["ESNext"],
    "module": "esnext",
    "target": "esnext",
    "moduleResolution": "bundler",
    "moduleDetection": "force",
    "allowImportingTsExtensions": true,
    "strict": true,
    "downlevelIteration": true,
    "skipLibCheck": true,
    "jsx": "react",
    "reactNamespace": "html",
    "allowSyntheticDefaultImports": true,
    "forceConsistentCasingInFileNames": true,
    "allowJs": true,
    "noEmit": true,
    "types": [
      "bun-types" // add Bun global
    ]
  }
}

Maybe there's some other option here that's conflicting?


Edit: Ok, it worked with:

// tsconfig.json
{
	"compilerOptions": {
	    "jsx": "react",
	    "reactNamespace": "elements",
	    "jsxFactory": "elements.createElement",
	    "jsxFragmentFactory": "elements.Fragment",
	}
}

// Use in file
import elements from '@kitajs/html'

But not if I call it html or remove jsxFactory/jsxFragmentFactory 😅

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