Reorganization of client-side repositories #137
Comments
Familiarity is definitely something worth striving for. We originally had everything at
That will leave us in a state like this: Client import feathers from 'feathers/client';
import rest from 'feathers-rest/client';
import socketio from 'feathers-socketio/client';
import auth from 'feathers-authentication-client'; Server const feathers = require('feathers');
const rest = require('feathers-rest');
const socketio = require('feathers-socketio');
const auth = require('feathers-authentication'); So the only difference on the client is the auth package. Maybe it's a better idea to bring it back into |
This is a good suggestion. I wanted to create I am however suggesting to defer this to the next release (after Auk) for the following reasons:
Things would then look like this on the server: const feathers = require('feathers');
const express = require('feathers-express');
const socketio = require('feathers-socketio');
const auth = require('feathers-authentication');
const app = feathers()
// Turn `app` into an Express app
.configure(express(options))
// Set up REST HTTP handler for services using Express
.configure(express.rest(options))
// Old school Socketio
.configure(socketio(options))
// New auth
.configure(auth()); And like this on the client: const io = require('socket.io-client');
const feathers = require('feathers');
const socketio = require('feathers-socketio-client');
const auth = require('feathers-authentication-client');
const socket = io();
const app = feathers()
.configure(socketio(socket))
.configure(auth()); |
@marshallswain valid points, and thanks for reminding me about @daffl those are great ideas! Everything fits together nicely with that model of thinking. |
Right now there's a bit of confusion for newcomers - most of us learn the server bit of feathers first, and then jump over to implementing it on the client.
However, the client has a completely different structure than the server and (in my opinion) is a little less organized than its relative (the server).
What if both the client and server had a similar structure across the board?
For example:
feathers-client
(core)feathers-hooks-client
feathers-rest-client
feathers-socketio-client
feathers-authentication-client
feathers
(core)feathers-hooks
feathers-rest
feathers-socketio
feathers-authentication
I hope you can see the pattern; for every server package, there's a client counterpart.
As for setting these up, it would work the same way on the client as it does on the server; you have your core
feathers
orfeathers-client
and you plug yourfeathers-*
orfeathers-*-client
into each one, respectively.Yes, this means more dependencies and repositories. I think though, that it will create a system that is more unified and easy to understand across the board because setup will be relatively similar on both frontend and backend.
That's good for individual developers and teams in general.
It means less confusion, more building.
The text was updated successfully, but these errors were encountered: