Skip to content

Add support for JSR#973

Open
okikio wants to merge 46 commits into
solidjs-community:nextfrom
okikio:jsr-support-next
Open

Add support for JSR#973
okikio wants to merge 46 commits into
solidjs-community:nextfrom
okikio:jsr-support-next

Conversation

@okikio

@okikio okikio commented Jul 6, 2026

Copy link
Copy Markdown
  • Adds deno.jsonc files

    let's us take advantage of Deno's support for workspaces, makes publishing easier

  • Added allowImportingTsExtensions & noEmit to root tsconfig.json

    JSR requires ts files to use .ts & typescript only allows .ts files if you disable ts emitting files

  • Simplified the tsconfig.json for packages, leaving only src & extends in each packages tsconfig.json

    composite: true, references: [], etc... tsconfig options error out when noEmit: true at the root

  • Added return types & fix other type errors where possible

    JSR strongly dislikes missing return types & ambient global declaration they count as slow types and to avoid slowing down the end users machine will strongly enforce explicit returns
    I couldn't quite get rid of ambient global declarations but I did use --allow-slow-types as an escape hatch for said packages

  • Switch build setup to use tsdown, it covers most of the same usecases as the existing scripts/build.ts

    with noEmit: true on the root tsconfig.json the scripts/build.ts breaks as tsc -b no longer works, so reconfiguring the build script was necessary

  • Added jsr gh actions

    I've tested the publish process locally but we'd likely need to test it as part of a CI pipeline tbh

Closes #726

Copilot AI review requested due to automatic review settings July 6, 2026 07:23
@changeset-bot

changeset-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6cb540f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 582af0a4-ce12-4eb6-9a13-79e8c44ea02d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@thetarnav thetarnav reopened this Jul 6, 2026
@thetarnav

Copy link
Copy Markdown
Member

Switch build setup to use tsdown, it covers most of the same usecases as the existing scripts/build.ts

Using tsc -b + esbuild for few jsx transforms from a single script was to have a single build process for building all packages at once.
It makes the build lightweight and fast, ~4s or instant when cached.
Building all ~80 packages with a separate build process for each is very slow and cpu/memory intensive. It makes the ci take minutes instead of seconds.

@okikio

okikio commented Jul 6, 2026

Copy link
Copy Markdown
Author

tsdown does actually support this exact functionality, it's just that I kept running out of memory while using it locally, so I switched to an individual build but workspace builds are actually really fantastic https://tsdown.dev/reference/cli#w-workspace-dir

they are working on fixes to it going full throttle without breaks rolldown/tsdown#940

CleanShot 2026-07-06 at 14 17 03@2x

@thetarnav

Copy link
Copy Markdown
Member

They are still running tsc 80 times.
The build script runs just one.
That's why you are running out of memory when ran in parallel on all threads.
And that's why I tried to move away from individual build steps in favor or a single script in monorepos.
I'm not going to block this or anything, if others prefer jsr support so be it. Personally I just hate it that this is how it works.
It used to be the case with turborepo + tsup that I either ran out of memory or the build took several minutes to complete.
I guess tsgo will reduce it down a bit eventually.

@okikio

okikio commented Jul 6, 2026

Copy link
Copy Markdown
Author

fair, though jsr doesn't require it per-se, it's kinda node that requires it. if only tsc didn't mandate noEmit: true when allowing importing ts this just wouldn't even be a problem 🤷🏽‍♂️

@okikio

okikio commented Jul 6, 2026

Copy link
Copy Markdown
Author

@thetarnav Fantastic news, I figured out a solution. Using isolatedDeclarations in tsconfig.json let's us speed this up by quite a bit, tsdown then basically avoids needing to call tsc at all and can just uses oxc-transformer

CleanShot 2026-07-06 at 15 53 52@2x

@davedbase

Copy link
Copy Markdown
Member

@thetarnav does this full satisfy your concerns? :) if so can I get your blessing?

@thetarnav

Copy link
Copy Markdown
Member

The build takes 16s on ci again so I'm fine with that.
But I'll need to check if the outputs. It's one thing to have build "work" locally and actually work in another project.
Also should the tests be failing?

@thetarnav

Copy link
Copy Markdown
Member

Alright checked locally and it looks good.
But why is the build script tsc -b packages/* && tsdown and not just tsdown?
tsc -b packages/* is not emitting anything because of the noEmit: true so there is no point to even running it.
Just typechecking? It could be a separate script then. A part of linting.

@okikio

okikio commented Jul 7, 2026

Copy link
Copy Markdown
Author

Your original build script did type checking via typescript, tsdown just strips the types. I thought yall had that there because that was part of your linting process. I can remove it if we deem it not necessary, removing tsc -b actually speeds up the builds even further.

okikio added 14 commits July 7, 2026 16:32
Add root Deno workspace settings for JSR validation and publishing while preserving the Solid 2.0 import surface used by the next branch.

Enable TypeScript source imports and no-emit checking in the root tsconfig so package source entries can be validated directly without generating output.
…e still supporting workspaces

Signed-off-by: Okiki Ojo <hey@okikio.dev>
…` condition to subpath exports

Signed-off-by: Okiki Ojo <hey@okikio.dev>
… (which both export .tsx files)

Signed-off-by: Okiki Ojo <hey@okikio.dev>
…orage, utils, and workers packages

Signed-off-by: Okiki Ojo <hey@okikio.dev>
…, fullscreen, mediastream, script-loader, sensors, and storage packages

Signed-off-by: Okiki Ojo <hey@okikio.dev>
Signed-off-by: Okiki Ojo <hey@okikio.dev>
…sions

Signed-off-by: Okiki Ojo <hey@okikio.dev>
…Set, and ReactiveWeakSet classes

Signed-off-by: Okiki Ojo <hey@okikio.dev>
…sonc

Signed-off-by: Okiki Ojo <hey@okikio.dev>
Signed-off-by: Okiki Ojo <hey@okikio.dev>
- Updated FormControlContext to explicitly define its type.
- Enhanced createFormControlInput to specify return type.
- Improved type imports in async package and adjusted function signatures for better type safety.
- Refined broadcast channel types for better generics handling.
- Specified return types for clipboard functions.
- Enhanced connectivity package to safely access navigator.connection.
- Improved controlled signal functions to return appropriate signal types.
- Specified return types for devices package functions.
- Made event listener functions safer with optional chaining.
- Updated fetch modifiers to specify return types.
- Enhanced autofocus functions with explicit return types.
- Improved gestures core functions to return structured types.
- Specified return types for GraphQL gql function.
- Enhanced input mask functions with explicit return types.
- Improved JSX tokenizer with unique symbol typing.
- Specified return types for keyboard event functions.
- Enhanced media query functions with explicit return types.
- Made media stream functions safer with optional chaining.
- Improved mouse position functions with explicit return types.
- Enhanced resource aggregation functions with explicit return types.
- Improved scroll position functions with explicit return types.
- Enhanced selection functions with explicit return types.
- Improved web share function with explicit return types.
- Enhanced number utility functions with explicit return types.
- Improved string utility functions with explicit return types.
- Enhanced spring functions with explicit return types.
- Improved tauri storage function with explicit return type.
- Enhanced storage tools with explicit return types.
- Improved upload functions with explicit return types.
- Enhanced immutable number functions with explicit return types.
- Improved utils index with explicit return types.
- Enhanced websocket functions with explicit return types.

Signed-off-by: Okiki Ojo <hey@okikio.dev>
…dd explicit return types to makeTauriFileSystem

Signed-off-by: Okiki Ojo <hey@okikio.dev>
okikio added 22 commits July 7, 2026 16:32
using pnpm catalogs to ensure tsdown versions stay the same across all packages [pnpm.io/catalogs](https://pnpm.io/catalogs)

Signed-off-by: Okiki Ojo <hey@okikio.dev>
Signed-off-by: Okiki Ojo <hey@okikio.dev>
….yaml

Signed-off-by: Okiki Ojo <hey@okikio.dev>
- Created tsdown.config.ts for the following packages:
  - mouse
  - mutable
  - mutation-observer
  - notification
  - orientation
  - page-utilities
  - pagination
  - permission
  - platform
  - pointer
  - presence
  - promise
  - props
  - queue
  - raf
  - range
  - refs
  - resize-observer
  - resource
  - rootless
  - scheduled
  - script-loader
  - scroll
  - selection
  - sensors
  - set
  - share
  - signal-builders
  - spring
  - sse
  - state-machine
  - static-store
  - storage
  - styles
  - timer
  - transition-group
  - trigger
  - tween
  - upload
  - utils
  - vibrate
  - video
  - virtual
  - websocket
  - workers

Signed-off-by: Okiki Ojo <hey@okikio.dev>
- Updated the build script in the following packages to use "tsdown" instead of the previous node command:
  - mutation-observer
  - notification
  - orientation
  - page-utilities
  - pagination
  - permission
  - platform
  - pointer
  - presence
  - promise
  - props
  - queue
  - raf
  - range
  - refs
  - resize-observer
  - resource
  - rootless
  - scheduled
  - script-loader
  - scroll
  - selection
  - sensors
  - set
  - share
  - signal-builders
  - spring
  - sse
  - state-machine
  - static-store
  - storage
  - styles
  - timer
  - transition-group
  - trigger
  - tween
  - upload
  - utils
  - vibrate
  - video
  - virtual
  - websocket
  - workers

Signed-off-by: Okiki Ojo <hey@okikio.dev>
…d steps in JSR CI workflows

Signed-off-by: Okiki Ojo <hey@okikio.dev>
…ed-props and virtual packages

JSR doesn't really know how to compile solidjs jsx, so I just take advantage of the tsdown compile step

Signed-off-by: Okiki Ojo <hey@okikio.dev>
…packages

Signed-off-by: Okiki Ojo <hey@okikio.dev>
- Removed unnecessary compilerOptions and references from tsconfig.json files in various packages.
- Retained only the "include" property to streamline configuration.

Signed-off-by: Okiki Ojo <hey@okikio.dev>
Signed-off-by: Okiki Ojo <hey@okikio.dev>
…ves packages

Signed-off-by: Okiki Ojo <hey@okikio.dev>
Signed-off-by: Okiki Ojo <hey@okikio.dev>
Signed-off-by: Okiki Ojo <hey@okikio.dev>
…ed-props & virtual packages

Signed-off-by: Okiki Ojo <hey@okikio.dev>
…rf. across multiple packages + use even stricter return types for variables, parameters & function

Signed-off-by: Okiki Ojo <hey@okikio.dev>
Signed-off-by: Okiki Ojo <hey@okikio.dev>
Signed-off-by: Okiki Ojo <hey@okikio.dev>
Signed-off-by: Okiki Ojo <hey@okikio.dev>
…king perf.

Signed-off-by: Okiki Ojo <hey@okikio.dev>
Signed-off-by: Okiki Ojo <hey@okikio.dev>
Signed-off-by: Okiki Ojo <hey@okikio.dev>
@okikio okikio force-pushed the jsr-support-next branch from 48142b6 to 121414b Compare July 7, 2026 20:34
…ilds

Signed-off-by: Okiki Ojo <hey@okikio.dev>
@okikio

okikio commented Jul 7, 2026

Copy link
Copy Markdown
Author

I actually misspoke earlier tsdown does type check, so tsc -b really isn't necessary anymore

okikio added 3 commits July 7, 2026 17:01
Signed-off-by: Okiki Ojo <hey@okikio.dev>
Signed-off-by: Okiki Ojo <hey@okikio.dev>
use tsdown now, aka `pnpm -w tsdown`

Signed-off-by: Okiki Ojo <hey@okikio.dev>
@okikio

okikio commented Jul 7, 2026

Copy link
Copy Markdown
Author

the builds are now 2x faster

CleanShot 2026-07-07 at 17 07 38@2x

…tions

Signed-off-by: Okiki Ojo <hey@okikio.dev>
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.

4 participants