Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2018-03-20 14:16:48

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,626
GitHub Twitter

Re: Testers needed: flat development (4.7+ only)

Thank you lot Colak!
You make my day and it’s always a pleasure to read you.


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#14 2018-04-01 11:28:12

Summer
Member
Registered: 2018-01-29
Posts: 60

Re: Testers needed: flat development (4.7+ only)

How is CSS in file editing?

Offline

#15 2018-04-02 08:37:55

etc
Developer
Registered: 2010-11-11
Posts: 5,133
Website GitHub

Re: Testers needed: flat development (4.7+ only)

Summer wrote #310530:

How is CSS in file editing?

If you prefer editing CSS/JS files directly, I can’t see any reason to serve them via txp. Just link to these files in page templates, anything wrong with it?

Offline

#16 2018-04-12 10:05:58

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Testers needed: flat development (4.7+ only)

Just wondering what the status is on this – are we likely to see something akin to this in core of 4.7.0.

And also web hooks to auto-inject flat files into database (as happens with rah_flat and oui_flat)?

Sorry to ask, but these are great additions to make themes much more useable in dev process.

Offline

#17 2018-04-12 10:49:21

etc
Developer
Registered: 2010-11-11
Posts: 5,133
Website GitHub

Re: Testers needed: flat development (4.7+ only)

philwareham wrote #310908:

Just wondering what the status is on this – are we likely to see something akin to this in core of 4.7.0.

I think it would be more prudent to postpone it to 4.7.1+. We need some time/feedback to avoid introducing future backwards incompatibility problems.

Right now, I would add few features:

  • a possibility to sync without passing by Themes tab (webhook, link, etc);
  • a more granular sync mechanism: sometimes you need to sync just, say, CSS files or some form.

But the themes code is rather complex (for me), I wouldn’t touch it just few days before 4.7 release.

Offline

#18 2018-04-12 12:05:07

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,416
Website GitHub

Re: Testers needed: flat development (4.7+ only)

Not being a user of *_flat, how does the webhook mechanism work? Is it some unique (md5ish) URL that is assigned so if you touch it, the new content is brought into the DB? Is it one URL per theme? Is it destructive (a complete resync)?

Another option is to introduce buttons in each row of the Themes table (in an ‘Actions’ column or something) that will import/export that theme immediately, no prompts, no nothing. If you’re concerned that you might hit it by mistake, the column can be hidden via the list options. Is that any faster than the multi-edit dance? It’d be a cinch to add, and no compatibility issues since the ability to do so is already there.

The only sticking point is the ‘delete/sync’ thing. But maybe we can get away with reserving the sync capability to multi-edit only, and the simple import/export buttons per row only do a merge. Less destructive.

Desirable or not?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#19 2018-04-12 13:07:18

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,702
Website

Re: Testers needed: flat development (4.7+ only)

Bloke wrote #310912:

Not being a user of *_flat, how does the webhook mechanism work? Is it some unique (md5ish) URL that is assigned so if you touch it, the new content is brought into the DB? Is it one URL per theme? Is it destructive (a complete resync)?

In the ‘olden days’ ;-) we had just one set of pages, forms etc. rah_flat / oui_flat syncs them into the db on every page load (as far as I am aware) when you are in testing or debug mode. It syncs everything in the designated folder with the db removing everything that’s not there.
The only files it skips are those that don’t match the naming scheme, so you could exclude (or temporarily remove) files by, for example, prefixing them with an underscore. That can be useful when trying out variants.

Once you switched to live, it would not perform the sync unless you called the URL to manually trigger a sync. On installation, the plugin generates an md5ish URL but you could change that in a pref to an URL of your choosing. If you use a build script or deploy script, you could rsync your files to the server and then call the webhook to bring them into the DB without having to go into the admin area.


TXP Builders – finely-crafted code, design and txp

Online

#20 2018-04-12 13:16:43

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,702
Website

Re: Testers needed: flat development (4.7+ only)

Bloke wrote #310912:

Another option is to introduce buttons in each row of the Themes table (in an ‘Actions’ column or something) that will import/export that theme immediately, no prompts, no nothing …

I’m not sure I understand you – or I understand the advantage of that. Do you mean setting something that sets “auto-sync” from now on?

The big advantage of rah_flat/oui_flat is that you don’t “need” the admin-side at all for a lot of dev work. The two key dev situations (from my point of view) are:

  • When developing a theme, you edit your template in your code editor, save it and refresh your browser to see what happens (or you have some build tool that automatically does that for you). Much the same as when you edit your css and reload. It’s just way faster and perfect for trial-and-error development ;-)
  • When transferring changes from a site developed locally or on a staged site to the live site, you sync your changes to the live server and get your deploy script to call the webhook when it’s done. Scripts like beam (which you put me on to) and others make that easy.

I thought the suggestion you made once before of having a hook you could define in the theme’s manifest file for your particular theme was a good idea. Maybe the question of whether “standard sync“ or “wipe and sync” takes place could also be set in the manifest file. Thinking aloud, it might actually be better to put the sync credentials in a separate file alongside the manifest.json to allow you to ignore that file from a git repo.


TXP Builders – finely-crafted code, design and txp

Online

#21 2018-04-12 13:17:03

etc
Developer
Registered: 2010-11-11
Posts: 5,133
Website GitHub

Re: Testers needed: flat development (4.7+ only)

Bloke wrote #310912:

Another option is to introduce buttons in each row of the Themes table (in an ‘Actions’ column or something) that will import/export that theme immediately, no prompts, no nothing.

Desirable or not?

If these can be just plain URL links (not a form) then yes. We could then use them in any place on the admin side. I have tried, but some parameters of import/export requests (dunno which) seem to be fetched only from $_POST, not $_GET.

Offline

#22 2018-04-12 13:30:55

etc
Developer
Registered: 2010-11-11
Posts: 5,133
Website GitHub

Re: Testers needed: flat development (4.7+ only)

jakob wrote #310915:

rah_flat / oui_flat syncs them into the db on every page load (as far as I am aware) when you are in testing or debug mode.

That looks a bit risky (easy to loose db edits) and suboptimal (what if nothing is changed?) I would prefer something less automatic, like fetching directly from files in dev mode and syncing once everything is fine. That’s what this plugin does, but it lacks an interface to quickly switch between two modes or sync them.

Offline

#23 2018-04-12 14:20:29

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,065
Website GitHub Mastodon Twitter

Re: Testers needed: flat development (4.7+ only)

I am testing this and loving it. I can see the styles, forms and pages being saved but we are yet to have a native way regarding js files. Will it be that hard to include if not on 4.7 on 4.7.1?

Basically, what will be needed is an extra pane under the presentation tab.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#24 2018-04-12 14:21:22

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,702
Website

Re: Testers needed: flat development (4.7+ only)

etc wrote #310919:

That looks a bit risky (easy to loose db edits) and suboptimal …

Sure, it was downright dangerous if you hadn’t exported stuff in the DB. I was just explaining what it did. I think your proposal of swapping to loading from files instead of the DB until such time as one is ready to bring it into the DB is good.

The hook to trigger a sync would still be useful, though.


TXP Builders – finely-crafted code, design and txp

Online

Board footer

Powered by FluxBB