Skip to content

Commit

Permalink
Upgrade svelte to 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
thelgevold committed May 25, 2019
1 parent bd83ffa commit eedae70
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 243 deletions.
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ http_archive(

http_archive(
name = "build_bazel_rules_svelte",
url = "https://github.com/thelgevold/rules_svelte/archive/0.1.zip",
strip_prefix = "rules_svelte-0.1",
sha256 = "700a19d6d503500bd8dc190d7e29588c16867c2e163d7c8a883879ff602ef527"
url = "https://github.com/thelgevold/rules_svelte/archive/0.5.zip",
strip_prefix = "rules_svelte-0.5",
sha256 = "b3008800db1c9c2a5f88201613de82f2d2a57ac65fb209d6f04ea2accfca9385"
)

load("@build_bazel_rules_nodejs//:defs.bzl", "node_repositories", "yarn_install")
Expand Down
2 changes: 1 addition & 1 deletion rules/vendor/vendor.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _vendor_bundle(ctx):

argsUglify = ctx.actions.args()
argsUglify.add(ctx.outputs.vendor.path)
argsUglify.add(["--output", ctx.outputs.vendor_min.path])
argsUglify.add_all(["--output", ctx.outputs.vendor_min.path])

ctx.action(
executable = ctx.executable._uglify,
Expand Down
43 changes: 8 additions & 35 deletions src/apps/svelte-demo/App.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,11 @@
<div>
<h1>{title}</h1>

<h4>Grid</h4>
<Grid></Grid>
<h1>{title}</h1>

<h4>Treeview</h4>
<Treeview locations='{locations}'></Treeview>
<h4>Friends</h4>
<Friends></Friends>
</div>

<h4>Friends</h4>
<Friends></Friends>
</div>

<script>
import Grid from './grid/grid';
import Treeview from './treeview/treeview';
import Friends from './friends/friends'

import { LocationService } from './treeview/location-service';

let locationService = new LocationService();
let locations = locationService.getLocations();

export default {
data () {
return {
title: 'Svelte',
locations: locations
}
},

components: {
Treeview,
Grid,
Friends
}
};
</script>
<script>
import Friends from './friends/Friends.svelte';
let title = 'Svelte';
</script>
16 changes: 3 additions & 13 deletions src/apps/svelte-demo/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
package(default_visibility = ["//visibility:public"])
load("@build_bazel_rules_svelte//:defs.bzl", "svelte", "bundle_dev")
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_binary")

svelte(
name = "app",
name = "App",
srcs = ["main.js"],
entry_point = "App.html",
deps = ["//src/apps/svelte-demo/treeview",
"//src/apps/svelte-demo/grid",
"//src/apps/svelte-demo/friends"
]
)
sass_binary(
name = "styles",
src = "app.scss",
deps = [
"//src/apps/svelte-demo/styles"
"//src/apps/svelte-demo/friends:Friends"
]
)

bundle_dev(
name = "bundle_svelte",
entry_point = "main.js",
deps = [
":app",
":styles"
":App"
],
)
10 changes: 5 additions & 5 deletions src/apps/svelte-demo/friends/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package(default_visibility = ["//visibility:public"])
load("@build_bazel_rules_svelte//:defs.bzl", "svelte")

svelte(
name = "friend",
entry_point = "Friend.html"
name = "Friend",
entry_point = "Friend.svelte"
)

svelte(
name = "friends",
name = "Friends",
srcs = ["friends-service.js"],
entry_point = "Friends.html",
deps = [":friend"]
entry_point = "Friends.svelte",
deps = [":Friend"]
)
15 changes: 0 additions & 15 deletions src/apps/svelte-demo/friends/Friend.html

This file was deleted.

9 changes: 9 additions & 0 deletions src/apps/svelte-demo/friends/Friend.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<div>
<div class="friend">
{friend}
</div>
</div>

<script>
export let friend;
</script>
28 changes: 0 additions & 28 deletions src/apps/svelte-demo/friends/Friends.html

This file was deleted.

17 changes: 17 additions & 0 deletions src/apps/svelte-demo/friends/Friends.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div>
{#each friends as f}
<Friend friend="{f}"></Friend>
{/each}
</div>
<script>
import {onMount} from 'svelte';
import {FriendsService} from './friends-service';
import Friend from './Friend.svelte';
let friendsService = new FriendsService();
let friends = [];
onMount(async () => {
friends = await friendsService.getFriends();
});
</script>
7 changes: 0 additions & 7 deletions src/apps/svelte-demo/grid/BUILD.bazel

This file was deleted.

64 changes: 0 additions & 64 deletions src/apps/svelte-demo/grid/Grid.html

This file was deleted.

8 changes: 5 additions & 3 deletions src/apps/svelte-demo/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import App from './app';
import App from './App.svelte';

var demoApp = new App({
target: document.querySelector( 'main' )
});
target: document.querySelector('main'),
});

export default demoApp;
8 changes: 0 additions & 8 deletions src/apps/svelte-demo/styles/BUILD.bazel

This file was deleted.

7 changes: 0 additions & 7 deletions src/apps/svelte-demo/styles/shared.scss

This file was deleted.

8 changes: 0 additions & 8 deletions src/apps/svelte-demo/treeview/BUILD.bazel

This file was deleted.

11 changes: 0 additions & 11 deletions src/apps/svelte-demo/treeview/Treeview.html

This file was deleted.

19 changes: 0 additions & 19 deletions src/apps/svelte-demo/treeview/location-service.js

This file was deleted.

16 changes: 0 additions & 16 deletions src/apps/svelte-demo/treeview/location.js

This file was deleted.

0 comments on commit eedae70

Please sign in to comment.