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

feat: vite runtime renamed to module runner #16137

Merged

Conversation

sheremet-va
Copy link
Member

@sheremet-va sheremet-va commented Mar 11, 2024

Description

This PR renames "Runtime API" into "Runner API".

I also removed executeEntrypoint as a method and renamed executeUrl to import. Runner API expects "triggeredBy" in "full-reload" event. full-reload now automatically finds the entrypoint. If you don't want to support HMR, create a runner with hmr: false.

This PR does not add support for granular HMR handling.

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines, especially the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

stackblitz bot commented Mar 11, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@patak-dev patak-dev changed the title feat: separate module graphs per environment feat: Vite Runtime renamed to Module Runner Mar 11, 2024
@patak-dev patak-dev changed the title feat: Vite Runtime renamed to Module Runner feat: vite runtime renamed to module runner Mar 11, 2024
@sheremet-va sheremet-va marked this pull request as ready for review March 12, 2024 10:21
@sheremet-va sheremet-va force-pushed the feat/environment-rename-runner branch from d77022e to 3c46f97 Compare March 12, 2024 10:51
@patak-dev
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

📝 Ran ecosystem CI on 3c46f97: Open

suite result latest scheduled
analogjs failure success
astro failure success
nuxt failure success
previewjs failure success
vike failure success
vite-plugin-svelte failure success
vite-plugin-vue failure success
vitest failure success

histoire, ladle, laravel, marko, qwik, rakkas, sveltekit, unocss, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-pages, vite-plugin-react-swc, vite-setup-catalogue, vitepress

"./runtime": {
"types": "./dist/node/runtime.d.ts",
"import": "./dist/node/runtime.js"
"./module-runner": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module-runner doesn't feel that right with the two words. I wonder if we should have something more generic here. Is there other things that may be imported by runtimes later on?
Should we keep it as:

import { ModuleRunner } from 'vite/runtime'

with the meaning that it the entry point for Runtimes to import from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module-runner was something that you proposed 😄

Is there other things that may be imported by runtimes later on?

No, the idea is to keep this as small as possible. Making it generic would encourage putting more things here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good re-proposing stuff 😅

I don't think it will encourage us to put more things there. I kind of like vite/runtime better here. But we can move forward and later on rename the things if we want. Maybe @sapphi-red or others can chip in to see what sounds better to them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vote to module-runner. I'm fine with runner, too.

runtime feels a bit different to me. In the new environment API, I understand that the term "runtime" means the actual runtime (e.g. node, deno, workerd) and not the module runner/loader/executor built using Vite's API.

@patak-dev
Copy link
Member

/ecosystem-ci run vite-plugin-vue

@vite-ecosystem-ci
Copy link

📝 Ran ecosystem CI on 4ed545b: Open

vite-plugin-vue

Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving approval, @sheremet-va feel free to merge whenever you want this. I'm not merging it in case you want to get a review from @sapphi-red first.

Note: the same CI tests are failing in the target branch.

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@patak-dev patak-dev merged commit 60f7f2b into vitejs:feat/environment-api Mar 13, 2024
6 of 7 checks passed
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.

3 participants