outline icon indicating copy to clipboard operation
outline copied to clipboard

feat: mount app on env.URL.pathname

Open frankli0324 opened this issue 3 years ago • 9 comments

https://github.com/outline/outline/discussions/3871

interesting fact:

https://github.com/outline/outline/blob/086c3ec2d83d6603f8834b0a2ef5229f9638bef4/server/presenters/env.ts#L12-L14

where:

https://github.com/outline/outline/blob/086c3ec2d83d6603f8834b0a2ef5229f9638bef4/app/scenes/Document/components/MultiplayerEditor.tsx#L69-L74

frankli0324 avatar Jul 26 '22 03:07 frankli0324

Hey there! It looks like you didn't provide much information here. Please consider adding more details about the issue / pr or it will be automatically closed. Thanks for helping us maintain the project!

request-info[bot] avatar Jul 26 '22 03:07 request-info[bot]

I'm not sure what to do with WebpackPwaManifest in webpack.config.js, but publicPath in webpack config would have to be modified.

frankli0324 avatar Jul 26 '22 03:07 frankli0324

I'm not sure what to do with WebpackPwaManifest

I'm not sure there is anything you can do as webpack is build-time and the URL configuration is runtime, it may be that the PWA manifest just isn't going to work in this configuration

tommoor avatar Jul 26 '22 08:07 tommoor

Hi @frankli0324 – these changes look well considered, but unfortunately they are not compatible with custom domain names per-team which we support in the cloud-hosted version of Outline. The custom domain name functionality relies on many of the paths that you've changed to absolute being relative for this to work correctly.

tommoor avatar Jul 28 '22 09:07 tommoor

One way to support both might be to create a relativePath helper that would parse env.URL at startup and prefix the pathname, eg.

env.URL = "https://mycompany.com/wiki"

relativePath("/static/worker.js") -> "/wiki/static/worker.js"

This could then be used anywhere that /... currently is

tommoor avatar Jul 28 '22 09:07 tommoor

hmmmm.... what troubles me most is index.html gets generated with {publicPath}/app.[hash].js,css

frankli0324 avatar Jul 28 '22 09:07 frankli0324

The custom domain name functionality relies on many of the paths that you've changed to absolute being relative for this to work correctly.

oh....

frankli0324 avatar Jul 28 '22 10:07 frankli0324

Not sure if you wanted to take this one across the finish line based on the above suggestion?

tommoor avatar Aug 18 '22 15:08 tommoor

I wish so, but I'm quite busy in the last few weeks... maybe next weekend..?

frankli0324 avatar Aug 19 '22 06:08 frankli0324