Skip to content

Releases: ithaka/pharos

@ithaka/[email protected]

13 Dec 14:56
ba8f453
Compare
Choose a tag to compare

Patch Changes

@ithaka/[email protected]

09 Dec 16:55
88142f8
Compare
Choose a tag to compare

Minor Changes

@ithaka/[email protected]

07 Dec 20:52
c8190ad
Compare
Choose a tag to compare

Minor Changes

  • #268 ffb2f63 Thanks @Niznikr! - Add register utility:

    • Update PharosElement to set [data-pharos-component] with constructor.name

    • Update PharosComponentMixin to set [data-pharos-component] with base class name

    • Add register utility to simplify component registration and ensure trivial classes are used for custom elements:

      import { PharosAlert, PharosButton, PharosIcon } from '@ithaka/pharos';
      import registerComponents from '@ithaka/pharos/lib/utils/registerComponents';
      
      registerComponents('{prefix}', [PharosAlert, PharosButton, PharosIcon]);
    • Add a React Pharos context provider for consumers to indicate prefix used for registration:

      import { PharosContext } from '@ithaka/pharos/lib/utils/PharosContext';
      
      const context = { prefix: 'homepage' };
      
      <PharosContext.Provider value={context}>...app code</PharosContext.Provider>;

Patch Changes

@ithaka/[email protected]

07 Dec 20:52
c8190ad
Compare
Choose a tag to compare

Minor Changes

  • #268 ffb2f63 Thanks @Niznikr! - Add register utility:

    • Update PharosElement to set [data-pharos-component] with constructor.name

    • Update PharosComponentMixin to set [data-pharos-component] with base class name

    • Add register utility to simplify component registration and ensure trivial classes are used for custom elements:

      import { PharosAlert, PharosButton, PharosIcon } from '@ithaka/pharos';
      import registerComponents from '@ithaka/pharos/lib/utils/registerComponents';
      
      registerComponents('{prefix}', [PharosAlert, PharosButton, PharosIcon]);
    • Add a React Pharos context provider for consumers to indicate prefix used for registration:

      import { PharosContext } from '@ithaka/pharos/lib/utils/PharosContext';
      
      const context = { prefix: 'homepage' };
      
      <PharosContext.Provider value={context}>...app code</PharosContext.Provider>;

Patch Changes

@ithaka/[email protected]

07 Dec 20:52
c8190ad
Compare
Choose a tag to compare

Minor Changes

  • #268 ffb2f63 Thanks @Niznikr! - Add register utility:

    • Update PharosElement to set [data-pharos-component] with constructor.name

    • Update PharosComponentMixin to set [data-pharos-component] with base class name

    • Add register utility to simplify component registration and ensure trivial classes are used for custom elements:

      import { PharosAlert, PharosButton, PharosIcon } from '@ithaka/pharos';
      import registerComponents from '@ithaka/pharos/lib/utils/registerComponents';
      
      registerComponents('{prefix}', [PharosAlert, PharosButton, PharosIcon]);
    • Add a React Pharos context provider for consumers to indicate prefix used for registration:

      import { PharosContext } from '@ithaka/pharos/lib/utils/PharosContext';
      
      const context = { prefix: 'homepage' };
      
      <PharosContext.Provider value={context}>...app code</PharosContext.Provider>;

Patch Changes

@ithaka/[email protected]

18 Nov 15:33
b041c70
Compare
Choose a tag to compare

Patch Changes

@ithaka/[email protected]

18 Nov 15:33
b041c70
Compare
Choose a tag to compare

Patch Changes

@ithaka/[email protected]

29 Oct 13:54
5785b7e
Compare
Choose a tag to compare

Major Changes

  • #226 7843568 Thanks @Niznikr! - require manual component registration:

    • Remove component self-registration
    • Scope registries for components composed of other Pharos components using scoped-registry-mixin
    • Update React wrapper to detect defined custom tag name
    • Create PharosElement base class which sets a custom attribute data-pharos-component as a common identifier
    • Set components to extend PharosElement
    • Update documentation

    Migration Guidelines

    1. Remove all individual imports of Pharos web components.

    2. Register them with a custom tag in your app's entrypoint in the form of {app/bundle}-pharos-{component}:

      import { PharosAlert } from '@ithaka/pharos/lib/components/alert/pharos-alert';
      
      customElements.define('homepage-pharos-alert', PharosAlert);
    3. Update templates, queries, unit tests, and integration tests with the newly defined tag names.

    4. Add the scoped custom element registry polyfill to a globally available location in your project.

    5. Update your bundler's production build settings to keep class names unminified:

      Webpack (Terser):

      optimization: {
        minimizer: [
          new TerserPlugin({
            terserOptions: {
              keep_classnames: /^Pharos/,
              keep_fnames: /^Pharos/,
            }
          }),
        ],
      }

      Vite (ESBuild):

      export default defineConfig({
        esbuild: {
          keepNames: true,
        },
      });
    6. Import the JSDOM patch in your Jest setup file if you use Jest for unit testing:

      import '@ithaka/pharos/lib/patches/jsdom';
      import 'your-pharos-component-registration-file';

Patch Changes

@ithaka/[email protected]

29 Oct 13:54
5785b7e
Compare
Choose a tag to compare

Minor Changes

  • #242 9e491fa Thanks @Niznikr! - Update to Gatsby 4 for Pharos site

  • #226 7843568 Thanks @Niznikr! - require manual component registration:

    • Remove component self-registration
    • Scope registries for components composed of other Pharos components using scoped-registry-mixin
    • Update React wrapper to detect defined custom tag name
    • Create PharosElement base class which sets a custom attribute data-pharos-component as a common identifier
    • Set components to extend PharosElement
    • Update documentation

    Migration Guidelines

    1. Remove all individual imports of Pharos web components.

    2. Register them with a custom tag in your app's entrypoint in the form of {app/bundle}-pharos-{component}:

      import { PharosAlert } from '@ithaka/pharos/lib/components/alert/pharos-alert';
      
      customElements.define('homepage-pharos-alert', PharosAlert);
    3. Update templates, queries, unit tests, and integration tests with the newly defined tag names.

    4. Add the scoped custom element registry polyfill to a globally available location in your project.

    5. Update your bundler's production build settings to keep class names unminified:

      Webpack (Terser):

      optimization: {
        minimizer: [
          new TerserPlugin({
            terserOptions: {
              keep_classnames: /^Pharos/,
              keep_fnames: /^Pharos/,
            }
          }),
        ],
      }

      Vite (ESBuild):

      export default defineConfig({
        esbuild: {
          keepNames: true,
        },
      });
    6. Import the JSDOM patch in your Jest setup file if you use Jest for unit testing:

      import '@ithaka/pharos/lib/patches/jsdom';
      import 'your-pharos-component-registration-file';

Patch Changes

@ithaka/[email protected]

29 Oct 13:54
5785b7e
Compare
Choose a tag to compare

Minor Changes

  • #226 7843568 Thanks @Niznikr! - require manual component registration:

    • Remove component self-registration
    • Scope registries for components composed of other Pharos components using scoped-registry-mixin
    • Update React wrapper to detect defined custom tag name
    • Create PharosElement base class which sets a custom attribute data-pharos-component as a common identifier
    • Set components to extend PharosElement
    • Update documentation

    Migration Guidelines

    1. Remove all individual imports of Pharos web components.

    2. Register them with a custom tag in your app's entrypoint in the form of {app/bundle}-pharos-{component}:

      import { PharosAlert } from '@ithaka/pharos/lib/components/alert/pharos-alert';
      
      customElements.define('homepage-pharos-alert', PharosAlert);
    3. Update templates, queries, unit tests, and integration tests with the newly defined tag names.

    4. Add the scoped custom element registry polyfill to a globally available location in your project.

    5. Update your bundler's production build settings to keep class names unminified:

      Webpack (Terser):

      optimization: {
        minimizer: [
          new TerserPlugin({
            terserOptions: {
              keep_classnames: /^Pharos/,
              keep_fnames: /^Pharos/,
            }
          }),
        ],
      }

      Vite (ESBuild):

      export default defineConfig({
        esbuild: {
          keepNames: true,
        },
      });
    6. Import the JSDOM patch in your Jest setup file if you use Jest for unit testing:

      import '@ithaka/pharos/lib/patches/jsdom';
      import 'your-pharos-component-registration-file';