rtsao
Repos
218
Followers
386
Following
41

:zap: Toolkit for component-oriented styling

3291
98

Element style sheets 🚧🏗

30
1

Software package release automation for GitHub

Generates CSS w/ sourcemaps to lines in JS at runtime

📦 A toolchain for developing universal (Node.js and browser) JavaScript packages

36
12

🏷 A microservice for SVG GitHub label images

10
4

Events

push

chore: remove unused images from docs [ci skip]

sponsor images are not remotely loaded from a service

fix: module graph ensureEntryFromUrl based on id (#9759)

refactor: use server.ssrTransform (#9769)

test: refactor config load (#9762)

fix(html): move importmap before module scripts (#9392)

Co-authored-by: 翠 / green green@sapphi.red

chore: output tsconfck debug log (#9768)

docs: fix typos (#9776)

chore(deps): update dependency postcss-modules to v5 (#9779)

feat: support object style hooks (#9634)

chore(deps): update all non-major dependencies (#9778)

chore: remove custom vitepress config (#9785)

fix: Skip inlining Git LFS placeholders (fix #9714) (#9795)

refactor: migrate from vue/compiler-dom to parse5 (#9678)

fix: close socket when client error handled (#9816)

fix(plugin-legacy): prevent global process.env.NODE_ENV mutation (#9741)

fix: injectQuery break relative path (#9760)

fix: completeSystemWrapPlugin captures function () (fixes #9807) (#9821)

feat: relax dep browser externals as warning (#9837)

release: v3.1.0-beta.0

feat(client): use debug channel on hot updates (#8855)

Created at 2 weeks ago
push

chore: remove unused images from docs [ci skip]

sponsor images are not remotely loaded from a service

fix: module graph ensureEntryFromUrl based on id (#9759)

refactor: use server.ssrTransform (#9769)

test: refactor config load (#9762)

fix(html): move importmap before module scripts (#9392)

Co-authored-by: 翠 / green green@sapphi.red

chore: output tsconfck debug log (#9768)

docs: fix typos (#9776)

chore(deps): update dependency postcss-modules to v5 (#9779)

feat: support object style hooks (#9634)

chore(deps): update all non-major dependencies (#9778)

chore: remove custom vitepress config (#9785)

fix: Skip inlining Git LFS placeholders (fix #9714) (#9795)

refactor: migrate from vue/compiler-dom to parse5 (#9678)

fix: close socket when client error handled (#9816)

fix(plugin-legacy): prevent global process.env.NODE_ENV mutation (#9741)

fix: injectQuery break relative path (#9760)

fix: completeSystemWrapPlugin captures function () (fixes #9807) (#9821)

feat: relax dep browser externals as warning (#9837)

release: v3.1.0-beta.0

feat(client): use debug channel on hot updates (#8855)

Created at 2 weeks ago
push

fix: legacy no emit worker (#9500)

fix(ssr): rename objectPattern dynamic key (fixes #9585) (#9609)

fix: json HMR (fixes #9521) (#9610)

fix(optimizer): ignore EACCES errors while scanner (fixes #8916) (#9509)

fix(plugin-react): wrong substitution causes React is not defined (#9386)

fix: use browser field if it is not likely UMD or CJS (fixes #9445) (#9459)

feat: show warning on 431 response (#9324)

Co-authored-by: Bjorn Lu bjornlu.dev@gmail.com

fix: don't count class declarations as react fast refresh boundry (fixes #3675) (#8887)

fix(legacy): skip esbuild transform for systemjs (#9635)

chore: narrow down rollup version (#9637)

release: v3.0.6

release: plugin-vue@3.0.2

release: plugin-react@2.0.1

release: plugin-legacy@2.0.1

release: create-vite@3.0.1

refactor(legacy): remove code for Vite 2 (#9640)

chore: remove vitest global options (#9620)

fix(config): don't use file url for external files with cjs output (#9642)

chore: fix typo in error message (#9645)

release: v3.0.7

Created at 2 weeks ago
pull request opened
Add JSX side effects option

Resolves https://github.com/evanw/esbuild/issues/2539

I had originally added this for https://github.com/vitejs/vite/pull/9590 but ended up thinking there wasn't any actual use case.

I'm not sure if you've started work on this already but figured I'd throw up the PR in case not - please feel free to close otherwise!

Created at 3 weeks ago
create branch
rtsao create branch jsx-pure-option
Created at 3 weeks ago
create branch
rtsao create branch jsx-pure
Created at 3 weeks ago
issue comment
SSR external packages with entries break when not hoisted

Alternatively, the node resolve algorithm inside isExternalizable could resolve from the dependent package location rather than the project root.

This is the fix implemented in https://github.com/vitejs/vite/pull/9763

Created at 3 weeks ago
Created at 3 weeks ago
started
Created at 1 month ago
issue comment
fix(ssr): ensure sup-dependencies are correctly externalized if not resolvable from root

Hmm, it seems strange to me that it would be expected behavior to crash SSR in the common scenario of a pnpm or Yarn monorepo with CJS dependencies and default configuration.

IMHO there shouldn’t need to be configuration to prevent a crash in this case. CJS packages are the overwhelming majority of npm dependencies. Manually adding and maintaining dozens (if not hundreds) of exceptions for every CJS dependency seems like an unreasonable burden.

Created at 1 month ago
issue comment
CommonJS dependencies crash SSR server

Put together a fix: https://github.com/vitejs/vite/pull/9763

TL;DR approach of resolving all nested deps from root is broken with pnpm and Yarn PnP

Created at 1 month ago
push

test(ssr): add failing external nested cjs test

Created at 1 month ago
rtsao create branch main
Created at 1 month ago
create repository
rtsao create repository
Created at 1 month ago
pull request opened
fix(ssr): ensure sup-dependencies are correctly externalized if not resolvable from root

Description

Fixes https://github.com/vitejs/vite/issues/9710

The externalizer logic unconditionally attempts to resolve encountered dependencies from the project root. This works fine with hoisted node_modules installations, but does not work with more strict installation schemes where only explicit dependencies are only resolvable (such as pnpm or Yarn PnP). In this case, the externalizer is unable to resolve the sub-dependency from the root, and as a result it is not externalized for SSR.

For example, suppose we have the following dependency graph: app -> dep-a -> dep-b

With npm, dep-b is resolvable from app (the root) because it is hoisted:

code
├── node_modules
│   ├── dep-a
│   └── dep-b
└── app

However, pnpm and PnP ensure strictness where dep-b cannot be resolved from app (and must be resolved from dep-a.

code
└── app
    └── node_modules
        └── dep-a
            └── node_modules
                └── dep-b

In this case, dep-b fails to be externalized for SSR (resulting in errors if dep-b is CJS)

This PR fixes the issue by passing along the importer and resolving from the importer, thereby allowing it to be resolved correctly.

Additional context

The externalization logic is memoized so resolution for a given package name only happens once. However, now resolution depends on two parameters: the package name and the importing path.

But taking into consideration the importing path would largely defeat the point of the cache as misses would be frequent.

I'm not super familiar with the intended logic of externalization, but I suppose a given package is OK to externalize as long as it was resolvable at some point. That being said, I think there probably needs to be more thinking about edge cases here, but I would need some help understanding the original context of this code.


What is the purpose of this pull request?

  • [x] Bug fix
  • [ ] New Feature
  • [ ] Documentation update
  • [ ] Other

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

  • [x] Read the Contributing Guidelines.
  • [x] Read the Pull Request Guidelines and follow the Commit Convention.
  • [x] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • [x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • [ ] Ideally, include relevant tests that fail without this PR but pass with it.
Created at 1 month ago
push

fix: legacy no emit worker (#9500)

fix(ssr): rename objectPattern dynamic key (fixes #9585) (#9609)

fix: json HMR (fixes #9521) (#9610)

fix(optimizer): ignore EACCES errors while scanner (fixes #8916) (#9509)

fix(plugin-react): wrong substitution causes React is not defined (#9386)

fix: use browser field if it is not likely UMD or CJS (fixes #9445) (#9459)

feat: show warning on 431 response (#9324)

Co-authored-by: Bjorn Lu bjornlu.dev@gmail.com

fix: don't count class declarations as react fast refresh boundry (fixes #3675) (#8887)

fix(legacy): skip esbuild transform for systemjs (#9635)

chore: narrow down rollup version (#9637)

release: v3.0.6

release: plugin-vue@3.0.2

release: plugin-react@2.0.1

release: plugin-legacy@2.0.1

release: create-vite@3.0.1

refactor(legacy): remove code for Vite 2 (#9640)

chore: remove vitest global options (#9620)

fix(config): don't use file url for external files with cjs output (#9642)

chore: fix typo in error message (#9645)

release: v3.0.7

Created at 1 month ago
push

fix: legacy no emit worker (#9500)

fix(ssr): rename objectPattern dynamic key (fixes #9585) (#9609)

fix: json HMR (fixes #9521) (#9610)

fix(optimizer): ignore EACCES errors while scanner (fixes #8916) (#9509)

fix(plugin-react): wrong substitution causes React is not defined (#9386)

fix: use browser field if it is not likely UMD or CJS (fixes #9445) (#9459)

feat: show warning on 431 response (#9324)

Co-authored-by: Bjorn Lu bjornlu.dev@gmail.com

fix: don't count class declarations as react fast refresh boundry (fixes #3675) (#8887)

fix(legacy): skip esbuild transform for systemjs (#9635)

chore: narrow down rollup version (#9637)

release: v3.0.6

release: plugin-vue@3.0.2

release: plugin-react@2.0.1

release: plugin-legacy@2.0.1

release: create-vite@3.0.1

refactor(legacy): remove code for Vite 2 (#9640)

chore: remove vitest global options (#9620)

fix(config): don't use file url for external files with cjs output (#9642)

chore: fix typo in error message (#9645)

release: v3.0.7

Created at 1 month ago
create branch
rtsao create branch fix-externals-pnp
Created at 1 month ago
issue comment
CommonJS dependencies crash SSR server

I'm aware of a workaround to forcibly externalize these deps (as they should be): {ssr: {external: ["the-dep"]}) but this is rather cumbersome for large projects where there could be hundreds of CommonJS sub-dependencies. Very few npm packages are ESM.

I think the heuristics for whether dependencies should be externalized is broken somehow.

Created at 1 month ago

Update README.md

Created at 1 month ago
rtsao create branch main
Created at 1 month ago
create repository
rtsao create repository
Created at 1 month ago

Simplify repro

Created at 1 month ago