본문 바로가기

Document 해석/PUG

Jade에서 Pug 2로 마이그레이션(이동) - 1

728x90
반응형
이 글은 NodeJS 템플릿 엔진인 Pug의 document를 해석한 글입니다.
영어 원문은 아래 바로가기를 클릭하거나 현재 글의 해석 아래 더보기를 클릭 시 확인하실 수 있습니다.
오타나 잘못된 해석은 댓글로 알려주시면 정정하겠습니다.

현재 페이지 본문 바로가기

Pug 2는 2016년 8월에 출시되었습니다. 새로운 릴리즈가 가능하도록 개선하기 위해 일부 API와 문서화되지 않은 언어 기능을 더이상 사용하지 않거나 제거하기로 결정해야 했습니다. 우리는 이러한 변경 사항이 가능한 한 방해가 되지 않게 만들기 위해 노력하였고, 이러한 변경 사항 중 상당수가 이전에 콘솔 경고에서 권장되지 않았습니다.

이 글에서는 애플리케이션을 Jade에서 Pug v2로 변환하는 방법에 대하여 자세히 설명합니다.

더보기

Pug 2 was released in August 2016. To make improvements in the new release possible, we had to make the decision of deprecating or removing some APIs and undocumented language features. We made an effort to make these changes as unintrusive as possible, and many of these changes were previously discouraged in console warnings.

This article details how you can convert your application to Pug v2 from Jade.

프로젝트 이름 변경

상표 문제로 인해 프로젝트 이름이 Pug 2 릴리즈와 함께 "Jade"에서 "Pug"로 변경되었습니다. 이것은 또한 공식적으로 지원되는 파일 확장자명을 .jade에서 .pug로 변경했음을 의미합니다. 여전히 .jade는 지원되지만 사용되지 않습니다. 모든 사용자는 즉시 .pug로 전환할 것을 권장합니다.

더보기

Due to a trademark issue, the project name has been changed from “Jade” to “Pug” in conjunction with the release of Pug 2. This also means that we have changed the official supported file extension from .jade to .pug. Although .jade is still supported, it is deprecated. All users are encouraged to transition to .pug immediately.

제거된 언어 특징

대부분의 이런 제거 작업은 당사의 공식 linter인 pug-linter에 의해 자동으로 탐지될 수 있습니다.

더보기

Most of these removals can be automatically detected by pug-lint, our official linter.

레거시 mixin 호출

//- old

mixin foo('whatever')

//- new

+foo('whatever')

선언과 호출을 쉽게 구분할 수 있도록 mixin을 호출하는 기존 구문을 제거했습니다.

(이전 구문을 사용할 때마다 Jade v1에서 경고가 발생했습니다.)

더보기

We removed the legacy syntax for calling a mixin to make it easier to differentiate between declarations and calls. (All uses of the old syntax caused warnings in Jade v1.)

속성 보간(attribute Interpolation)

//- old

a(href='#{link}')

a(href='before#{link}after')

//- new

a(href=link)

//- (on Node.js/io.js ≥ 1.0.0)
a(href=`before${link}after`) 
//- (everywhere)
a(href='before' + link + 'after')

구현이 불필요하게 복잡하고, 사용자가 속성 대신 JavaScript 값만을 사용할 수 있다는 것을 배우지 못하게 하는 경향이 있는 속성 내 보간(interpolation) 지원을 제거했습니다. 속성 구문에 대한 자세한 내용은 속성 document를 참조하세요.

더보기

We removed support for interpolation in attributes since the implementation was unnecessarily complex, and the feature tended to discourage users from learning that they can just use any JavaScript value in place of attributes. Check our attribute documentation for more information on attribute syntax.

 

728x90
반응형

'Document 해석 > PUG' 카테고리의 다른 글

Pug(Jade)의 method, properties  (0) 2021.01.16
Pug(Jade)의 옵션  (0) 2021.01.14
Pug(Jade)의 Express 통합  (0) 2021.01.12
NodeJS 템플릿 엔진 Pug(Jade) 시작하기  (0) 2021.01.12