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

feature/issue 1323 support for Bun #1308

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Nov 9, 2024

Related Issue

related to #1323

See a userland example here:

Summary of Changes

  1. Add GitHub Actions for Bun
  2. Had to alter import for node-html-parser
       TypeError: htmlparser.parse is not a function. (In 'htmlparser.parse(html, {
         script: !0,
         style: !0
       })', 'htmlparser.parse' is undefined)
           at /Users/owenbuckley/Workspace/github/greenwood-bun/node_modules/@greenwood/cli/src/lib/resource-utils.js:116:27
           at trackResourcesForRoute (/Users/owenbuckley/Workspace/github/greenwood-bun/node_modules/@greenwood/cli/src/lib/resource-utils.js:114:39)
           at /Users/owenbuckley/Workspace/github/greenwood-bun/node_modules/@greenwood/cli/src/lifecycles/prerender.js:168:11
      
  3. Had to check for an unexpected URL coming from Rollup
      {
         id: "\u0000commonjsHelpers.js",
         idUrl: URL {
           href: "file://commonjshelpers.js/",
           origin: "null",
           protocol: "file:",
           username: "",
           password: "",
           host: "commonjshelpers.js",
           hostname: "commonjshelpers.js",
           port: "",
           pathname: "/",
           hash: "",
           search: "",
           searchParams: URLSearchParams {},
           toJSON: [Function: toJSON],
           toString: [Function: toString],
         },
       }
      

Documentation

  1. Add a PR to the website (home page, hosting, etc) (assuming all actions pass)
    • callout needing trustedDependencies to support postinstall scripts with Bun, like for the puppeteer plugin
    • make sure to run bun with --bun flag for NPM scripts

TODO

  1. Actually use bun for npm scripts / github actions 🤦‍♂️
  2. Validate / support custom loaders equivalent - https://bun.sh/docs/runtime/plugins
  3. GraphQL failing
       OPTIONS - /graphql failed
       30 |         }
       31 |         var connectionHandler = (function (socket, request) {
       32 |             socket.upgradeReq = request;
       33 |             if (socket.protocol === undefined ||
       34 |                 (socket.protocol.indexOf(protocol_1.GRAPHQL_WS) === -1 && socket.protocol.indexOf(protocol_1.GRAPHQL_SUBSCRIPTIONS) === -1)) {
       35 |                 socket.close(1002);
                                   ^
       TypeError: socket.close is not a function. (In 'socket.close(1002)', 'socket.close' is undefined)
             at connectionHandler (/Users/owenbuckley/Workspace/project-evergreen/greenwood/node_modules/subscriptions-transport-ws/dist/server.js:35:24)
      
  4. Mocha test cases seem to run foreeveer, since failing tests cases pass when run individually - Investigate why mocha is very slow oven-sh/bun#13087
         3137 passing (42m)
         85 pending
         44 failing
      
    - actually, locally (macOS) with the a new timeout, seems to work much better, but still slow on CI (Linux)?
         3220 passing (5m)
         85 pending
       

Upstreams / Issues

  1. node-html-parser import
  2. Rollup bundle issue on URL
  3. Decorators support (Bun and Amaro) - demo Bun thescientist13/greenwood-lit-ssr#31
  4. Lit SSR - demo Bun thescientist13/greenwood-lit-ssr#31

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) documentation Greenwood specific docs CLI labels Nov 9, 2024
@thescientist13 thescientist13 added this to the 1.0 milestone Nov 9, 2024
@thescientist13 thescientist13 changed the title add github actions for bun feature/issue 953 validate support for Bun Nov 9, 2024
@thescientist13 thescientist13 added feature New feature or request question Further information is requested and removed enhancement Improve something existing (e.g. no docs, new APIs, etc) labels Nov 9, 2024
thescientist13

This comment was marked as duplicate.

@thescientist13 thescientist13 changed the title feature/issue 953 validate support for Bun feature/issue 953 support for Bun Nov 11, 2024
@thescientist13 thescientist13 mentioned this pull request Nov 25, 2024
40 tasks
@thescientist13 thescientist13 linked an issue Nov 28, 2024 that may be closed by this pull request
@thescientist13 thescientist13 removed this from the 1.0 milestone Nov 28, 2024
@thescientist13 thescientist13 force-pushed the feature/issue-953-bun-compat branch from d11db6b to 2f55bb7 Compare January 2, 2025 17:54
@thescientist13 thescientist13 self-assigned this Jan 2, 2025
@thescientist13 thescientist13 force-pushed the feature/issue-953-bun-compat branch from fa3acc0 to 41d563c Compare February 21, 2025 22:37
@thescientist13 thescientist13 changed the title feature/issue 953 support for Bun feature/issue 1323 support for Bun Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI documentation Greenwood specific docs feature New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bun runtime support
1 participant