Skip to content

Conversation

@thescientist13
Copy link
Member

@thescientist13 thescientist13 commented Apr 12, 2025

Related Issue

resolves #1439

Documentation

N / A

Summary of Changes

  1. Only invoke register.js when using --import when it actually comes from Greenwood

Demo / repro repo - https://github.com/thescientist13/greenwood-lifecycles-demo

TODO

  1. Windows tests failing - maybe due to needing to use path.sep?

Question

  1. read / write configuration to disk? - configuration lifecycle is running excessively (related to custom loaders usage?) #1439 (comment)
  2. need to cover more cases?
    // @@@@ REGISTER [
    //   '/Users/owenbuckley/.local/share/mise/installs/node/22.14.0/bin/node',
    //   '/Users/owenbuckley/Workspace/github-forks/HP_Stuff/packages/greenwood/node_modules/@greenwood/cli/src/index.js',
    //   'develop'
    // ]
    
    // @@@@ REGISTER [
    //   '/Users/owenbuckley/.local/share/mise/installs/node/22.14.0/bin/node',
    //   '/Users/owenbuckley/Workspace/github-forks/HP_Stuff/node_modules/.pnpm/@[email protected]/node_modules/@greenwood/cli/src/lib/ssr-route-worker.js'
    // ]
    if(process.argv.filter(arg => arg.endsWith('.bin/greenwood') || arg.indexOf('@greenwood/cli/src') >= 0).length === 1) {
      register("./loader.js", import.meta.url);
    }
  3. Confirm if this is expected behavior / outreach (I think it is)
  4. Is there a better way then checking process.argv

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) question Further information is requested CLI labels Apr 12, 2025
@thescientist13 thescientist13 self-assigned this Apr 12, 2025
@thescientist13 thescientist13 changed the title enhancement/issue 1439 handle excessive lifecycle running due to Worker threads triggering register function enhancement/issue 1439 handle excessive lifecycle running due to process spawning triggering register function Apr 12, 2025
@thescientist13 thescientist13 changed the title enhancement/issue 1439 handle excessive lifecycle running due to process spawning triggering register function enhancement/issue 1439 handle excessive lifecycle running due to Worker threads spawning triggering the register function Jun 3, 2025
@thescientist13 thescientist13 changed the title enhancement/issue 1439 handle excessive lifecycle running due to Worker threads spawning triggering the register function enhancement/issue 1439 handle excessive lifecycle running due to Worker thread spawning triggering the register function Jun 5, 2025
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) question Further information is requested SSR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

configuration lifecycle is running excessively (related to custom loaders usage?)

2 participants