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

feat(runtime): export jsx and jsxs #200

Merged
merged 4 commits into from
May 5, 2024

Conversation

douglasduteil
Copy link

@douglasduteil douglasduteil commented Apr 30, 2024

Exporting jsx and jsxs functions allows @kitajs/html/jsx-runtime to run in tsx

Resolving

$ npx tsx index.tsx
/a/b/c/d/index.tsx:5
    <div class="stuff">
    ^

SyntaxError: The requested module '@kitajs/html/jsx-runtime' does not provide an export named 'jsx'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

# And

SyntaxError: The requested module '@kitajs/html/jsx-runtime' does not provide an export named 'jsxs'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12)

Node.js v20.12.2

Copy link

changeset-bot bot commented Apr 30, 2024

🦋 Changeset detected

Latest commit: bc57187

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@kitajs/html Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@arthurfiorette
Copy link
Member

does this also solves esm import problems?

export jsx and jsxs function allow `@kitajs/html/jsx-runtime` to run in [tsx](https://www.npmjs.com/package/tsx)

Signed-off-by: Douglas Duteil <[email protected]>
Signed-off-by: Douglas Duteil <[email protected]>
Signed-off-by: Douglas Duteil <[email protected]>
Copy link

codecov bot commented May 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (af06ac8) to head (bc57187).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #200   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          457       460    +3     
=========================================
+ Hits           457       460    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arthurfiorette arthurfiorette merged commit d0f51bc into kitajs:master May 5, 2024
8 checks passed
@arthurfiorette
Copy link
Member

thanks!

@arthurfiorette arthurfiorette mentioned this pull request May 5, 2024
@douglasduteil douglasduteil deleted the patch-1 branch May 5, 2024 18:42
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.

2 participants