Skip to content

Import from TS in examples#1966

Closed
Brendonovich wants to merge 2 commits intodevinxifrom
use-ts-in-examples
Closed

Import from TS in examples#1966
Brendonovich wants to merge 2 commits intodevinxifrom
use-ts-in-examples

Conversation

@Brendonovich
Copy link
Collaborator

This allows us to not have to build the Start package before testing it in examples.
It requires us to import src/config directly inside examples, as Vite doesn't transpile files from packages when importing them into the config, but I'd say this is worth it for the workflow improvement - Vite will even reload automatically when modifying the Start config implementation now.
It also requires making some modifications to our publishing process, since the default exports field now points to .ts files. pnpm publish will automatically use the .js exports defined in publishConfig, but changesets and pkg.pr.new require a small jq command to swap out the exports field before publishing.

@changeset-bot
Copy link

changeset-bot bot commented Sep 7, 2025

⚠️ No Changeset found

Latest commit: f3f1b16

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

@birkskyum
Copy link
Member

birkskyum commented Sep 7, 2025

I can see the significant convenience of this for local development, but this change won't work on the main branch for a number of reasons, so it has to be reverted before merging into that. Alternatively, I've previously use a small script that converted the import paths to be relative like here in few ms, and that was an okay development experience as well.

The main issues that makes this incompat with main are:

  • Deps tied to certain start/vinxi versions like mediakit/auth, they'll cause version conflicts in the lockfile that cause various symptoms and let to the split lockfile in the first place.
  • The examples are cloned directly from the solid-cli, so they can't have relative imports.

A middleground that resolves the latter could be using overrides like tanstack/router, where in local development, the examples will resolve ot local packages, but if cloned, they'll resolve to the npm packages. The package overrides doesn't resolve the version conflict of i.e. mediakit/auth though:

@birkskyum
Copy link
Member

solid-cli has been updated to use solid-start examples from the solidjs/templates repo, so this repo can move forward with just having some fixtures that are imported from TS

@atilafassina
Copy link
Member

let's try this one once we merge #1977

@birkskyum
Copy link
Member

Probably easier to remake than rebase at this point.

@Brendonovich
Copy link
Collaborator Author

Agreed, will close and recreate

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.

3 participants