Skip to content

Releases: modernweb-dev/rocket

@rocket/[email protected]

16 Nov 17:49
Compare
Choose a tag to compare

Patch Changes

@rocket/[email protected]

16 Nov 17:49
Compare
Choose a tag to compare

Patch Changes

@mdjs/[email protected]

16 Nov 17:49
Compare
Choose a tag to compare

Patch Changes

@mdjs/[email protected]

16 Nov 17:49
Compare
Choose a tag to compare

Patch Changes

@rocket/[email protected]

11 Nov 09:13
Compare
Choose a tag to compare

Patch Changes

  • 15a82c0: Enable including script files into the simulator via <script src=".." mdjs-use>

  • 15a82c0: Allow only a limited set of characters for simulator includes [a-zA-Z0-9\/\-_].
    Notably, there is no:

    • : to prevent http://... includes
    • . so filenames as this.is.my.js are not supported. Also includes will be without file endings which will be added automatically

@mdjs/[email protected]

11 Nov 09:13
Compare
Choose a tag to compare

Patch Changes

  • 15a82c0: Enable including script files into the simulator via <script src=".." mdjs-use>

  • 15a82c0: Allow only a limited set of characters for simulator includes [a-zA-Z0-9\/\-_].
    Notably, there is no:

    • : to prevent http://... includes
    • . so filenames as this.is.my.js are not supported. Also includes will be without file endings which will be added automatically

@mdjs/[email protected]

15 Oct 17:26
Compare
Choose a tag to compare

Patch Changes

  • 5c6b9c9: The Platform and Size controls are now moved above the preview.
    For the web platform we added a special "inline" size.
    Only when platform=web & size=webInline it will render to dom.
    On all other selections it will render the preview via an iframe.

    sizes: [
      {
        key: 'webInline',
        name: 'Inline',
        platform: 'web',
        width: 360,
        height: 640,
        dpr: 1,
      },
      {
        // ...
      },
    ];
  • 6221e5f: If your preview is followed by a code blocks marked as story-code then those will be shown when switching between multiple platforms

    ```js preview-story
    // will be visible when platform web is selected
    export const JsPreviewStory = () =>
      html`
        <demo-wc-card>JS Preview Story</demo-wc-card>
      `;
    ```
    
    ```xml story-code
    <!-- will be visible when platform android is selected -->
    <Button
        android:id="@+id/demoWcCard"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Android Code"
        style="@style/Widget.FooComponents.Demo.Wc.Card"
    />
    ```
    
    ```swift story-code
    // will be visible when platform ios is selected
    import DemoWc.Card
    
    let card = DemoWcButton()
    ```

@mdjs/[email protected]

15 Oct 17:26
Compare
Choose a tag to compare

Patch Changes

  • 6221e5f: If your preview is followed by a code blocks marked as story-code then those will be shown when switching between multiple platforms

    ```js preview-story
    // will be visible when platform web is selected
    export const JsPreviewStory = () =>
      html`
        <demo-wc-card>JS Preview Story</demo-wc-card>
      `;
    ```
    
    ```xml story-code
    <!-- will be visible when platform android is selected -->
    <Button
        android:id="@+id/demoWcCard"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Android Code"
        style="@style/Widget.FooComponents.Demo.Wc.Card"
    />
    ```
    
    ```swift story-code
    // will be visible when platform ios is selected
    import DemoWc.Card
    
    let card = DemoWcButton()
    ```
  • Updated dependencies [5c6b9c9]

  • Updated dependencies [6221e5f]

[email protected]

03 Oct 15:17
Compare
Choose a tag to compare

Minor Changes

  • 70bb7a1: BREAKING CHANGE: addPlugin API changed

    - addPlugin({ name: 'my-plugin', plugin: myPlugin, options: { myFlag: true }, location: 'top' });
    + addPlugin(myPlugin, { myFlag: true }, { location: 'top' });

    This is now type safe and typescript will throw an error if you pass the wrong type.

    function myPlugin({ myFlag = false } = {}) {
      // ...
    }
    
    addPlugin(myPlugin, { myFlag: true }); // ts ok
    addPlugin(myPlugin, { notExisting: true }); // ts error
  • 70bb7a1: BREAKING CHANGE: adjustPluginOptions API changed

    - adjustPluginOptions('my-plugin', { myFlag: true });
    + adjustPluginOptions(myPlugin, { myFlag: true });

    This is now type safe and typescript will throw an error if you pass the wrong type.

    function myPlugin({ myFlag = false } = {}) {
      // ...
    }
    
    adjustPluginOptions(myPlugin, { myFlag: true }); // ts ok
    adjustPluginOptions(myPlugin, { notExisting: true }); // ts error
  • 70bb7a1: Add removePlugin functionality

    export default {
      setupPlugins: [removePlugin(json)],
    };
  • 70bb7a1: BREAKING CHANGE: metaConfigToRollupConfig has been renamed to applyPlugins

    - const finalConfig = metaConfigToRollupConfig(currentConfig, defaultMetaPlugins);
    + const finalConfig = applyPlugins(currentConfig, defaultMetaPlugins);
  • 70bb7a1: BREAKING CHANGE: metaConfigToWebDevServerConfig has been removed

  • 70bb7a1: Plugins can now be classes as well. The options are passed to the constructor.

    /**
     * @typedef {object} MyClassOptions
     * @property {string} lastName
     */
    
    class MyClass {
      /** @type {MyClassOptions} */
      options = {
        lastName: 'initial-second',
      };
    
      /**
       * @param {Partial<MyClassOptions>} options
       */
      constructor(options = {}) {
        this.options = { ...this.options, ...options };
      }
    }
    
    export default {
      setupPlugins: [addPlugin(MyClass)],
    };
    
    // constructor parameters are type safe
    addPlugin(MyClass, { lastName: 'new name' }); // ts ok
    addPlugin(MyClass, { otherProp: 'new name' }); // ts error

@rocket/[email protected]

03 Oct 15:17
Compare
Choose a tag to compare

Minor Changes

  • 70bb7a1: BREAKING CHANGE: Update to latest plugins manager to get type safe options

    There is no longer a name string as a key for a plugin. It is identified by it's function/class. You will need to adjust your code if you are adding or adjusting plugins.

    - addPlugin({ name: 'my-plugin', plugin: myPlugin, options: { myFlag: true }, location: 'top' });
    + addPlugin(myPlugin, { myFlag: true }, { location: 'top' });
    - adjustPluginOptions('my-plugin', { myFlag: true });
    + adjustPluginOptions(myPlugin, { myFlag: true });

    For more details please see the Changelog of the plugins-manager package.

Patch Changes