Skip to content
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
76524db
local environment
kimurash Mar 20, 2026
99d4f4a
webpack production mode
kimurash Mar 20, 2026
ba376b4
devtool source map
kimurash Mar 20, 2026
955f667
enable minimization
kimurash Mar 20, 2026
2fa4ed0
split chunks
kimurash Mar 20, 2026
afdbd37
produciton build
kimurash Mar 20, 2026
f25e36c
lazy container loading
kimurash Mar 20, 2026
b88d0fc
limit syntax highlighter language
kimurash Mar 20, 2026
70fb9a4
only support modern browser
kimurash Mar 20, 2026
df85f86
local environment by mise
kimurash Mar 20, 2026
784d485
add test command
kimurash Mar 29, 2026
8ab1f7f
remove fetcher async false
kimurash Mar 29, 2026
fb1f783
remove 2 ** 18 hasReached loop
kimurash Mar 29, 2026
3120d1e
install webpack bundle analyzer
kimurash Mar 29, 2026
16d571c
uninstall ffmpeg packages
kimurash Mar 29, 2026
8d04072
install ffmpeg in Dockerfile
kimurash Mar 29, 2026
5850de6
replace GIF-based movie rendering with native HTML5 video
kimurash Mar 29, 2026
84ab51c
add media transcode utility
kimurash Mar 29, 2026
67a6442
change movie.ts
kimurash Mar 29, 2026
e840c5b
change sound.ts
kimurash Mar 29, 2026
b56a09d
convert gif to mp4
kimurash Mar 29, 2026
c061336
add application url option to scoring start command
kimurash Mar 29, 2026
a2419d9
install sharp & exifr
kimurash Mar 29, 2026
24d6852
add width & height to image model
kimurash Mar 29, 2026
cc9a05c
generate image seed
kimurash Mar 29, 2026
be60387
insert image seed
kimurash Mar 29, 2026
b00f03c
change image post handler
kimurash Mar 29, 2026
396be1b
change image schema & type definition
kimurash Mar 29, 2026
d664a78
uninstall imagemagick
kimurash Mar 29, 2026
2f54ab8
change client image implementation
kimurash Mar 29, 2026
5208546
install necessary packages
kimurash Mar 30, 2026
9ed05d5
add sentiment api
kimurash Mar 30, 2026
10b7aff
change client negaposi-analyzer
kimurash Mar 30, 2026
a3eb27d
uninstall unnecessary packages
kimurash Mar 30, 2026
d8c08cc
recover necessary packages
kimurash Mar 30, 2026
814e803
install tailwind & postcss plugin
kimurash Mar 30, 2026
40936e8
build tailwind
kimurash Mar 30, 2026
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
8 changes: 4 additions & 4 deletions application/client/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ module.exports = {
[
"@babel/preset-env",
{
targets: "ie 11",
targets: "> 0.5%, last 2 versions, Firefox ESR, not dead",
corejs: "3",
modules: "commonjs",
useBuiltIns: false,
modules: false,
useBuiltIns: "usage",
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@babel/preset-env is now configured with useBuiltIns: "usage", but the webpack entry still imports core-js (and regenerator-runtime/runtime). Keeping core-js in the entry typically pulls in a large global polyfill bundle and can duplicate polyfills, largely negating the benefit of usage. Either remove the core-js (and possibly regenerator) entries and rely on usage, or revert to an entry-based polyfill strategy (e.g., useBuiltIns: false/entry) so the configuration is consistent.

Suggested change
useBuiltIns: "usage",
useBuiltIns: "entry",

Copilot uses AI. Check for mistakes.
},
],
[
"@babel/preset-react",
{
development: true,
development: false,
runtime: "automatic",
},
],
Expand Down
2 changes: 1 addition & 1 deletion application/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MPL-2.0",
"author": "CyberAgent, Inc.",
"scripts": {
"build": "NODE_ENV=development webpack",
"build": "NODE_ENV=production webpack",
"typecheck": "tsc"
},
"dependencies": {
Expand Down
16 changes: 15 additions & 1 deletion application/client/src/components/crok/CodeBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
import { ComponentProps, isValidElement, ReactElement, ReactNode } from "react";
import SyntaxHighlighter from "react-syntax-highlighter";
import { Light as SyntaxHighlighter } from "react-syntax-highlighter";
import bash from "react-syntax-highlighter/dist/esm/languages/hljs/bash";
import css from "react-syntax-highlighter/dist/esm/languages/hljs/css";
import javascript from "react-syntax-highlighter/dist/esm/languages/hljs/javascript";
import json from "react-syntax-highlighter/dist/esm/languages/hljs/json";
import markdown from "react-syntax-highlighter/dist/esm/languages/hljs/markdown";
import typescript from "react-syntax-highlighter/dist/esm/languages/hljs/typescript";
import { atomOneLight } from "react-syntax-highlighter/dist/esm/styles/hljs";

SyntaxHighlighter.registerLanguage("javascript", javascript);
SyntaxHighlighter.registerLanguage("typescript", typescript);
SyntaxHighlighter.registerLanguage("tsx", typescript);
SyntaxHighlighter.registerLanguage("css", css);
SyntaxHighlighter.registerLanguage("bash", bash);
SyntaxHighlighter.registerLanguage("markdown", markdown);
SyntaxHighlighter.registerLanguage("json", json);

const getLanguage = (children: ReactElement<ComponentProps<"code">>) => {
const className = children.props.className;
if (typeof className === "string") {
Expand Down
125 changes: 89 additions & 36 deletions application/client/src/containers/AppContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,70 @@
import { useCallback, useEffect, useId, useState } from "react";
import { lazy, Suspense, useCallback, useEffect, useId, useState } from "react";
import { Helmet, HelmetProvider } from "react-helmet";
import { Route, Routes, useLocation, useNavigate } from "react-router";

import { AppPage } from "@web-speed-hackathon-2026/client/src/components/application/AppPage";
import { AuthModalContainer } from "@web-speed-hackathon-2026/client/src/containers/AuthModalContainer";
import { CrokContainer } from "@web-speed-hackathon-2026/client/src/containers/CrokContainer";
import { DirectMessageContainer } from "@web-speed-hackathon-2026/client/src/containers/DirectMessageContainer";
import { DirectMessageListContainer } from "@web-speed-hackathon-2026/client/src/containers/DirectMessageListContainer";
import { NewPostModalContainer } from "@web-speed-hackathon-2026/client/src/containers/NewPostModalContainer";
import { NotFoundContainer } from "@web-speed-hackathon-2026/client/src/containers/NotFoundContainer";
import { PostContainer } from "@web-speed-hackathon-2026/client/src/containers/PostContainer";
import { SearchContainer } from "@web-speed-hackathon-2026/client/src/containers/SearchContainer";
import { TermContainer } from "@web-speed-hackathon-2026/client/src/containers/TermContainer";
import { TimelineContainer } from "@web-speed-hackathon-2026/client/src/containers/TimelineContainer";
import { UserProfileContainer } from "@web-speed-hackathon-2026/client/src/containers/UserProfileContainer";
import { fetchJSON, sendJSON } from "@web-speed-hackathon-2026/client/src/utils/fetchers";

const AuthModalContainer = lazy(() =>
import("@web-speed-hackathon-2026/client/src/containers/AuthModalContainer").then((module) => ({
default: module.AuthModalContainer,
})),
);
const CrokContainer = lazy(() =>
import("@web-speed-hackathon-2026/client/src/containers/CrokContainer").then((module) => ({
default: module.CrokContainer,
})),
);
const DirectMessageContainer = lazy(() =>
import("@web-speed-hackathon-2026/client/src/containers/DirectMessageContainer").then(
(module) => ({
default: module.DirectMessageContainer,
}),
),
);
const DirectMessageListContainer = lazy(() =>
import("@web-speed-hackathon-2026/client/src/containers/DirectMessageListContainer").then(
(module) => ({
default: module.DirectMessageListContainer,
}),
),
);
const NewPostModalContainer = lazy(() =>
import("@web-speed-hackathon-2026/client/src/containers/NewPostModalContainer").then((module) => ({
default: module.NewPostModalContainer,
})),
);
const NotFoundContainer = lazy(() =>
import("@web-speed-hackathon-2026/client/src/containers/NotFoundContainer").then((module) => ({
default: module.NotFoundContainer,
})),
);
const PostContainer = lazy(() =>
import("@web-speed-hackathon-2026/client/src/containers/PostContainer").then((module) => ({
default: module.PostContainer,
})),
);
const SearchContainer = lazy(() =>
import("@web-speed-hackathon-2026/client/src/containers/SearchContainer").then((module) => ({
default: module.SearchContainer,
})),
);
const TermContainer = lazy(() =>
import("@web-speed-hackathon-2026/client/src/containers/TermContainer").then((module) => ({
default: module.TermContainer,
})),
);
const TimelineContainer = lazy(() =>
import("@web-speed-hackathon-2026/client/src/containers/TimelineContainer").then((module) => ({
default: module.TimelineContainer,
})),
);
const UserProfileContainer = lazy(() =>
import("@web-speed-hackathon-2026/client/src/containers/UserProfileContainer").then((module) => ({
default: module.UserProfileContainer,
})),
);

export const AppContainer = () => {
const { pathname } = useLocation();
const navigate = useNavigate();
Expand Down Expand Up @@ -61,32 +110,36 @@ export const AppContainer = () => {
newPostModalId={newPostModalId}
onLogout={handleLogout}
>
<Routes>
<Route element={<TimelineContainer />} path="/" />
<Route
element={
<DirectMessageListContainer activeUser={activeUser} authModalId={authModalId} />
}
path="/dm"
/>
<Route
element={<DirectMessageContainer activeUser={activeUser} authModalId={authModalId} />}
path="/dm/:conversationId"
/>
<Route element={<SearchContainer />} path="/search" />
<Route element={<UserProfileContainer />} path="/users/:username" />
<Route element={<PostContainer />} path="/posts/:postId" />
<Route element={<TermContainer />} path="/terms" />
<Route
element={<CrokContainer activeUser={activeUser} authModalId={authModalId} />}
path="/crok"
/>
<Route element={<NotFoundContainer />} path="*" />
</Routes>
<Suspense fallback={<div className="p-4 text-center">読み込み中...</div>}>
<Routes>
<Route element={<TimelineContainer />} path="/" />
<Route
element={
<DirectMessageListContainer activeUser={activeUser} authModalId={authModalId} />
}
path="/dm"
/>
<Route
element={<DirectMessageContainer activeUser={activeUser} authModalId={authModalId} />}
path="/dm/:conversationId"
/>
<Route element={<SearchContainer />} path="/search" />
<Route element={<UserProfileContainer />} path="/users/:username" />
<Route element={<PostContainer />} path="/posts/:postId" />
<Route element={<TermContainer />} path="/terms" />
<Route
element={<CrokContainer activeUser={activeUser} authModalId={authModalId} />}
path="/crok"
/>
<Route element={<NotFoundContainer />} path="*" />
</Routes>
</Suspense>
</AppPage>

<AuthModalContainer id={authModalId} onUpdateActiveUser={setActiveUser} />
<NewPostModalContainer id={newPostModalId} />
<Suspense fallback={null}>
<AuthModalContainer id={authModalId} onUpdateActiveUser={setActiveUser} />
<NewPostModalContainer id={newPostModalId} />
</Suspense>
</HelmetProvider>
);
};
2 changes: 0 additions & 2 deletions application/client/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CaX</title>
<script src="/scripts/main.js"></script>
<link rel="stylesheet" href="/styles/main.css" />
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4.2.1"></script>
<style type="text/tailwindcss">
@layer base {
Expand Down
30 changes: 20 additions & 10 deletions application/client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const config = {
],
static: [PUBLIC_PATH, UPLOAD_PATH],
},
devtool: "inline-source-map",
devtool: "source-map",
entry: {
main: [
"core-js",
Expand All @@ -36,7 +36,7 @@ const config = {
path.resolve(SRC_PATH, "./index.tsx"),
],
},
mode: "none",
mode: "production",
module: {
rules: [
{
Expand All @@ -60,7 +60,6 @@ const config = {
},
output: {
chunkFilename: "scripts/chunk-[contenthash].js",
chunkFormat: false,
filename: "scripts/[name].js",
path: DIST_PATH,
publicPath: "auto",
Expand All @@ -77,7 +76,7 @@ const config = {
BUILD_DATE: new Date().toISOString(),
// Heroku では SOURCE_VERSION 環境変数から commit hash を参照できます
COMMIT_HASH: process.env.SOURCE_VERSION || "",
NODE_ENV: "development",
NODE_ENV: "production",
}),
new MiniCssExtractPlugin({
filename: "styles/[name].css",
Expand All @@ -91,15 +90,23 @@ const config = {
],
}),
new HtmlWebpackPlugin({
inject: false,
inject: true,
template: path.resolve(SRC_PATH, "./index.html"),
}),
],
resolve: {
extensions: [".tsx", ".ts", ".mjs", ".cjs", ".jsx", ".js"],
alias: {
"bayesian-bm25$": path.resolve(__dirname, "node_modules", "bayesian-bm25/dist/index.js"),
["kuromoji$"]: path.resolve(__dirname, "node_modules", "kuromoji/build/kuromoji.js"),
"bayesian-bm25$": path.resolve(
__dirname,
"node_modules",
"bayesian-bm25/dist/index.js",
),
["kuromoji$"]: path.resolve(
__dirname,
"node_modules",
"kuromoji/build/kuromoji.js",
),
"@ffmpeg/ffmpeg$": path.resolve(
__dirname,
"node_modules",
Expand Down Expand Up @@ -128,8 +135,10 @@ const config = {
},
},
optimization: {
minimize: false,
splitChunks: false,
minimize: true,
splitChunks: {
chunks: "all",
},
concatenateModules: false,
usedExports: false,
providedExports: false,
Expand All @@ -139,7 +148,8 @@ const config = {
ignoreWarnings: [
{
module: /@ffmpeg/,
message: /Critical dependency: the request of a dependency is an expression/,
message:
/Critical dependency: the request of a dependency is an expression/,
},
],
};
Expand Down
Loading
Loading