-
Notifications
You must be signed in to change notification settings - Fork 0
URL Design #3
Comments
Great. Is there any reason why point 4 could not use the same structure as point 1? I also think we should include the type (esm, iife etc) of the script somehow. Not sure if we want to put that in the pathname or in the filename. |
It could for sure. I think I just chose pkg, alias and bundle as 3 different namespaces to differentiate. Could drop the pkg and bundle namespaces and make 1. And 4. The same. |
Type should probably be a pathname? |
How about something like this? /:org/:name/:version/js/:type/index.js
# /finn/my-app/1.0.0/js/esm/index.js
# /finn/my-app/1.0.0/js/default/index.js
# /finn/my-app/1.0.0/js/cjs/index.js
# /finn/my-app/1.0.0/js/iife/index.js How do we want to support non esm? I could see iife being a useful way to support older browsers by loading in iife global packages as separate script tags first and then the apps main iife bundle as another script tag or something. Feels to me like we may want to allow for such things but we shouldn't bother implementing initially so in practice the only URL structure we would implement would be What about fallbacks? Could they be part of this URL structure? instead of |
In the prototypes made so far, a URL structure has been loosely determined with some but not a lot of thought. The following lays out the URLs that are currently in use in the prototype.
1. A global published module's immutable URLs
Where:
:org
is the name of your organisation:pkgName
is the name of the package on npm:version
is the version of the package on npmExample:
2. A module alias' modifiable URL
Where:
:org
is the name of your organisation:pkgName
is the name of the package on npm:alias
is the alias that you have assigned to the package eg.^16
Example:
3. A modifiable import map file
Where:
:org
is the name of your organisationExample:
4. An app's published assets
http://:assetServerUrl:port/:org/bundle/:appName/:version/index.js http://:assetServerUrl:port>/:org/bundle/:appName/:version/index.js.map
Where:
:org
is the name of your organisation:appName
is the name of your app:version
is the version of your assets being publishedExample:
The text was updated successfully, but these errors were encountered: