Skip to content
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

Feature/issue 82 social links bar #115

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

thescientist13
Copy link
Contributor

@thescientist13 thescientist13 commented Jan 15, 2023

Related Issue

resolves #82 and #67

Screen Shot 2023-01-15 at 2 17 35 PM

Note: the first upstream issue below will require a manual patch to local node_modules for now to see the output

Summary of Changes

  1. Create a <tt-social-links> component
  2. Created a custom SVG import plugin
  3. Integrate into the <tt-footer> and home page
  4. Update / add tests

TODO

  1. Greenwood issues 👇
  2. restore missing logos and test case post rebase
  3. Figure out how to get Storybook working with imported SVGs like this
    Screenshot 2024-03-16 at 6 51 26 PM
  4. Should upstream / contribute this plugin back to the Greenwood project
  5. Roll over effect (nice to have)

Upstream Issues

  1. odd loader.js behavior as baseURL is undefined here? - invalid URL when using SSR custom imports ProjectEvergreen/greenwood#1042
    {
      baseURL: undefined,
      parentURL: 'file:///Users/analogstudios/Workspace/analogstudios/repos/www.tuesdaystunes.tv/src/components/social-links/social-links.js'
    }
    
    node:internal/process/promises:279
                triggerUncaughtException(err, true /* fromPromise */);
                ^
    TypeError [ERR_INVALID_URL]: Invalid URL
        at new NodeError (node:internal/errors:387:5)
        at URL.onParseError (node:internal/url:564:9)
        at parse (<anonymous>)
        at new URL (node:internal/url:640:5)
        at resolve (file:///Users/analogstudios/Workspace/analogstudios/repos/www.tuesdaystunes.tv/node_modules/@greenwood/cli/src/loader.js:25:12)
        at nextResolve (node:internal/modules/esm/loader:165:28)
        at ESMLoader.resolve (node:internal/modules/esm/loader:844:30)
        at ESMLoader.getModuleJob (node:internal/modules/esm/loader:431:18)
        at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
        at link (node:internal/modules/esm/module_job:75:36) {
      input: '../../assets/icons/facebook.svg',
      code: 'ERR_INVALID_URL'
    }
    But there is a parentURL that does work?
    export function resolve(specifier, context, defaultResolve) {
      // console.debug({ context });
      // const { baseURL } = context; before
      const { baseURL, parentURL } = context;
    
      if (getCustomLoaderPlugins(specifier).length > 0) {
        // console.debug({ baseURL, specifier });
    
        return {
          // url: new URL(specifier, baseURL).href, before
          url: new URL(specifier, baseURL || parentURL).href,
          shortCircuit: true
        };
      }
    
      return defaultResolve(specifier, context, defaultResolve);
    }
  2. Double SSR yarn build render, only in the header? - duplicate HTML when using prerender and shared components used in both SSR pages and templates ProjectEvergreen/greenwood#1044
    Screen Shot 2023-01-15 at 2 26 53 PM
  3. Might want to validate / verify (perhaps as part of Standardize on Web APIs (Request / Response / URL / etc) ProjectEvergreen/greenwood#948 the need for ?type=svg, as it breaks in SSR and pretender, but I think is needed just for client side usages?

@thescientist13 thescientist13 force-pushed the feature/issue-82-social-links-bar branch from ebe9e02 to 1ab2a7e Compare March 16, 2024 22:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature New feature or request needs-upstream question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Home Page Social Bar (CTA)
1 participant