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

Experiment with using findReferencedIdentifiers to avoid extra aggressive DCE #3149

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EskiMojo14
Copy link
Contributor

this is pretty messy currently, but the idea based on pcattori/babel-dead-code-elimination#34 (comment) is to find some way of getting the referenced identifiers before Start does any transformations, so it can use them when doing dead code elimination. this would mean that the only dead code that gets eliminated is any that wasn't there before Start.

I also have no idea how to test that a server side effect happened in Playwright, so that'll be a fun hurdle to cross.

from research i have basically found two "accepted" ways of communicating between plugins:

  • attaching things to options in one plugin and getting them out in the other
  • exposing methods on one plugin and finding the plugin from the other using buildStart

This PR currently uses the first, because buildStart seems to be receiving an empty object in my tests.

Copy link

nx-cloud bot commented Jan 12, 2025

View your CI Pipeline Execution ↗ for commit ed5a703.

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 5m 14s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 12s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-12 21:06:46 UTC

Copy link

pkg-pr-new bot commented Jan 12, 2025

Open in Stackblitz

More templates

@tanstack/create-router

npm i https://pkg.pr.new/@tanstack/create-router@3149

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@3149

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@3149

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@3149

@tanstack/create-start

npm i https://pkg.pr.new/@tanstack/create-start@3149

@tanstack/react-cross-context

npm i https://pkg.pr.new/@tanstack/react-cross-context@3149

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@3149

@tanstack/react-router-with-query

npm i https://pkg.pr.new/@tanstack/react-router-with-query@3149

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@3149

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@3149

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@3149

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@3149

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@3149

@tanstack/start

npm i https://pkg.pr.new/@tanstack/start@3149

@tanstack/start-vite-plugin

npm i https://pkg.pr.new/@tanstack/start-vite-plugin@3149

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@3149

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@3149

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@3149

commit: ed5a703

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.

1 participant