Skip to content

feat: vite runtime renamed to module runner#16137

Merged
patak-cat merged 10 commits intovitejs:feat/environment-apifrom
sheremet-va:feat/environment-rename-runner
Mar 13, 2024
Merged

feat: vite runtime renamed to module runner#16137
patak-cat merged 10 commits intovitejs:feat/environment-apifrom
sheremet-va:feat/environment-rename-runner

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.

@bolt-new-by-stackblitz
Copy link

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

@patak-cat patak-cat changed the title feat: separate module graphs per environment feat: Vite Runtime renamed to Module Runner Mar 11, 2024
@patak-cat patak-cat 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-cat
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-cat
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-cat patak-cat 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-cat patak-cat merged commit 60f7f2b into vitejs:feat/environment-api Mar 13, 2024
@patak-cat patak-cat mentioned this pull request Mar 13, 2024
12 tasks
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