Like #15781, this PR will add more partial evaluation to the compiler. Some of the goals here are: - [x] Prototype methods for literals: ```svelte <script> let greeting = 'Hello, world!'; </script> <h1>Hello, {greeting.slice(-6)}</h1> <!-- compiled to Hello, world! --> ``` - [ ] Maybe more globals? - [x] Function analysis - [ ] Maybe TypeScript type annotations/assertions? - [ ] Maybe add evaluated stuff to the template? ### Before submitting the PR, please make sure you do the following - [ ] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [x] Prefix your PR title with `feat:`, `fix:`, `chore:`, or `docs:`. - [x] This message body should clearly illustrate what problems it solves. - [ ] Ideally, include a test that fails without this PR but passes with it. - [ ] If this PR changes code within `packages/svelte/src`, add a changeset (`npx changeset`). ### Tests and linting - [x] Run the tests with `pnpm test` and lint the project with `pnpm lint`
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by Ocean-OS and has received 7 comments.