walinejs / waline

💬 A Simple, Safe Comment System
https://waline.js.org/en/
GNU General Public License v2.0
2.17k stars 381 forks source link

Roadmap: @waline/vercel@v2 and @waline/client@v3 #1669

Open Mister-Hope opened 1 year ago

Mister-Hope commented 1 year ago

The issue record breaking changes to be made in next major version.

We may need a migration helper to convert database into the new format.

Migration helper rebuild

Improve migration helper, since we will drop any direct compatibility with valine or waline/client@v1, currect migration helper shall be increased. It's important for us to provide smooth migration from older versions

New migration helper should have a customizable middleware which contains the following features:

Change reply @ into client

https://github.com/walinejs/waline/issues/1649

This requires:

Data struture update

Update the remaining 2 kebab_case key in data:

New API replacing old ones

export type GetArticleCounterResponse =
  | Record<string, number>[]
  | Record<string, number>
  | number[]
  | number;

New forceLogin

We can provide a login requirement for all apis, this requires:

Remove legacy package

Treeshakble widgets

In v3, widgets no longer exisit in widgets, instead they are exported directly so that they can be tree-shakable.

Remove exports

To reduce client size, we no longer output src folder in v3, also we canel shortcut exports key starting with dist.

lizheming commented 1 year ago

Convert user_id to userId for comment data structure, to have a constant key named rule with camelCase.

What's the purpose of this? CamelCase is not friendly for SQL like storage service, I have headache to some camelCase fields already.

Mister-Hope commented 1 year ago

To unify data structrure, all other keys are camelcase like insertedAt objectId etc (or in another word, this is the only kebab_case key in client package and whole api.

If you do think it's not ok for changing this key, I still suggest making a convertion to camelCase in server for this key before returning data to client. We have 3rd party clients, and it's better for us to provide a unified data structure, and more easy-understanding apis. We could remain old apis.

Mister-Hope commented 1 year ago

To unify data structrure, all other keys are camelcase like insertedAt objectId etc (or in another word, this is the only kebab_case key in client package and whole api.

If you do think it's not ok for changing this key, I still suggest making a convertion to camelCase in server for this key before returning data to client. We have 3rd party clients, and it's better for us to provide a unified data structure, and more easy-understanding apis. We could remain old apis.

Any ideas with this one? Technically speaking, I think it's better for us to provide new apis while remaining the old one. @lizheming

Also I would like to work on v3 for the above changes.

lolifamily commented 11 months ago

image the server's demo page '/' is still using the old API!