Skip to content

Comments

enhancement(cli): #1639 configure rollup bundle output for import attributes#1621

Draft
thescientist13 wants to merge 5 commits intomasterfrom
enhancment/rollup-import-attributes-normalization
Draft

enhancement(cli): #1639 configure rollup bundle output for import attributes#1621
thescientist13 wants to merge 5 commits intomasterfrom
enhancment/rollup-import-attributes-normalization

Conversation

@thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Dec 13, 2025

Related Issue

resolves #1639

Documentation

N / A

Summary of Changes

  1. Configure Rollup to emit import attributes (with) as assertions (assert) are the default
  2. Force bump terser for import attributes support
  3. Leverage our own custom Acorn parsing within Rollup bundling

TODO

  1. intermittent Windows test case failures

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) CLI alpha.3 v0.34.0 labels Dec 13, 2025
@thescientist13 thescientist13 added this to the 1.0 milestone Dec 13, 2025
@thescientist13 thescientist13 self-assigned this Dec 13, 2025
@thescientist13 thescientist13 linked an issue Dec 16, 2025 that may be closed by this pull request
3 tasks
@thescientist13 thescientist13 force-pushed the enhancment/rollup-import-attributes-normalization branch from a101cf6 to f96aff4 Compare January 15, 2026 13:52
@thescientist13
Copy link
Member Author

thescientist13 commented Jan 15, 2026

Test failures seem to be due to a regression in Node on Windows?

Because the version in our .npmrc file works for me on Parallels (22.18.0)

owenbuckley@OWENBUCKLEY5945 MINGW64 ~/Workspace/greenwood (enhancment/rollup-import-attributes-normalization)
$ nvm use
Found '/c/Users/owenbuckley/Workspace/greenwood/.nvmrc' with version <22.18.0>
Now using node v22.18.0 (npm v10.9.3)

owenbuckley@OWENBUCKLEY5945 MINGW64 ~/Workspace/greenwood (enhancment/rollup-import-attributes-normalization)
$ yarn test
yarn run v1.22.22
$ cross-env BROWSERSLIST_IGNORE_OLD_DATA=true __GWD_ROLLUP_MODE__=strict NODE_NO_WARNINGS=1 c8 mocha --exclude "./packages/**/test/cases/loaders-*/**" "./packages/**/**/*.spec.js"


  Build Greenwood With: 
    AWS Adapter plugin output
      Default Output
        ✔ should output the expected number of serverless function output folders for SSR pages
        ✔ should output the expected number of serverless function output folders for API routes
        ✔ should output the expected package.json for each serverless function
      Greeting API Route adapter
        ✔ should return the expected response when the serverless adapter entry point handler is invoked
        ✔ should not have a shared asset for the card component
      Fragments API Route adapter
        ✔ should return the expected response when the serverless adapter entry point handler is invoked (256ms)
        ✔ should have a route chunk
      Submit JSON API Route adapter
        ✔ should return the expected response when the serverless adapter entry point handler is invoked
      Submit FormData JSON API Route adapter
        ✔ should return the expected response when the serverless adapter entry point handler is invoked
      Search API Route adapter
        ✔ should return the expected response when the serverless adapter entry point handler is invoked (146ms)
      Nested API Route adapter
        ✔ should return the expected response when the serverless adapter entry point handler is invoked
      Artists SSR Page adapter
        ✔ should return the expected response when the serverless adapter entry point handler is invoked (226ms)
      Blog Index (collision test) SSR Page adapter
        ✔ should return the expected response when the serverless adapter entry point handler is invoked (162ms)
      Blog First Post (nested) SSR Page adapter
        ✔ should return the expected response when the serverless adapter entry point handler is invoked (153ms)
      Index (collision test) SSR Page adapter
        ✔ should return the expected response when the serverless adapter entry point handler is invoked (179ms)
      Users SSR Page adapter
        ✔ should return the expected response when the serverless adapter entry point handler is invoked (196ms)
      Post SSR Page adapter
        ✔ should return the expected response when the serverless adapter entry point handler is invoked (327ms)


  17 passing (34s)

But as soon as I upgrade to the one from GitHub Actions (22.21.1), it fails

