Skip to content

Conversation

@jsantell
Copy link
Collaborator

@jsantell jsantell commented Feb 27, 2025

An effort to port our shared and frontend modules to deno, and running Jumble's vite server in deno, and aligning patterns and tools across all of our active TS modules.

  • Replace pnpm with deno workspaces. Workspace dependencies are defined in typescript/packages/deno.json and are available for use in all workspace members. Workspace members (e.g. @commontools/memory) are also available in all members, though not all packages are suitable for both deno and browser environments. Roughly, dependencies shared by multiple packages are put in the workspace, otherwise they're defined in that package's deno.json.
  • Updated to explicit file extensions
  • Remove tsconfig.json, eslintconfig, .prettier* and vite.config.js (outside of Jumble)
  • Remove individual deno projects' deno.lock (memory, toolshed), now tracked in workspace
  • added accessor to (lit) decorators to be compatible with Deno as "Standard Decorators"
  • Some type-checker based fixes, now enforced
  • In jumble, fonts are no longer managed by vite and are static assets. (Consequence from not using aliases in vite)
  • Non-browser tests previously run in vitest (node) now in deno using @std/testing/bdd framework. Tests run by deno test, or deno task test if permissions required, TBD how to reconcile, could always implement deno task test.
  • In order to support vite running in deno, we also want vite to resolve modules using deno's workspace. @deno/vite-plugin is forked and vendored here (typescript/packages/deno-vite-plugin) with a change to cache calls to deno info, otherwise the performance is too slow to be usable (see typescript/packages/deno-vite-plugin/src/resolver.ts and resolverCache for changes).
    • The hacking around vite uses --node-modules-dir=auto, adding a node_modules dir to the workspace. Not ideal, but node is not actually used.

TODO (before landing)

  • Integrate current active tests with CI

Follow ups (after landing)

  • Browser tests previously handled by web-test-runner do not yet have an alternative (common-iframe-sandbox, common-identity). TBD
  • common-html tests need some configuring to get the jsx working
  • There's a challenge resolving react-dom/client. The root exports it, but there's a warning, though it works: Warning: You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".
  • The workspace tasks are placeholders/under development.

jsantell and others added 3 commits February 28, 2025 10:14
bumping toolshed
tarballing dist in jumble so we can store the artifact bundle in github actions
enabling deno vscode plugin for everything, and making denoland the default linter
reorganizing toolshed deno, and pulling formats / lint settings up to the workspace
removing include in workspace deno.json
@jsantell jsantell marked this pull request as ready for review February 28, 2025 18:15
@jsantell jsantell merged commit 557426f into main Feb 28, 2025
5 checks passed
@jsantell jsantell deleted the denoify branch February 28, 2025 18:22
@jsantell jsantell mentioned this pull request Feb 28, 2025
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