Add JavaScript build artifacts to tagged releases

Created on 8 January 2025, 12 days ago

Overview

Currently, to install Experience Builder you need to have NodeJS locally and run npm run build in order for the front end to work.

If we are to ship Experience Builder as a recipe with Drupal CMS then we need to avoid end users having to run this build step themselves.

Proposed resolution

Commit the build artifacts to the branch prior to tagging a release, and remove them again afterwards.

Storing artifacts in the repo is not ideal in the long term but this is probably the easiest solution for now.

User interface changes

None.

πŸ“Œ Task
Status

Active

Version

0.0

Component

Page builder

Created by

πŸ‡¬πŸ‡§United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @longwave
  • πŸ‡³πŸ‡±Netherlands balintbrews Amsterdam, NL
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί
  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    Adding credits for discussion in Slack.

  • Merge request !515First pass at Docker build step. β†’ (Merged) created by longwave
  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    MR!515 contains a first attempt at a Docker-based build step that can be run locally or on CI.

    $ rm -rf dist
    
    $ docker build --output dist .
    ...
     => exporting to client directory
     => => copying files 1.62MB
    
    $ ls dist/ dist/assets/
    dist/:
    assets  index.html
    
    dist/assets/:
    index.css  index.js
    
  • πŸ‡¬πŸ‡§United Kingdom longwave UK
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    This is critical for the 0.2 tag needed for Drupal CMS next week.

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    I'm not sure how to review this. πŸ˜… (But spotted one problem πŸ™ˆ)

    1. Why would I build this using Docker if I can just do npm ci && npm run build locally and commit that?
    2. This is not yet running on Drupal CI. Do you intend to do that? And if so, is it worth figuring that out for the handful of tags we'll make prior to starting a 1.0-stable? (I suspect that at that point we will have to always commit the build artifacts? Because people might run the dev snapshot then. Or we might just say that we don't support that.)

    I can see how this is useful to be able to build it without having to install npm, but anybody tagging a release would also have a working XB dev environment?

  • πŸ‡³πŸ‡±Netherlands balintbrews Amsterdam, NL
    1. To ensure a consistent Node.js version. (CPU architecture would be relevant if we distributed server-side code as well.)
    2. Given how you wisely suggested on Slack to stay pragmatic, especially with 0.2.0 being so close, I think we don't want to worry about CI. πŸ™‚ The person tagging a new release can run this locally β€” then delete the artifacts in the subsequent commit as you outlined earlier. We can figure out a more solid distribution workflow later.
  • πŸ‡³πŸ‡±Netherlands balintbrews Amsterdam, NL
  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    I don't see what's wrong with using the official NodeJS image? It's available for multiple architectures and does what we need - what does the skpr one do that the official one doesn't?

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    #11++ for pragmatism β€” but I was actually mostly getting at discoverability.

    If this is not running on Drupal CI, then how would I ever even discover this if it's not documented in /ui/README.md nor /CONTRIBUTING.md?

    Also: #13++ β€” if we deviate from the official one, we need to document why.

  • πŸ‡³πŸ‡±Netherlands balintbrews Amsterdam, NL

    Agreed that it needs documentation, but since the MR was meant as a first pass, I was thinking we could get @larowlan's opinion, then if we're all happy, we can document the steps.

    skpr/node:20-v2-latest was suggested instead of node:20-alpine in the Slack conversation that resulted this issue. I simply wanted to capture that, with the idea that we can easily change it back. I wasn't sure if @longwave missed the suggestion or deliberately added node:20-alpine. Now I know it's the latter.

    @larowlad said skpr/node:20-v2-latest is his preferred image, so let's see if there is a good reason to go with that. Whichever we choose, it won't make too much of a difference.

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί
  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    Added some rudimentary documentation.

  • πŸ‡³πŸ‡±Netherlands balintbrews Amsterdam, NL
  • Pipeline finished with Skipped
    11 days ago
    #390552
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    Lovely! 🚒

  • πŸ‡ΊπŸ‡ΈUnited States effulgentsia

    With 0.2.0 delayed, do we want a followup for automating this with CI? Or do we think that's too much effort compared to a manual step with every tag?

  • πŸ‡ΊπŸ‡ΈUnited States effulgentsia

    Retitling to reflect the part that was done in this issue.

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    #21: Too much effort for the far and few between releases.

    #22: thanks! πŸ™

Production build 0.71.5 2024