파란하늘의 지식창고
browser에서 dayjs 사용해 보기
Study/JavaScript 2024. 3. 28. 20:20

Dayjs 소개 기존에 Date 관련 라이브러리 중 가장 많이 사용하였던 momentjs는 현재 더 이상 개발되지 않고 있다. https://momentjs.com/ 이를 대체할 라이브러리로 date-fns, dayjs, luxon 등이 있으며 이전에 date-fns를 사용해 보았다. dayjs가 가장 가볍다고 한다. https://day.js.org/docs/en/installation/browser https://suzzeong.tistory.com/115 현재 ECMAScript에서는 현재 기본으로 사용되는 범용성이 떨어지는 Date API를 대체할 Temporal API를 준비 중이지만 아직 정식 버전이 아닌 상태이다. https://github.com/tc39/proposals 이후 표준 명세에..

JDK 22 New Features
Study/Java 2024. 3. 21. 17:51

JDK의 버전별 변경 사항은 여기를 참고하세요 Spec Java SE 22 Platform JSR 397 에 정의된 바와 같이 JSR 397 구현이 목표 실제 Spec은 Final Release Specification 문서를 참고 Final Release Specification Feature Summary 전체 JEP Feature 목록은 OpenJDK의 JDK 22 문서 에서 확인할 수 있다. JEP Component Feature JEP 423 hotspot / gc Region Pinning for G1 JEP 447 specification / language Statements before super(...) (Preview) JEP 454 Foreign Function & Memory AP..

article thumbnail
Argo CD 사용해 보기
Study/CI&CD 2024. 3. 19. 04:02

Argo CD 소개 ArgoCD는 Kubernetes를 위한 GitOps CD 도구이다. Spinnaker처럼 여러 cloud platform을 지원하기 위한 cloud provider를 제공하지 않는다. 동작 자체가 매우 간단하기 때문에 사용하기 편하다. kubernetes 관련 설정을 git이나 helm repository에 등록하고 Argo CD에서 이 git이나 helm repository를 등록하면 kubernetes에 해당 설정을 반영한다. auto-sync를 지원하기 때문에 등록된 git이나 helm에 변경 사항이 push 되면 Argo CD가 해당 변경을 반영해 준다. 또한 Argo CD 자체가 Kubernetes에 설치되어 동작하기 때문에 kubernetes 관련 연결 설정을 하지 않아도..

article thumbnail
Eclipse (STS) 에서 Parameter Name Hint 사용하기
Study/Java 2024. 3. 8. 00:53

IntelliJ는 편집기에 호출된 method에 필요한 annotation, method parameter, 사용법 등을 알려주는 추가 정보를 제공하는 특수한 marker를 제공하는 데 이를 Inlay Hint 라고 부르고 있다. https://www.jetbrains.com/help/idea/inlay-hints.html#enable_inlay_hints Inlay hints | IntelliJ IDEA www.jetbrains.com 다음과 같이 method parameter앞에 전달할 값의 Parameter Name이 무엇인지 확인할 수 있다. 이런 기능이 Eclipse에 없어서 아쉬웠는데 알고 보니 Eclipse도 4.12 (2019-06)부터 IntelliJ의 Inlay Hint 의 모든 기능은..

Spring ApplicationContext에서 GenericType 기준으로 bean 호출하기
Study/Java 2024. 3. 6. 00:33

다음과 같은 interface를 구현한 @FunctionalInterface public interface ServiceSupplier { T findOne(SomeParameter someParameter); } @FunctionalInterface public interface ServiceListSupplier { List findList(SomeParameter someParameter); } 다음과 같은 service가 있다고 가정해 보자. @Service public class SomeService implements ServiceSupplier, ServiceListSupplier { @Override public SomeObject findOne(SomeParameter someParame..

article thumbnail
Thymeleaf에서 DaisyUI Theme 사용해 보기
Study/Java 2024. 2. 9. 03:18

이전에 Spring Boot 기반의 프로젝트에서 Thymeleaf와 함께 Tailwind CSS를 사용하는 방법에 대해 소개하였었다. 2023.11.16 - [Study/Java] - Spring Boot + Thymeleaf + Tailwind CSS 사용해보기 DaisyUI 소개 Tailwind CSS가 bootstrap보다 자유도가 높은 대신 많은 설정이 필요하기 때문에 이를 보완하기 위해 Daisy UI를 사용하였다. DaisyUI는 Tailwind CSS기반에서 Bootstrap의 component 단위(Button, Form, Menu 같은...)의 CSS를 제공해 준다. 따라서 Component 단위로는 Tailwind CSS를 사용하면서 그 외의 CSS 설정은 Tailwind CSS를 같이..

Spring의 SpEL 을 custom하게 사용해 보기
Study/Java 2024. 2. 5. 00:20

Spring은 SpEL (Spring Expression Language)를 제공하고 있다. Spring Expression Language (SpEL) RequestMapping이나 value binding 등 Spring을 사용하는 수많은 부분에 SpEL을 사용할 수 있고 다양한 기능을 지원한다. Literal expressions Boolean and relational operators Regular expressions Class expressions Accessing properties, arrays, lists, and maps Method invocation Assignment Calling constructors Bean references Array construction Inline ..

@ConfigurationProperties를 사용하지 않고 method 내에서 properties의 변수 binding 하기
Study/Java 2024. 2. 4. 14:05

Spring Boot에서 @ConfigurationProperties를 사용하지 않고 method 내에서 Binder class를 사용해서 environment의 지정된 값들을 지정된 객체에 binding 할 수 있다. Binder class는 Spring Boot 2.0 이후 제공되는 기능이다 property-binding-in-spring-boot-2-0. 다음과 같이 Binder를 사용하여 설정 값을 binding 할 수 있다: @Test void testEnv() { ConfigurableEnvironment environment = new StandardEnvironment(); Map map = new HashMap(); map.put("myapp.database.url", "jdbc:mysq..