-
Notifications
You must be signed in to change notification settings - Fork 15
feat(runtimes): #1323 support for Bun #1308
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
base: master
Are you sure you want to change the base?
Conversation
d11db6b to
2f55bb7
Compare
fa3acc0 to
41d563c
Compare
|
Interesting, running a test with Bun gets this order of pages when crawling the pages directory Build Greenwood With:
Prerender Configuration turned on using Content As Data collections
-------------------------------------------------------
Welcome to Greenwood (v0.33.3) ♻️
-------------------------------------------------------
Running Greenwood with the build command.
Initializing project config
Initializing project workspace contexts
Generating graph of workspace files...
building from local sources...
building from external sources...
pages to generate
/
/toc/
/blog/
/blog/second-post/
/blog/first-post/
/external/
Initializing active content...While Node gives them top down Build Greenwood With:
Prerender Configuration turned on using Content As Data collections
-------------------------------------------------------
Welcome to Greenwood (v0.33.3) ♻️
-------------------------------------------------------
Running Greenwood with the build command.
Initializing project config
Initializing project workspace contexts
Generating graph of workspace files...
building from local sources...
building from external sources...
pages to generate
/blog/first-post/
/blog/
/blog/second-post/
/
/toc/
/external/
Initializing active content...This causes some test cases to fail since they assume a specific order of content as data
|
|
For some other stuff related to tests 1) Develop Greenwood With:
Default Configuration for CSS Modules
index.html with expected CSS and SSR contents
Header component with CSS Modules
CSS module should be processed as ESM
"before all" hook for "the served content should be untouched":
Error: scan: invalid `cwd`, not a string |
|
For init, was getting this test failure when running the Yarn installer ➜ greenwood git:(feature/issue-953-bun-compat) ✗ bun run --bun test:bun
$ cross-env BROWSERSLIST_IGNORE_OLD_DATA=true __GWD_ROLLUP_MODE__=strict NODE_NO_WARNINGS=1 mocha --timeout 360000 --exclude "./packages/**/test/cases/loaders-*/**" "./packages/**/**/*.spec.js"
Initialize a new Greenwood project:
Scaffolding a new project with dependencies installed through Yarn
-------------------------------------------------------
Initialize a Greenwood Project (v0.33.3) ♻️
-------------------------------------------------------
creating output directory => my-app
copying project files to => /Users/owenbuckley/Workspace/project-evergreen/greenwood/packages/init/test/cases/init.options.install-yarn/my-app/
setting up package.json...
creating a .gitignore file...
installing dependencies using => yarn...
yarn install v1.22.22
warning package.json: No license field
info No lockfile found.
warning [email protected]: No license field
[1/4] 🔍 Resolving packages...
error Error: https://registry.yarnpkg.com/@greenwood%2fcli: SSL Error: https://registry.yarnpkg.com/@greenwood%2fcli does not support SSL
at <anonymous> (/Users/owenbuckley/.nvm/versions/node/v22.18.0/lib/node_modules/yarn/lib/cli.js:142154:27)
at emit (node:events:95:22)
at <anonymous> (node:_http_client:232:45)
at processTicksAndRejections (native:7:39)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.Had to run this command yarn config set strict-ssl false |
|
Getting some issues from the develop related test cases 101 passing (6s)
7 failing
1) Develop Greenwood With:
Default Greenwood Configuration and Workspace
Develop command with source map specific behavior
should return the correct content type:
expected 'text/javascript' to equal 'application/json'
+ expected - actual
-text/javascript
+application/json
Error
at unknown
at <anonymous> (packages/cli/test/cases/develop.default/develop.default.spec.js:539:57)
2) Develop Greenwood With:
Default Greenwood Configuration and Workspace
Develop command with POST API specific behaviors for JSON
should return a 200 status:
expected 500 to equal 200
+ expected - actual
-500
+200
Error
at unknown
at <anonymous> (packages/cli/test/cases/develop.default/develop.default.spec.js:802:36)
3) Develop Greenwood With:
Default Greenwood Configuration and Workspace
Develop command with POST API specific behaviors for JSON
should return the expected response message:
TypeError: null is not an object (evaluating 'data.message')
at <anonymous> (packages/cli/test/cases/develop.default/develop.default.spec.js:806:16)
4) Develop Greenwood With:
Default Greenwood Configuration and Workspace
Develop command with POST API specific behaviors for JSON
should return the expected content type header:
expected 'text/plain; charset=utf-8' to equal 'application/json'
+ expected - actual
-text/plain; charset=utf-8
+application/json
Error
at unknown
at <anonymous> (packages/cli/test/cases/develop.default/develop.default.spec.js:810:57)
5) Develop Greenwood With:
Default Greenwood Configuration and Workspace
Develop command with POST API specific behaviors for JSON
should return the secret header in the response:
expected null to equal '1234'
Error
at unknown
at <anonymous> (packages/cli/test/cases/develop.default/develop.default.spec.js:814:53)
6) Develop Greenwood With:
Default Greenwood Configuration and Workspace
Develop command with POST API specific behaviors for FormData
"before all" hook for "should return a 200 status":
Unable to connect. Is the computer able to access the url?
7) Develop Greenwood With:
Default Greenwood Configuration and Workspace
Develop command nested API specific behaviors
"before all" hook for "should return a 200 status":
Unable to connect. Is the computer able to access the url? |
81ea23a to
7d90290
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
Perhaps attributable to different implementations around 1) Develop Greenwood With:
Default Greenwood Configuration and Workspace
Develop command specific HTML behaviors
should return an import map shim <script> in the <head> of the document:
expected 15125 to equal 15154
+ expected - actual
-15125
+15154
Error
at unknown
at <anonymous> (packages/cli/test/cases/develop.default/develop.default.spec.js:134:39) |
3ec9b8e to
5599db5
Compare
3f41a25 to
af6372e
Compare


