Skip to content

Conversation

@bennypowers
Copy link
Member

@bennypowers bennypowers commented Dec 21, 2023

What I did

  1. remove deprecatedCustomEvent
  2. remove framework test wrapper fixtures
  3. remove icons from elements package
  4. remove render functions from DocsPage
  5. fix the tokens in accordion

Notes to Reviewers

In reviewing this PR, please take a look at the wds config in https://github.com/RedHat-UX/red-hat-design-system/pull/1420/files/7f8e1bc5c1054e55083a0d50582d0bf0a6d56ff4..bfa209ba48e697ad4c78df20d285ff55518a2bbe, as a sample "downstream" usage of these changes

We will retool this and develop something better. In the mean time, use the react wrapper components
@changeset-bot
Copy link

changeset-bot bot commented Dec 21, 2023

🦋 Changeset detected

Latest commit: bbf779e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@patternfly/elements Major
@patternfly/pfe-tools Major
@patternfly/pfe-core Major
@patternfly/eslint-config-elements Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added doc functionality Functionality, typically pertaining to the JavaScript. styles An issue or PR pertaining only to CSS/Sass tools Development and build tools labels Dec 21, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Dec 21, 2023

"\n## 👕 Commitlint Problems for this PR: \n\n🔎 found 2 errors, 0 warnings\nℹ️ Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint\n \n\n\n1eafb022 - Update little-singers-sell.md \n\n\n- ❌ subject may not be empty\n- ❌ type may not be empty "

@github-actions github-actions bot added the AT passed Automated testing has passed label Dec 21, 2023
@bennypowers bennypowers force-pushed the chore/v3-deprecations branch 2 times, most recently from 6f6c4a2 to 4a54bd0 Compare December 21, 2023 12:21
@bennypowers bennypowers force-pushed the chore/v3-deprecations branch 3 times, most recently from ec3a98d to bd41850 Compare December 21, 2023 12:39
Use `@patternfly/icons` instead
@bennypowers bennypowers force-pushed the chore/v3-deprecations branch from bd41850 to 6dd5c4f Compare December 21, 2023 12:58
@netlify
Copy link

netlify bot commented Dec 21, 2023

Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit 476d2dd
😎 Deploy Preview https://deploy-preview-2655--patternfly-elements.netlify.app/

To edit notification comments on pull requests, go to your Netlify site settings.

@bennypowers bennypowers enabled auto-merge (squash) December 21, 2023 13:34
@github-actions github-actions bot added the demo Updating demo pages label Dec 21, 2023
@bennypowers bennypowers force-pushed the chore/v3-deprecations branch from ec10bac to a69f439 Compare December 28, 2023 16:42
replaces nodeModules: true
May break downstream users that depend on `@patternfly/icons`, see `web-dev-server.config.js`
Demo files *must* inline their javascript modules

BEFORE:
```html
<script type="module" src="pf-jazz-hands.js"></script>
```
AFTER:
```html
<script type="module">
import '@patternfly/elements/pf-jazz-hands/pf-jazz-hands.js';
</script>
```
@bennypowers
Copy link
Member Author

bennypowers commented Jan 14, 2024

I apparently fixed the import map generator plugin. I then ran roughshod over the demo files because the import map plugin requires all top-level modules be inlined.

I haven't checked yet if this breaks the demos on the DP (eleventy). A followup PR should load those demos in iframes, a la pf.org

We'll have to test this with rhds (and maybe cp too, cc @eyevana)

this is also missing changesets

@bennypowers bennypowers requested a review from zeroedin January 14, 2024 14:00
@bennypowers
Copy link
Member Author

Ok this appears to work in rhds with the following dev server config

// @ts-check
import { pfeDevServerConfig } from '@patternfly/pfe-tools/dev-server/config.js';
import { glob } from 'glob';

export const litcssOptions = {
  include: (/** @type{string[]}*/(/** @type{unknown}*/([
    /elements\/rh-[\w-]+\/[\w-]+\.css$/,
    /lib\/.*\.css$/,
  ]))),
  exclude: /lightdom/,
};

const libImports =
  await glob('./lib/**/*.js', { ignore: ['**/test/**'] })
    .then(files => files.map(spec => [`@rhds/elements/${spec}`, `./${spec}`]))
    .then(Object.fromEntries);

const elementImports =
  await glob('./elements/**/*.js', { ignore: ['**/test/**'] })
    .then(files => files.map(spec => [`@rhds/elements/${spec.replace('elements/', '')}`, `./${spec}`]))
    .then(Object.fromEntries);


export default pfeDevServerConfig({
  litcssOptions,
  tsconfig: 'tsconfig.json',
  importMapOptions: {
    providers: {
      '@patternfly/icons': 'nodemodules',
      '@patternfly/elements': 'nodemodules',
      '@patternfly/pfe-tools': 'nodemodules',
      '@patternfly/pfe-core': 'nodemodules',
    },
    inputMap: {
      imports: {
        ...libImports,
        ...elementImports,
      },
    },
  },
  middleware: [
    /** redirect requests for lightdom css to /elements */
    function(ctx, next) {
      const match = ctx.path.match(/^\/components\/(?<slug>[-\w]+)\/(?<path>.*)\.css$/);
      if (match) {
        const { slug, path } = /** @type{{ slug: string; path: string }} */ (match.groups);
        ctx.redirect(`/elements/rh-${slug}/${path}.css`);
      }
      return next();
    },
    /** redirect requests for /assets/* css to /docs/assets/prism.css */
    function(ctx, next) {
      if (ctx.path.startsWith('/assets/')) {
        ctx.redirect(`/docs${ctx.path}`);
      }
      return next();
    }
  ]
});

Copy link
Contributor

@zeroedin zeroedin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So good. 🔥

Late Guests Timidly Mingle

@bennypowers bennypowers merged commit de4cfa4 into main Jan 18, 2024
@bennypowers bennypowers deleted the chore/v3-deprecations branch January 18, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AT passed Automated testing has passed demo Updating demo pages doc functionality Functionality, typically pertaining to the JavaScript. styles An issue or PR pertaining only to CSS/Sass tools Development and build tools

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants