diff --git a/CHANGELOG.md b/CHANGELOG.md index 00eff494..dfd484d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.0.31] - 2024-05-20 + +### Fixed + +- Don't `console.warn` on existing tags. You should have full control over your tags. + ## [0.0.29] & [0.0.30] - 2024-05-16 - A mistake was made in the versioning, so these are re-releases of `0.0.28`. The changelog is kept for transparency. diff --git a/src/__tests__/tags.test.ts b/src/__tests__/tags.test.ts index 1351c3a2..be9ea4c0 100644 --- a/src/__tests__/tags.test.ts +++ b/src/__tests__/tags.test.ts @@ -68,31 +68,4 @@ describe('tags.ts', () => { expect(el.$tent.attributes['data-bar']).toBe('baz'); expect(el.$tent.attributes['onClick']).toBe(fn); }); - - test('warns when using a predefined tag when not in production', () => { - const spy = jest.spyOn(console, 'warn').mockImplementation(() => {}); - - createTag(['div', 'test', {}]); - - expect(spy).toHaveBeenCalledWith( - 'Tag "div" is a predefined tag, use tags.div instead', - ); - - spy.mockRestore(); - }); - - test('does not warn when using a predefined tag when in production', () => { - const OLD_ENV = process.env.NODE_ENV; - const spy = jest.spyOn(console, 'warn').mockImplementation(() => {}); - - process.env.NODE_ENV = 'production'; - - createTag(['div', 'test', {}]); - - expect(spy).not.toHaveBeenCalled(); - - spy.mockRestore(); - - process.env.NODE_ENV = OLD_ENV; - }); }); diff --git a/src/tags.ts b/src/tags.ts index 4ed1b9b3..9e188b96 100644 --- a/src/tags.ts +++ b/src/tags.ts @@ -4,10 +4,6 @@ import { type Tags, type Context, type TentNode } from './types'; function createTag(context: Context) { const [tag, children, attributes] = context; - if (tags[tag] && process.env.NODE_ENV !== 'production') { - console.warn(`Tag "${tag}" is a predefined tag, use tags.${tag} instead`); - } - const el = document.createElement(tag) as TentNode; el.$tent = {