Related Issue
related to #1323
Summary of Changes
Documentation
bunsupport to copy to clipboard componenttrustedDependenciesto supportpostinstallscripts with Bun, like for the puppeteer plugin--bunflag for NPM scriptsTODO
cwdis not a string - feat(runtimes): #1323 support for Bun #1308 (comment)init scaffolding with Yarn - feat(runtimes): #1323 support for Bun #1308 (comment)API serve test case failuredevelop test case failures- feat(runtimes): #1323 support for Bun #1308 (comment)ordering of content as data / Netlify _redirects- feat(runtimes): #1323 support for Bun #1308 (comment)graphql tests (needs Apollo v4 upgrade)- enhancement(plugins): #1429 upgrade GraphQL plugin to apollo v4 #1593greenwood serve(needs WCC upstream) - bug: patch support for greenwood serve with wc-compiler and bun thescientist13/www.toosh.pet#10Upstreams / Issues
(Bun) Decorators not supported - support typescript@5 decorator oven-sh/bun#4122 (comment)
(Bun) Plugins are not supported in Workers - Worker does not load
preloadfrom bunfig.toml oven-sh/bun#12608 (comment)Give feedback on Investigate why mocha is very slow oven-sh/bun#13087
node-html-parser import - giving this one a pass for now - https://github.com/thescientist13/bun-node-compat-tests?tab=readme-ov-file#node-html-parser
Details
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:11Had to check for an unexpected URL coming from Rollup- can't reproduce?Details
{ 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], }, }Lit SSR - can not reproduce
Details
building from local sources... 200 | #onClose(e) { 201 | this.#onExitPromise = e.code, this.emit("exit", e.code); 202 | } 203 | #onError(event) { 204 | let error = event?.error; 205 | error = new Error(event.message, { cause: event }); ^ error: 1 | /** 2 | * @license 3 | * Copyright 2017 Google LLC 4 | * SPDX-License-Identifier: BSD-3-Clause 5 | */ 6 | const t=globalThis,i=t.trustedTypes,s=i?i.createPolicy("lit-html",{createHTML:t=>t}):void 0,e="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o="?"+h,n=`<${o}>`,r=void 0===t.document?{createTreeWalker:()=>({})}:document,l=()=>r.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),T=y(2),b=y(3),w=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r.createTreeWalker(r,129);function P(t,i){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s?s.createHTML(i):i}const V=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"":3===i?"":"",c=f;for(let i=0;iTypeError: r.createTreeWalker is not a function. (In 'r.createTreeWalker(r, 129)', 'r.createTreeWalker' is undefined) at /Users/owenbuckley/Workspace/github/greenwood-lit-ssr/node_modules/lit-html/node/lit-html.js:6:750 at #onError (node:worker_threads:205:15) Bun v1.2.2 (macOS arm64) error: script "build" exited with code 1GraphQL failing - looks like we just need to upgrade to @apollo/server v4 - https://github.com/thescientist13/bun-node-compat-tests?tab=readme-ov-file#%EF%B8%8F-apollo-graphql-server-playground
Details
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)bug(cli): #1323 refine serving logic for node modules plugin #1577
useTscto process our own decoratorsMocha test cases seem to run foreveeeeeer, since failing tests cases pass when run individually - Investigate why mocha is very slow oven-sh/bun#13087