silverstripe / silverstripe-linkfield

Silverstripe module for managing links
BSD 3-Clause "New" or "Revised" License
4 stars 14 forks source link

ENH Pre-render the LinkField in entwine #241

Closed maxime-rainville closed 3 months ago

maxime-rainville commented 4 months ago

This PR is making the pre-rendered UI more pleasing by pre-rendering somethings.

Before

no-pre-load-linkfield-2024-03-01_21.55.02.webm

Before React boots

Screenshot from 2024-03-01 21-57-31

Before LinkField gets its data back

Screenshot from 2024-03-01 22-00-00

After

pre-load-linkfield-2024-03-01_21.53.59.webm

Before React boots

Screenshot from 2024-03-01 22-02-10

Before LinkField gets its data back

image

Parent issue

Depends on

maxime-rainville commented 4 months ago

Enwtine only.

Most of these templates were pre-existing, so you could easily have been confused into thinking that you could override them. If you did try to customise them, you would quickly notice that your changes a being nuked once React boots.

I can rename the templates and/or add extra comments to make it clear this is an Entwine only construct.

GuySartorelli commented 4 months ago

Enwtine only.

Linkfield is a react component, so that doesn't really make any sense

Most of these templates were pre-existing, so you could easily have been confused into thinking that you could override them. If you did try to customise them, you would quickly notice that your changes a being nuked once React boots.

The existing ones CAN be overridden, but notably are used to bootstrap the react component.

The new templates mirror something that is rendered by react - so changing these templates will only change the display of a linkfield before any react is bootstrapped for the field if I'm not mistaken.

At the very very least these templates need comments at the top indicating that they are only for use in rendering the field before react has bootstrapped and will not affect the display of the rendered react component.

maxime-rainville commented 4 months ago

Behat build is broken. I thought it was intermittent, but it seems to be a legit failure.

I'll add comments to the template while I'm at it.

maxime-rainville commented 4 months ago

Merging the admin PR fixed the behat build.