Skip to content

Commit

Permalink
chore: jaspr upgraded to 0.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
siesdart committed Jan 15, 2025
1 parent 152bf46 commit c3b3caa
Show file tree
Hide file tree
Showing 23 changed files with 357 additions and 318 deletions.
3 changes: 3 additions & 0 deletions apps/portfolio/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ analyzer:
- lib/**.imports.dart
- lib/**.mapper.dart
- lib/jaspr_options.dart
plugins:
- custom_lint

linter:
rules:
always_use_package_imports: false
lines_longer_than_80_chars: false
public_member_api_docs: false
3 changes: 1 addition & 2 deletions apps/portfolio/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ class App extends StatelessComponent with SyncProviderDependencies {
const App({super.key});

@override
// ignore: strict_raw_type
Iterable<SyncProvider> get preloadDependencies => [projectsProvider];
Iterable<SyncProvider<dynamic>> get preloadDependencies => [projectsProvider];

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
9 changes: 2 additions & 7 deletions apps/portfolio/lib/components/aside.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class Aside extends StatelessComponent with SyncProviderDependencies {
const Aside({super.key});

@override
// ignore: strict_raw_type
Iterable<SyncProvider> get preloadDependencies => [
Iterable<SyncProvider<dynamic>> get preloadDependencies => [
introductionProvider,
skillProvider,
projectsProvider,
Expand Down Expand Up @@ -85,11 +84,7 @@ class Aside extends StatelessComponent with SyncProviderDependencies {
return div(classes: 'flex items-center gap-1 lg:gap-2', [
svg,
if (href != null)
a(
[text(title)],
href: href,
target: Target.blank,
)
a(href: href, target: Target.blank, [text(title)])
else
span([text(title)]),
]);
Expand Down
17 changes: 7 additions & 10 deletions apps/portfolio/lib/components/elements/section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ class Section extends StatelessComponent {
@override
Iterable<Component> build(BuildContext context) sync* {
yield section(id: id, [
a(
[
h4(
classes:
'bg-[#13B9FD] font-medium text-lg text-white mb-4 px-4 py-2 rounded-2xl shadow-md lg:text-xl',
[text(title)],
),
],
href: '#$id',
),
a(href: '#$id', [
h4(
classes:
'bg-[#13B9FD] font-medium text-lg text-white mb-4 px-4 py-2 rounded-2xl shadow-md lg:text-xl',
[text(title)],
),
]),
if (child != null) div(classes: 'px-6', [child!]),
if (children != null)
ul(
Expand Down
4 changes: 2 additions & 2 deletions apps/portfolio/lib/components/footer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ class Footer extends StatelessComponent {
a(
classes:
'text-xs decoration-2 decoration-[#00BCD4] underline underline-offset-8 mx-auto lg:text-sm',
href: 'https://github.com/schultek/jaspr',
target: Target.blank,
[
text('본 홈페이지는 '),
span(classes: 'font-bold', [text('Jaspr')]),
text('를 사용해 제작되었습니다.'),
],
href: 'https://github.com/schultek/jaspr',
target: Target.blank,
),
]);
}
Expand Down
13 changes: 8 additions & 5 deletions apps/portfolio/lib/components/resume.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import 'package:common/common.dart';
import 'package:common/component.dart';
import 'package:jaspr/jaspr.dart';
import 'package:resume/resume.dart';

@Import.onWeb('dart:html', show: [#Blob, #Url, #window])
// ignore: always_use_package_imports
import 'resume.imports.dart';
import 'package:universal_web/js_interop.dart';
import 'package:universal_web/web.dart';

@client
class Resume extends StatelessComponent {
Expand Down Expand Up @@ -52,7 +50,12 @@ class Resume extends StatelessComponent {

Future<void> _downloadPdf(Pdf pdf) async {
final pdfData = await pdf.buildData();
final url = Url.createObjectUrl(Blob([pdfData], 'application/pdf'));
final url = URL.createObjectURL(
Blob(
[pdfData.buffer.toJS].toJS,
BlobPropertyBag(type: 'application/pdf'),
),
);
window.open(url, '_blank');
}
}
5 changes: 0 additions & 5 deletions apps/portfolio/lib/components/resume.imports.dart

This file was deleted.

4 changes: 2 additions & 2 deletions apps/portfolio/lib/components/sections/introduction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class Introduction extends StatelessComponent with SyncProviderDependencies {
const Introduction({super.key});

@override
// ignore: strict_raw_type
Iterable<SyncProvider> get preloadDependencies => [introductionProvider];
Iterable<SyncProvider<dynamic>> get preloadDependencies =>
[introductionProvider];

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
3 changes: 1 addition & 2 deletions apps/portfolio/lib/components/sections/project.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class Project extends StatelessComponent with SyncProviderDependencies {
const Project({super.key});

@override
// ignore: strict_raw_type
Iterable<SyncProvider> get preloadDependencies => [projectsProvider];
Iterable<SyncProvider<dynamic>> get preloadDependencies => [projectsProvider];

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
3 changes: 1 addition & 2 deletions apps/portfolio/lib/components/sections/skill.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class Skill extends StatelessComponent with SyncProviderDependencies {
const Skill({super.key});

@override
// ignore: strict_raw_type
Iterable<SyncProvider> get preloadDependencies => [skillProvider];
Iterable<SyncProvider<dynamic>> get preloadDependencies => [skillProvider];

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
5 changes: 0 additions & 5 deletions apps/portfolio/lib/generated/imports/_stubs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@

// ignore_for_file: directives_ordering, non_constant_identifier_names

dynamic Blob;
dynamic Url;
dynamic window;
typedef BlobOrStubbed = dynamic;
typedef UrlOrStubbed = dynamic;
dynamic Directory;
dynamic File;
typedef DirectoryOrStubbed = dynamic;
Expand Down
10 changes: 0 additions & 10 deletions apps/portfolio/lib/generated/imports/_web.dart

This file was deleted.

6 changes: 3 additions & 3 deletions apps/portfolio/lib/pages/project_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ class ProjectDetailPage extends StatelessComponent {
classes: 'size-2 lg:size-3',
styles: Styles.raw({'fill': '#${project.color}'}),
viewBox: '0 0 16 16',
[circle([], cx: '8', cy: '8', r: '8')],
[circle(cx: '8', cy: '8', r: '8', [])],
),
h4(
classes: 'font-medium text-lg lg:text-xl',
[text(project.title)],
),
a(
classes: project.repo == null ? 'pointer-events-none' : '',
href: 'https://github.com/${project.repo}',
target: Target.blank,
[
svg(
classes:
Expand All @@ -50,8 +52,6 @@ class ProjectDetailPage extends StatelessComponent {
SvgIcons.github,
),
],
href: 'https://github.com/${project.repo}',
target: Target.blank,
),
if (project.repo != null)
img(
Expand Down
3 changes: 1 addition & 2 deletions apps/portfolio/lib/pages/project_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ class ProjectListPage extends StatelessComponent with SyncProviderDependencies {
const ProjectListPage({super.key});

@override
// ignore: strict_raw_type
Iterable<SyncProvider> get preloadDependencies => [projectsProvider];
Iterable<SyncProvider<dynamic>> get preloadDependencies => [projectsProvider];

@override
Iterable<Component> build(BuildContext context) sync* {
Expand Down
1 change: 0 additions & 1 deletion apps/portfolio/lib/providers/content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:path/path.dart' as p;
import 'package:yaml/yaml.dart';

@Import.onServer('dart:io', show: [#Directory, #File])
// ignore: always_use_package_imports
import 'content.imports.dart';

final introductionProvider = SyncProvider<String>(
Expand Down
2 changes: 1 addition & 1 deletion apps/portfolio/lib/providers/content.imports.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// GENERATED FILE, DO NOT MODIFY
// Generated with jaspr_builder

export '../generated/imports/_vm.dart' if (dart.library.html) '../generated/imports/_stubs.dart'
export '../generated/imports/_vm.dart' if (dart.library.js_interop) '../generated/imports/_stubs.dart'
show Directory, File, DirectoryOrStubbed, FileOrStubbed;
Loading

0 comments on commit c3b3caa

Please sign in to comment.