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

Suboptimal treeshaking on pure function calls #3256

Open
intrnl opened this issue Jul 20, 2023 · 0 comments
Open

Suboptimal treeshaking on pure function calls #3256

intrnl opened this issue Jul 20, 2023 · 0 comments

Comments

@intrnl
Copy link

intrnl commented Jul 20, 2023

It doesn't seem like esbuild is removing these pure function calls

import { html, clone, first_child, append, define } from "@intrnl/velvet/internal";
let template0 = /*#__PURE__*/ html("<div>hello</div>");

function setup($$root, $$host) {
	let fragment0 = /*#__PURE__*/ clone(template0);

        // these are deliberately commented out, though they are relevant
	// let child0 = /*#__PURE__*/ first_child(fragment0);
	// let child1 = /*#__PURE__*/ first_child(child0);
	// append($$root, fragment0);
}

export default define("x-app", setup, {}, []);

Does it matter if the REPL has said import externalized?

REPL link

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

No branches or pull requests

2 participants