Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use JSX automatic import transform #258

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"morgan": "1.10.0",
"preact": "10.22.0",
"preact-render-to-string": "6.5.3",
"react": "npm:@preact/compat",
"serve-favicon": "2.5.0"
},
"devDependencies": {
Expand Down
4 changes: 3 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ const serverBundle = {
'node:http',
'preact',
'preact-render-to-string',
'preact/hooks'
'preact/hooks',
'react/jsx-runtime'
],
watch: {
clearScreen: false
},
plugins: [
esbuild({
jsx: 'automatic',
jsxFactory: 'h',
jsxFragment: 'Fragment'
}),
Expand Down
2 changes: 0 additions & 2 deletions src/components/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { Footer, Head, Header, InstanceLabel, Navigation, PageSubtitle, PageTitle } from './index.js';
import { CurrentPath } from '../contexts/index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedCoEntities.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { Entities } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedDate.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { formatDate } from '../lib/format-date.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedDepictions.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

const AppendedDepictions = props => {

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedEmployerCompany.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { CommaSeparatedInstanceLinks, InstanceLink } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedEntities.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { Entities } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedFormatAndYear.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

const AppendedFormatAndYear = props => {

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedMembers.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { CommaSeparatedInstanceLinks } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedPerformers.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { InstanceLink, JoinedRoles } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedProductionDates.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { formatDate } from '../lib/format-date.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedProductionTeamCredits.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { AppendedCoEntities, AppendedEmployerCompany, AppendedMembers } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedQualifier.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

const AppendedQualifier = props => {

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedRoles.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { JoinedRoles } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/AppendedVenue.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { VenueLinkWithContext } from './index.js';

Expand Down
2 changes: 0 additions & 2 deletions src/components/CharactersList.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { AppendedQualifier, InstanceLink, ListWrapper } from './index.js';

const CharactersList = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommaSeparatedInstanceLinks.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { InstanceLink } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/CommaSeparatedMaterials.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { MaterialLinkWithContext } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/CommaSeparatedProductions.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { ProductionLinkWithContext } from './index.js';

Expand Down
2 changes: 0 additions & 2 deletions src/components/CreativeProductionsList.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { AppendedProductionTeamCredits, ProductionLinkWithContext, ListWrapper } from './index.js';

const CreativeProductionsList = props => {
Expand Down
2 changes: 0 additions & 2 deletions src/components/CrewProductionsList.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { AppendedProductionTeamCredits, ProductionLinkWithContext, ListWrapper } from './index.js';

const CrewProductionsList = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Entities.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { AppendedMembers, InstanceLink } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/FestivalLinkWithContext.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { InstanceLink, PrependedSurInstance } from './index.js';

Expand Down
2 changes: 0 additions & 2 deletions src/components/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

const Footer = () => {

return (
Expand Down
2 changes: 0 additions & 2 deletions src/components/Head.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

const Head = props => {

const { documentTitle } = props;
Expand Down
2 changes: 0 additions & 2 deletions src/components/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

const Header = () => {

return (
Expand Down
2 changes: 0 additions & 2 deletions src/components/InstanceFacet.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

const InstanceFacet = props => {

const { labelText, children } = props;
Expand Down
2 changes: 0 additions & 2 deletions src/components/InstanceLabel.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { MODEL_TO_DISPLAY_NAME_MAP } from '../utils/constants.js';

const InstanceLabel = props => {
Expand Down
1 change: 0 additions & 1 deletion src/components/InstanceLink.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars
import { useContext } from 'preact/hooks';

import { CurrentPath } from '../contexts/index.js';
Expand Down
2 changes: 0 additions & 2 deletions src/components/InstanceLinksList.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { InstanceLink, ListWrapper } from './index.js';

const InstanceLinksList = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/JoinedRoles.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { AppendedQualifier, InstanceLink } from './index.js';

Expand Down
2 changes: 0 additions & 2 deletions src/components/ListWrapper.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

const ListWrapper = props => {

const { children } = props;
Expand Down
2 changes: 1 addition & 1 deletion src/components/MaterialLinkWithContext.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { AppendedFormatAndYear, InstanceLink, PrependedSurInstance, WritingCredits } from './index.js';

Expand Down
2 changes: 0 additions & 2 deletions src/components/MaterialsList.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { ListWrapper, MaterialLinkWithContext } from './index.js';

const MaterialsList = props => {
Expand Down
2 changes: 0 additions & 2 deletions src/components/Navigation.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

const Navigation = () => {

return (
Expand Down
2 changes: 0 additions & 2 deletions src/components/PageSubtitle.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

const PageSubtitle = props => {

const { text } = props;
Expand Down
2 changes: 0 additions & 2 deletions src/components/PageTitle.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

const PageTitle = props => {

const { text } = props;
Expand Down
2 changes: 1 addition & 1 deletion src/components/PrependedSurInstance.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { InstanceLink } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ProducerCredits.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { ProducerEntities } from './index.js';
import { capitalise } from '../lib/strings.js';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProducerEntities.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { CommaSeparatedInstanceLinks, InstanceLink } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ProducerProductionsList.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { ProducerCredits, ProductionLinkWithContext, ListWrapper } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ProductionLinkWithContext.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { AppendedProductionDates, AppendedVenue, InstanceLink, PrependedSurInstance } from './index.js';

Expand Down
2 changes: 0 additions & 2 deletions src/components/ProductionTeamCreditsList.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { AppendedEntities, ListWrapper } from './index.js';

const ProductionTeamCreditsList = props => {
Expand Down
2 changes: 0 additions & 2 deletions src/components/ProductionsList.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { ListWrapper, ProductionLinkWithContext } from './index.js';

const ProductionsList = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/VenueLinkWithContext.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { InstanceLink, PrependedSurInstance } from './index.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/WritingCredits.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { WritingEntities } from './index.js';
import { capitalise } from '../lib/strings.js';
Expand Down
2 changes: 1 addition & 1 deletion src/components/WritingEntities.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { AppendedFormatAndYear, InstanceLink, PrependedSurInstance, WritingCredits } from './index.js';

Expand Down
1 change: 0 additions & 1 deletion src/controllers/helpers/render-component-to-string.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars
import render from 'preact-render-to-string';

const renderComponentToString = (PageComponent, props) => {
Expand Down
2 changes: 0 additions & 2 deletions src/pages/ErrorPage.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { App } from '../components/index.js';

const ErrorPage = props => {
Expand Down
2 changes: 0 additions & 2 deletions src/pages/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { App } from '../components/index.js';

const Home = props => {
Expand Down
2 changes: 0 additions & 2 deletions src/pages/instances/Award.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { App, InstanceFacet, InstanceLinksList } from '../../components/index.js';

const Award = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/instances/AwardCeremony.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import {
App,
Expand Down
2 changes: 0 additions & 2 deletions src/pages/instances/Character.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import {
App,
AppendedDepictions,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/instances/Company.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import {
App,
Expand Down
2 changes: 0 additions & 2 deletions src/pages/instances/Festival.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { App, InstanceFacet, InstanceLink, ProductionsList } from '../../components/index.js';

const Festival = props => {
Expand Down
2 changes: 0 additions & 2 deletions src/pages/instances/FestivalSeries.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { App, InstanceFacet, InstanceLinksList } from '../../components/index.js';

const FestivalSeries = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/instances/Material.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import {
App,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/instances/Person.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import {
App,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/instances/Production.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import {
App,
Expand Down
2 changes: 0 additions & 2 deletions src/pages/instances/Season.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { App, InstanceFacet, ProductionsList } from '../../components/index.js';

const Season = props => {
Expand Down
2 changes: 0 additions & 2 deletions src/pages/instances/Venue.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { App, InstanceFacet, InstanceLink, InstanceLinksList, ProductionsList } from '../../components/index.js';

const Venue = props => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/lists/AwardCeremonies.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fragment, h } from 'preact'; // eslint-disable-line no-unused-vars
import { Fragment } from 'preact';

import { App, InstanceLink, ListWrapper } from '../../components/index.js';

Expand Down
2 changes: 0 additions & 2 deletions src/pages/lists/Awards.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { h } from 'preact'; // eslint-disable-line no-unused-vars

import { App, InstanceLinksList } from '../../components/index.js';

const Awards = props => {
Expand Down
Loading