owenbuckley@OWENBUCKLEY5945 MINGW64 ~/Workspace/greenwood (enhancment/rollup-import-attributes-normalization)
$ nvm install
Found '/c/Users/owenbuckley/Workspace/greenwood/.nvmrc' with version <22.21.1>
Downloading and installing node v22.21.1...
Downloading https://nodejs.org/dist/v22.21.1/node-v22.21.1-win-x64.zip...
######################################################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v22.21.1 (npm v10.9.4)
owenbuckley@OWENBUCKLEY5945 MINGW64 ~/Workspace/greenwood (enhancment/rollup-import-attributes-normalization)
$ yarn test
yarn run v1.22.22
$ cross-env BROWSERSLIST_IGNORE_OLD_DATA=true __GWD_ROLLUP_MODE__=strict NODE_NO_WARNINGS=1 c8 mocha --exclude "./packages/**/test/cases/loaders-*/**" "./packages/**/**/*.spec.js"


  Build Greenwood With:
    AWS Adapter plugin output
      Default Output
        1) should output the expected number of serverless function output folders for SSR pages
        2) should output the expected number of serverless function output folders for API routes
        ✔ should output the expected package.json for each serverless function
      Greeting API Route adapter
        3) should return the expected response when the serverless adapter entry point handler is invoked
        ✔ should not have a shared asset for the card component
      Fragments API Route adapter
        4) should return the expected response when the serverless adapter entry point handler is invoked
        5) should have a route chunk
      Submit JSON API Route adapter
        6) should return the expected response when the serverless adapter entry point handler is invoked
      Submit FormData JSON API Route adapter
        7) should return the expected response when the serverless adapter entry point handler is invoked
      Search API Route adapter
        8) should return the expected response when the serverless adapter entry point handler is invoked
      Nested API Route adapter
        9) should return the expected response when the serverless adapter entry point handler is invoked
      Artists SSR Page adapter
        10) should return the expected response when the serverless adapter entry point handler is invoked
      Blog Index (collision test) SSR Page adapter
        11) should return the expected response when the serverless adapter entry point handler is invoked
      Blog First Post (nested) SSR Page adapter
        12) should return the expected response when the serverless adapter entry point handler is invoked
      Index (collision test) SSR Page adapter
        13) should return the expected response when the serverless adapter entry point handler is invoked
      Users SSR Page adapter
        14) should return the expected response when the serverless adapter entry point handler is invoked
      Post SSR Page adapter
        15) should return the expected response when the serverless adapter entry point handler is invoked


  2 passing (3s)
  15 failing

Let me test by pinning GitHub Actions and see what happens 🤞

@thescientist13 thescientist13 marked this pull request as draft January 16, 2026 14:21
@thescientist13
Copy link
Member Author

OK, this is interesting. when it fails, it looks like the build isn't actually happening?

WORKING

$ yarn test
yarn run v1.22.22
$ cross-env BROWSERSLIST_IGNORE_OLD_DATA=true __GWD_ROLLUP_MODE__=strict NODE_NO_WARNINGS=1 c8 mocha --exclude "./packages/**/test/cases/loaders-*/**" "./packages/**/**/*.spec.js"


  Build Greenwood With:
    AWS Adapter plugin output
-------------------------------------------------------

Welcome to Greenwood (v0.34.0-alpha.2) ♻️
-------------------------------------------------------

Running Greenwood with the build command.

Initializing project config

Initializing project workspace contexts

Generating graph of workspace files...

building from local sources...

pages to generate 


success, done generating all pages!
bundling static assets...

bundling dynamic pages...

bundling API routes...

optimizing static pages....

copying file... .greenwood/manifest.json

      Default Output
        ✔ should output the expected number of serverless function output folders for SSR pages
        ✔ should output the expected number of serverless function output folders for API routes
        ✔ should output the expected package.json for each serverless function

NOT WORKING
Notice it never gets to the bundling steps

$ yarn test
yarn run v1.22.22
$ cross-env BROWSERSLIST_IGNORE_OLD_DATA=true __GWD_ROLLUP_MODE__=strict NODE_NO_WARNINGS=1 c8 mocha --exclude "./packages/**/test/cases/loaders-*/**" "./packages/**/**/*.spec.js"


  Build Greenwood With:
    AWS Adapter plugin output
-------------------------------------------------------

Welcome to Greenwood (v0.34.0-alpha.2) ♻️
-------------------------------------------------------

Running Greenwood with the build command.

Initializing project config

Initializing project workspace contexts

Generating graph of workspace files...

building from local sources...

      Default Output
        1) should output the expected number of serverless function output folders for SSR pages
        2) should output the expected number of serverless function output folders for API routes
        ✔ should output the expected package.json for each serverless function

@thescientist13
Copy link
Member Author

thescientist13 commented Jan 17, 2026

Maybe I messed up the lockfile, builds are passing now though in #1629 🎉

(or maybe it was the rollup upgrade? 🤔 )

@thescientist13
Copy link
Member Author

Just for fun, decided to test out just regenerating the entire lock file, and now we get a stable version of terser (had to adjust test cases a little bit)

➜  greenwood git:(enhancment/rollup-import-attributes-normalization) ✗ yarn why terser
yarn why v1.22.22
[1/4] 🤔  Why do we have the module "terser"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "terser@5.46.0"
info Reasons this module exists
   - "_project_#@greenwood#cli#@rollup#plugin-terser" depends on it
   - Hoisted from "_project_#@greenwood#cli#@rollup#plugin-terser#terser"
info Disk size without dependencies: "2.38MB"
info Disk size with unique dependencies: "3.31MB"
info Disk size with transitive dependencies: "4.86MB"
info Number of shared dependencies: 10
✨  Done in 0.53s.

But as seems to be a classic thursday morning move, GitHub Actions just stopped running even though they just on these two PRs a few moments ago (#1630 / #1631) 😭 🤷‍♂️

If this does help, might set that up as its own PR, but for now let me test on local windows while I wait for GitHub Actions to get itself together

@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in [Greenwood] Phase 10 - Ecosystem Compat Jan 29, 2026
@thescientist13 thescientist13 changed the title enhancement(cli): configure rollup bundle output for import attributes enhancement(cli): #1639 configure rollup bundle output for import attributes Jan 29, 2026
@thescientist13
Copy link
Member Author

thescientist13 commented Jan 29, 2026

Still seemingly getting the same issue locally, will try invoking another GitHub Actions run 🙄

(but at least #1629 seems to be working in its limited scope 🤷‍♂️ )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI enhancement Improve something existing (e.g. no docs, new APIs, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

leverage import attributes bundle output configuration for Rollup bundling

1 participant