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

custom builtins #1085

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

custom builtins #1085

wants to merge 1 commit into from

Conversation

mbostock
Copy link
Member

Sketch at #928. The main thing missing is the equivalent of getImplicitInputImports, getImplicitDownloads, etc. Also, I’d rather have this live inside the config file, but I think it’s harder to express the builtins as code if we do that?

@Fil
Copy link
Contributor

Fil commented Mar 18, 2024

Without trying to implement it (so I'm probably missing why it's difficult), I imagined you could say this in a config file:

const confetti = () => import("npm:canvas-confetti").then((confetti) => confetti.default);

export default {
  builtins: {confetti},
  ...
}

Or, adding imports and downloads as keys:

const confetti = {
  module: () => import("npm:canvas-confetti").then((confetti) => confetti.default),
  imports:  ,
  downloads: 
};

export default {
  builtins: {confetti},
  ...
}

@mbostock
Copy link
Member Author

Try it in our config and you’ll see why. The config is server-side code, so we don’t want to use it to define client-side code.

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.

2 participants