Skip to content

Commit

Permalink
feat: upgrade to Svelte 4, improve TypeScript types
Browse files Browse the repository at this point in the history
BREAKING CHANGES:

- Upgraded to Svelte 4 providing improved TypeScript types.
- Dropped re-exporting types and utility functions from `immutable-json-patch` 
  and `svelte`. Instead, import them directly from the library itself.
- Dropped deprecated types `FontAwesomeIcon` (use `IconDefinition` instead), 
  `DropdownButtonItem`, `MenuButtonItem`, `MenuSeparatorItem`, `MenuSpaceItem`,
  and typeguard `isMenuSpaceItem`.
- The `vanilla-package` does not embed types of dependencies anymore and instead,
  imports the dependencies and use the types from there.
- Drop official support for Node.js 16
  • Loading branch information
josdejong committed Aug 21, 2023
1 parent d36b461 commit 4d0451e
Show file tree
Hide file tree
Showing 60 changed files with 3,768 additions and 2,722 deletions.
29 changes: 15 additions & 14 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"plugins": ["svelte3", "@typescript-eslint", "import"],
"ignorePatterns": [],
"parserOptions": {
"extraFileExtensions": [".svelte"],
"sourceType": "module",
"ecmaVersion": 2019
},
"overrides": [
{
"files": ["*.svelte"],
"processor": "svelte3/svelte3"
"parser": "svelte-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser"
}
}
],
"rules": {
"import/extensions": ["error", "ignorePackages"]
},
"settings": {
"svelte3/typescript": true
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2019
},
"env": {
"browser": true,
"es2017": true,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
2 changes: 1 addition & 1 deletion README-VANILLA.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Remark: for usage in a Svelte project, install `svelte-jsoneditor` instead.
## Use (Browser example loading the ES module):

```html
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<title>JSONEditor</title>
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ Or one-way binding:

The library provides a standalone bundle of the editor via the npm library `vanilla-jsoneditor` (instead of `svelte-jsoneditor`) which can be used in any browser environment and framework. In a framework like React, Vue, or Angular, you'll need to write some wrapper code around the class interface.

Note that the `vanilla-jsoneditor` package contains all dependencies. These are purely needed for the TypeScript types that they export.

Browser example loading the ES module:

```html
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<title>JSONEditor</title>
Expand Down Expand Up @@ -421,7 +423,7 @@ Note that most methods are asynchronous and will resolve after the editor is re-
- Typeguards:
- `isContentParseError`
- `isContentValidationErrors`
- Functions from [`immutable-json-patch`](https://github.com/josdejong/immutable-json-patch/):
- More: you can install [`immutable-json-patch`](https://github.com/josdejong/immutable-json-patch/) and use its functions:
- `immutableJSONPatch`
- `revertJSONPatch`
- `parseJSONPointer`
Expand Down
2 changes: 1 addition & 1 deletion examples/browser/basic_usage.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion examples/browser/custom_theme_color.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion examples/browser/json_schema_validation.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion examples/browser/toggle_options.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
Loading

0 comments on commit 4d0451e

Please sign in to comment.