Changes since 25.2.0-alpha6
Fixes
-
Sanitize percent characters in resource URLs
Commit · Pull request · IssueJetty 12 rejects URLs containing %25 (percent-encoded percent) as ambiguous URI path encoding, causing downloads to fail with HTTP 400 when filenames contain "%" characters. Add UrlUtil.sanitizeForUrl() that replaces "%" with "_" in the URL path segment. The actual download filename from Content-Disposition is unaffected since each resource has a unique ID for lookup. ---------
-
Have Babel do the JSX dev transform so source locations stay accurate
Commit · Pull requestThere are three parts here 1. The react JSX transform records information where in the source an element is used, e.g.
hello2. We write location info for react components such as export default function HelloWorldView() { -> we add HelloWorldView.__debugSourceDefine= {...} with the source location of that function 3. We use a preact signal transform that wraps components to track signal reads In Vite 8 the JSX transform (1.) is run through the Vite react plugin through OXC. We use Babel to run 2 and 3. Both the JSX element source info and function source info need to be based on the original source file because Copilot uses it to find the source location to edit. 1. The first PR ran Babel before Vite 8 + OXC and we modified the source when storingHelloWorldView..__debugSourceDefine-> Element source info was wrong 2. The second PR changed Babel to run after Vite 8 + OXC and did not use the result from Vite 8 but read the files again from disk -> both source infos correct but@preact/signals-react-transformgot the OXC transformed result and its logic stopped working (signal updates did not re-render) 3. The third PR changed Babel to run before Vite 8 + OXC again, removed reading from disk as the locations are correct and then it usedretainLinesso it would not break Element source info -> Still breaks column info even though row info is retained and Copilot does not work 4. This PR runs Babel before Vite 8 + OXC but also make Babel do the React JSX transform. Then we are back to pretty much what we had with Vite 7 where it all happens in Babel and all info should be correct. Put more technically: Previous iterations had Babel run post-OXC, or pre-OXC with retainLines (both broken: retainLines preserves line numbers but not columns, so inserted statements push JSX to higher column numbers in Babel's output; the post-OXC approach saw already-transformed code). Move the JSX dev transform into Babel itself via @babel/plugin-transform-react-jsx-development with the custom jsxImportSource. Babel now emits _jsxDEV(...) calls whose embedded lineNumber/columnNumber come straight from its AST loc — which refers to the original source. Babel's printer can freely reformat the file afterwards because OXC no longer looks at JSX source positions. ---------