2025-Q1 - DX improvements

Developer Experience

Improvements

Q1 2025

1 / 21
volgende
Slide 1: Slide
newEditorLessonUpBeroepsopleiding

In deze les zitten 21 slides, met tekstslides.

Dit is niet oké

Onderdelen in deze les

Developer Experience

Improvements

Q1 2025


Agenda


  • Goal

  • Improvements

  • What's next

  • What you need to do

  • Q&A


Goal

KPI: reduce the time we lose on setup issues


Goal: non-meteor development should work and feel like a modern environment


Sub goals:

  • Closer to industry standards

  • Remove obstacles to move to a monorepo

  • Don't let Meteor dictate our setup

PNPM


PNPM


Goal: use pnpm defaults where possible



Why?

  • Save disk space

  • Boost installation speed

  • Create a non-flat node_modules directory => prevent "phantom" dependencies

  • Less exceptions => less to reason about, less bugs and more compatible with 2.0 repo

symlink

vs


PNPM


Problem


  • Meteor needs flat node_modules => node-linker=hoisted needs to be set

  • node-linker=hoisted needs shared-workspace-lockfile=false => Slow installation speed


Solution

  • Remove Meteor from pnpm workspace

  • Update scripts

    • Regular scripts => workspace only (e.g. pnpm nuke)

    • New postfix :all scripts => workspace + Meteor (e.g. pnpm nuke:all)


Good to know

  • 1 shared pnpm.lockfile (workspace) + 3 separate pnpm.lockfile's for Meteor (non-workspace)

  • install is now global (e.g. pnpm --filter ui-components install == pnpm install) => can be changed, but it's quite fast


PNPM - benchmark



clean

110s

install

400s

develop vs project branch (:all)

clean && install

508s

nuke

777s

clean:all

35s

install:all

58s

clean:all && install:all

85s

nuke:all

167s


PNPM - benchmark



All vs workspace only

clean:all && install:all

85s

nuke:all

167s

clean && install

48s

nuke

129s

Teacher-next


Teacher-next improvements


Goal: Modern development environment


Problem

  • Hot module reload and fast reload not working

  • emotion plugin not working

  • Outdated version


Solution

  • Upgrade to NextJS 14 (15 is blocked by upgrade to react 19)

  • Use SWC (default) instead of babel and typescript directly from internal packages

    • Build only what's necessary for the page

    • Enables HMR and fast reload

    • Enables emotion plugin

  • Known issues:

    • First (lazy) page load in dev still slow (7s)

      • To explore: Reduce code to be loaded by splitting up barrel files


Good to know

  • pnpm -F teacher-next dev (no build:watch)


teacher-next - benchmark



Load homepage

15s?

Go to editor v2

"instant"

teacher-next dev performance

EditorToolbelt change

10s?

Client bundle size

8.95 MB

Load homepage

8s

Go to editor v2

6s

EditorToolbelt change

~<1s

Client bundle size

6.09MB


Teacher-next improvements



Teacher-next improvements


Search


Search - benchmark



First cold boot

134s

Second cold boot

62s

Webpack performance

UI-component change

80s

Client bundle size

15.4 MB

First cold boot

22s

Second cold boot

4s

UI-component change

1.2s

Client bundle size

5.4MB


Search


Changes

  1. Replaced Babel + TS-Loader with SWC (Speedy Web Compiler)

  2. Removed all custom alias logic

  3. Search now uses the TS files instead of the /dist/ files of our internal packages

  4. No longer process server-side CSS

  5. Documented why certain workaround were implemented. (see search/webpack.common.js)

  6. Updated search CI flows to include webpack builds


Caveats

The search still uses symlinks for the 1.0 "shared-core" and "sharedLib/stylesheets"

  • Symlinks don't work by default with webpack

  • CSS: Webpack loader workaround to get the stylesheets to compile.

  • TS: libraries uses in the shared-core also need to be installed in the search. Added github action CI flow to error if a dependency is missing

What's next?


What's next

Frontend 2.0 to production

  • Continue with getting teacher-next ready for production (to host TimM & Q42's new project)


DX improvements

  • Use PNPM catalog for simpler package version locking

  • Improve linking of 2.0 packages

  • Search: no more server reboots for frontend changes

  • React 19 (help needed)

  • Storybook 8 (help needed)

  • Upgrade PNPM 10

  • and more...



What do I need to do?


What do you need to do?

Get your local setup working

  • Wait for our signal that everything is merged

  • git checkout develop

  • pnpm nuke:all (or pnpm nuke if not working on Meteor apps)

  • mention issues in #tech-only


Pull develop into your branch

  • Let us know if you need help with the merge conflict

Questions?