Skip to content

Remove all runtime reliance on NPM #398

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

Merged
merged 20 commits into from
Jun 21, 2021
Merged

Remove all runtime reliance on NPM #398

merged 20 commits into from
Jun 21, 2021

Conversation

rmorshea
Copy link
Collaborator

@rmorshea rmorshea commented Jun 14, 2021

With recent changes to the custom component interface, it's now possible to remove all runtime reliance on NPM. Doing so has many virtuous knock-on effects:

  1. Removal of large chunks of code
  2. Greatly simplifies how users dynamically experiment with React component libraries, because their usage no longer requires a build step. Instead they can be loaded in the browser from a CDN that distributes ESM modules.
  3. The built-in client code needs to make fewer assumption about where static resources are located, and as a result, it's also easier to coordinate the server and client code.
  4. Alternate client implementations benefit from this simplicity. Now, it's possible to install idom-client-react normally and write a loadImportSource() function that looks for route serving the contents of IDOM_WEB_MODULES_DIR.

This change includes large breaking changes:

  • The CLI is being removed as it won't be needed any longer
  • The idom.client is being removed in favor of a stripped down idom.web module
  • The IDOM_CLIENT_BUILD_DIR config option will no longer exist and a new IDOM_WEB_MODULES_DIR which only contains dynamically linked web modules. While this new directory's location is configurable, it is meant to be transient and should not be re-used across sessions.

The new idom.web module takes a simpler approach to constructing import sources and expands upon the logic for resolving imports by allowing exports from URLs to be discovered too. Now, that IDOM isn't using NPM to dynamically install component libraries idom.web instead creates JS modules from template files and links them into IDOM_WEB_MODULES_DIR. These templates ultimately direct the browser to load the desired library from a CDN.

@rmorshea rmorshea force-pushed the no-more-npm-install branch 4 times, most recently from 5090c84 to 2db6071 Compare June 15, 2021 07:09
@rmorshea rmorshea changed the title Remove dependency on NPM Remove all runtime reliance on NPM Jun 15, 2021
@rmorshea rmorshea force-pushed the no-more-npm-install branch 16 times, most recently from 81c124d to 0ff0146 Compare June 20, 2021 18:59
rmorshea added 9 commits June 20, 2021 12:10
With recent changes to the custom component interface, it's now
possible to remove all runtime reliance on NPM. Doing so has many
virtuous knock-on effects:

1. Removal of large chunks of code
2. Greatly simplifies how users dynamically experiment with React
   component libraries, because their usage no longer requires a
   build step. Instead they can be loaded in the browser from a
   CDN that distributes ESM modules.
3. The built-in client code needs to make fewer assumption about
   where static resources are located, and as a result, it's
   also easier to coordinate the server and client code.
4. Alternate client implementations benefit from this simplicity.
   Now, it's possible to install idom-client-react normally and
   write a loadImportSource() function that looks for route
   serving the contents of IDOM_WEB_MODULES_DIR.

This change includes large breaking changes:

- The CLI is being removed as it won't be needed any longer
- The idom.client is being removed in favor of a stripped down
  idom.web module
- The IDOM_CLIENT_BUILD_DIR config option will no longer exist and
  a new IDOM_WEB_MODULES_DIR which only contains dynamically
  linked web modules. While this new directory's location is
  configurable, it is meant to be transient and should not be
  re-used across sessions.

The new idom.web module takes a simpler approach to constructing
import sources and expands upon the logic for resolving imports
by allowing exports from URLs to be discovered too. Now, that
IDOM isn't using NPM to dynamically install component libraries
idom.web instead creates JS modules from template files and links
them into IDOM_WEB_MODULES_DIR. These templates ultimately direct
the browser to load the desired library from a CDN.
@rmorshea rmorshea force-pushed the no-more-npm-install branch from 0ff0146 to 5b00486 Compare June 20, 2021 19:10
@rmorshea rmorshea merged commit d1a4903 into main Jun 21, 2021
@rmorshea rmorshea deleted the no-more-npm-install branch June 21, 2021 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant