Skip to content

Commit

Permalink
showcase input field clobber issue sveltejs/svelte#1755
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnuesslein committed Aug 1, 2022
1 parent e57008f commit 7e5d14c
Show file tree
Hide file tree
Showing 21 changed files with 5,626 additions and 2,353 deletions.
13 changes: 13 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
20 changes: 20 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript')
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020
},
env: {
browser: true,
es2017: true,
node: true
}
};
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
13 changes: 13 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
}
28 changes: 11 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
this repo is demonstrating the problems with ssr=true and fetching something that the internal vite-proxy should provide.

see https://github.com/sveltejs/kit/issues/1729
this repo is demonstrating the problem where hydration of the page resets input fields

see https://github.com/sveltejs/svelte/issues/1755

to test:

- run a small http-server on port 8000, e.g.: `/usr/bin/env python3 -m http.server`
- then run `npm run dev`


there are 4 routes, basically the same, only varying in `ssr=false/true` and `load({fetch}) / load(), js-fetch`:

- http://localhost:3000/ssr_false
- http://localhost:3000/ssr_false_js_fetch
- http://localhost:3000/ssr_true
- http://localhost:3000/ssr_true_js_fetch


ssr_true should show the problem
- run `npm run dev`
- open new tab
- set web browser "Throttling" to Fast 3G
- navigate to http://localhost:5173/
- as soon as possible enter something in the input field
- after input you can disable throttling again
- > the input field will be reset
it is also reproducable with `npm run build && npm run preview`. however I had to set it to "slow 3g" to be fast enough to catch it in that case.
2 changes: 0 additions & 2 deletions api/index.html

This file was deleted.

Loading

0 comments on commit 7e5d14c

Please sign in to comment.