-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port to Parcel bundler #1137
Port to Parcel bundler #1137
Commits on Sep 25, 2019
-
client: move JS, CSS & lang files to assets/ directory
This directory is not public facing, it contains assets used for building bundles.
Configuration menu - View commit details
-
Copy full SHA for b8a152f - Browse repository at this point
Copy the full SHA b8a152fView commit details
Commits on Sep 26, 2019
-
It makes the repository slightly cleaner and makes things like linting easier.
Configuration menu - View commit details
-
Copy full SHA for 779229c - Browse repository at this point
Copy the full SHA 779229cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ae5480 - Browse repository at this point
Copy the full SHA 4ae5480View commit details -
* Do not run `npm install` in assets twice when running `dist` script. * Install also PHP dependencies in post-install (re-use the `install-dependencies` target`). * Use node executable from NPM via environment variable, instead of relying for it to be on PATH (which is not the case since NPM 4, see https://docs.npmjs.com/cli/run-script). * Print filename of the generated archive in `dist` script.
Configuration menu - View commit details
-
Copy full SHA for d6bc4e4 - Browse repository at this point
Copy the full SHA d6bc4e4View commit details -
api: Version separately from selfoss
Also follow semantic versioning so consumers are better informed about breakage. https://semver.org/
Configuration menu - View commit details
-
Copy full SHA for 74ee8f3 - Browse repository at this point
Copy the full SHA 74ee8f3View commit details -
This will allow clients to obtain version of Selfoss and API, as well as the the instance configuration. The configuration options are not part of the public API yet, though. I put it under /api prefix, as we might move the rest of the API there in the future. Increases API version to 2.20.0 – new feature
Configuration menu - View commit details
-
Copy full SHA for 9e93e1f - Browse repository at this point
Copy the full SHA 9e93e1fView commit details -
client: Load configuration using API
We will try to load fresh configuration from the server each time selfoss is opened and cache it in the localStorage indefinitely. If configuration cannot be feched (e.g. in offline mode), the value from localStorage will be used.
Configuration menu - View commit details
-
Copy full SHA for 16f1cd6 - Browse repository at this point
Copy the full SHA 16f1cd6View commit details
Commits on Sep 27, 2019
-
Configuration menu - View commit details
-
Copy full SHA for baf7dac - Browse repository at this point
Copy the full SHA baf7dacView commit details -
client: Move login form to frontend
The use of template strings make this commit unusable in older browsers until we start transpiling with Parcel. It is not so bad: https://caniuse.com/#feat=template-literals
Configuration menu - View commit details
-
Copy full SHA for 167c4b7 - Browse repository at this point
Copy the full SHA 167c4b7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5f8a7cf - Browse repository at this point
Copy the full SHA 5f8a7cfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ea236f - Browse repository at this point
Copy the full SHA 4ea236fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0428e0f - Browse repository at this point
Copy the full SHA 0428e0fView commit details -
templates: Make more metadata set in the client
So that we can make the templates completely static. Also fix some invalid HTML and meta parity.
Configuration menu - View commit details
-
Copy full SHA for de6558e - Browse repository at this point
Copy the full SHA de6558eView commit details -
These use their own salt so it will make them easier to generate on the client. We still support the old password scheme with separate salt so users did not have to rehash their passwords.
Configuration menu - View commit details
-
Copy full SHA for addf3f4 - Browse repository at this point
Copy the full SHA addf3f4View commit details
Commits on Oct 3, 2019
-
client: Use translation helper
Just like with the `selfoss.config` replacing the `data` attribute lookup, we should use the existing `selfoss.ui._` function. This will make changing the translation method easier in the future.
Configuration menu - View commit details
-
Copy full SHA for 53abdc6 - Browse repository at this point
Copy the full SHA 53abdc6View commit details -
Setting `<base>` in the HTML files was not actually necessary, since we do not use subdirectories in our front-end routes. When we start using history API, it will not be necessary either, as long as we know the routes. The base URI is therefore only necessary for cookies and RSS feed.
Configuration menu - View commit details
-
Copy full SHA for f4202aa - Browse repository at this point
Copy the full SHA f4202aaView commit details -
Using asset bundler will allow us to switch to modern JavaScript, build user interface client-side more easily, and develop iteratively thanks to hot module replacement. We chose Parcel over Webpack for simplicity of set up. With this, selfoss no longer supports run-time minification of assets. Instead, developer will need to run `npm run build` to bundle all the dependencies and our files and copy them to the `public/` directory. This means the directory is no longer needed to be writeable at run time (useful for read only locations). Alternately, developer can run `npm run dev` command, which will start a program that will watch selfoss files, rebuild them in the background when changed, and then, refresh the opened page. For common users, there are prebuilt packages available, or they can use user.{css,js} for customization, as before. The routes `GET /` (without AJAX), `GET /password` and `GET /opml` were turned into primitive servers of static HTML files and all the magic is happening client-side. OPML is uploaded completely using XHR and even the password hash is generated client-side. We started using some EcmaScript 6 features like imports, which Parcel will automatically resolve. Languages are imported statically as well, to avoid having to copy them using `parcel-plugin-static-files-copy`. Unfortunately, it requires us to declare them explicitly for Parcel to be able to resolve them. We are using `parcel-plugin-sw-cache`, which uses `workbox` to generate ServiceWorker boilerplate. We do not use the Workbox library, though, as it is not possible to both load it locally (not from CDN) and customize the service worker – we just rely on it to get the list of files into the worker.
Configuration menu - View commit details
-
Copy full SHA for cfe57ee - Browse repository at this point
Copy the full SHA cfe57eeView commit details -
client: Make user.{css,js} work off-line
Since these are supposed to be editable by user any time and we do not want to require users to install development environment, we will need fetch these files manually and handle cache invalidation ourselves. As a key, we will use their mtimes, which we will pass through the configuration key of `/api/about` endpoint. This is re-fetched whenever selfoss is opened, so we can notice when the files are modified, and we will add them to browser's cache storage. Service worker will ignore those cache keys.
Configuration menu - View commit details
-
Copy full SHA for 717fcc8 - Browse repository at this point
Copy the full SHA 717fcc8View commit details