Giter VIP home page Giter VIP logo

bluprint_graphics-kit's People

Contributors

fcage avatar hobbes7878 avatar man-shar avatar minamifunakoshitr avatar pkd2512 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bluprint_graphics-kit's Issues

Pre-commit hook to watch for oversize files

On pre-commit, check file sizes in project-files and statics and prompt a confirmation before committing them with a warning. If user responds with YES this file is meant to be here, we'll add it to gitignore and update the index.

Maybe this is a graphics-bin CLI...

Internationalization/translation

Most of our staff use Google docs to write body text and import that into their project as JSON.

If we can always do that, we can use a proper internationalisation lib like svelte-i18n to handle translation.

That should make it much easier to translate for clients and Gdansk and more powerful if we want to start making different translations accessible for dotcom. It also means I can rip out the logic for the 3 other ways we handle translatable text from the existing rig.

Open question how we handle translation in ai2html components, but because text is usually placed pixel-perfect in AI, I'm operating under the assumption we'd create different AI files for each translation we have.

Failing to automatically create a TR repo for new project

Failing to automatically create a new TR GitHub repo for new project.
Prasanta is having the same issue. We checked for credentials in keychain and they seem to be there and correct. My key shouldn't be expired as I created it < 2 months ago.
Screenshot 2022-01-14 at 09 21 36

Add a global SCSS stylesheet to the bluprint

After talking to Chris a bit more, I can see how it's useful to have a global stylesheet for catch-all rules already pre-connected to the project. So like an equivalent main.scss already imported into the Page component.

I still think we want to actively encourage folks to write styles in their components so they're guaranteed to be scoped correctly, but seems like this will shortcut a bit of comprehension time for new folks.

cc:ing @MinamiFunakoshiTR and @fcage in case y'all feel differently.

Vite 2.7 unknown file type svelte

Getting build errors from esbuild about .svelte being an unknown file type when building the page.

This is likely due to how we have configured the graphics-svelte-components library. Needs fixing and testing, but temporary fix may be to pin vite to 2.6.14.

Consider turning off SSR in dev

One of the most flummoxing things for new folks are 500 errors Vite occasionally throws warning an element (usually anything using d3...) is not a valid SSR component.

SSR is still experimental in Vite and they're absolutely dealing with issues resolving dependencies, especially CJS ones.

If we turn off SSR in development only, then we don't get any more phantom 500s. Though we may then get more apps that don't build because someone is using window or something outside a lifecycle function.

Still, though, the relative frequency of using d3 vs. using non-Node compliant code probably tilts this in favour of disabling until Vite makes a few strides.

add d3-selection to package.json?

Because categorical chart module is now part of the boilerplate, I think we need to add d3-transition to package.json. Running yarn add d3-selection fixed the issue for me and i was able to create a preview

Add a d3 example component

Again, per chat with Chris, making a simple component with this structure:

lib/
  Chart/
    chart.js
    index.svelte

... which includes our boilerplate chart module class in chart.js, all plugged in in index.svelte ...

will help speed him up when starting new projects.

Env class?

Consider adding a class onto an outer containing element -- article, maybe -- that represents the environment the page is built for. Something like: env-dev, env-rngs or env-aws.

This helps if you're writing SCSS rules -- especially w/ complex media queries -- that need different behaviour based on the environment.

This was originally pitched by @fcage while he was writing some relative paths in SCSS, but might have some other uses, too.

Add oversize folder to project-files?

I tried manually adding a folder named oversize inside project-files but it's not being ignored. Do we want to add an empty oversize folder to the boilerplate and add it to gitignore?

Apple Newz

Open question is whether this rig is going to shortcut creating Apple News versions of graphics.

Primary advantages of the new rig as proposed:

  • We assume text comes in as JSON, likely from a Google Doc, (b/c we'll be using a proper internationalisation lib for translation), which we can enforce a standard structure on that could be repurposed for Apple News.
  • Because we're component-izing graphic elements on the pages so we can cut them as separate embeds, does that make it easier to inline/embed them in Apple News spec?

What else would we need (that we could hopefully pull into a separate CLI, maybe??) to make this easier...

@swhart22 is going to investigate!

Fix unused selector warnings in demo AI components

Get a few of these:

22:00:48 [vite-plugin-svelte] /Users/jon/Scripts/bluprint_graphics-kit/src/lib/ai2svelte/ai-chart.svelte:54:0 Unused CSS selector "#g-ai-chart-box p"
22:00:48 [vite-plugin-svelte] /Users/jon/Scripts/bluprint_graphics-kit/src/lib/ai2svelte/ai-chart.svelte:58:0 Unused CSS selector "#g-ai-chart-box .g-aiAbs"
22:00:48 [vite-plugin-svelte] /Users/jon/Scripts/bluprint_graphics-kit/src/lib/ai2svelte/ai-chart.svelte:72:0 Unused CSS selector "#g-ai-chart-box .g-aiPointText p"
22:00:48 [vite-plugin-svelte] /Users/jon/Scripts/bluprint_graphics-kit/src/lib/ai2svelte/ai-scroller-1.svelte:78:0 Unused CSS selector "#g-step-1-box p"
22:00:48 [vite-plugin-svelte] /Users/jon/Scripts/bluprint_graphics-kit/src/lib/ai2svelte/ai-scroller-1.svelte:82:0 Unused CSS selector "#g-step-1-box .g-aiAbs"
22:00:48 [vite-plugin-svelte] /Users/jon/Scripts/bluprint_graphics-kit/src/lib/ai2svelte/ai-scroller-1.svelte:96:0 Unused CSS selector "#g-step-1-box .g-aiPointText p"

Should clean those warnings up in demo files so folks don't get warnings out-of-the-box.

Page metadata component

All metadata for public pages should be handled with a custom component. Should work with the new publisher.

Also need some thought on the metadata we want for embeddables.

A new rig. WHY?

A quick digest of my own thoughts that other folks can add on wish-list-y stuff to...

Why a new rig?

The rig we have is great at producing a particular kind of project -- namely, one page and one embed -- but I think we need to anticipate a future where the structure of the projects we build is more flexible for us and for clients.

First, we want a rig that lets us create multi-page projects. App-like trackers or larger series should be able to be published in the same rig as a single page graphic. That also gives us the benefit of strong SEO on individual pages in tentpole projects like elections and our sports coverage. It also lets our staff scale up to work on more complex projects using the same tools they're already familiar with.

Once we solve multi-page we can also create a variable number of embeds, not just a one-to-one with the dotcom page. With that we're anticipating a world where we can build projects that consist solely of embeds that go into a CMS, e.g., arc, and start giving clients embeds that are more useful in their own CMSs.

We also need a rig that emphasises component-based patterns, so the same graphic can be pulled into different contexts, a page for dotcom and an embed for media to start. Once we get there we can start to develop components for repeated use that will unify our design (where we want it more standard) and significantly shortcut dev time.

I also want to start simplifying more of our building/publishing logic so our own rig tooling more closely aligns with build tools the wider community is working on. That will make it easier to translate our source code to clients who want to deeply customise our projects, easier to maintain our own infrastructure long-term and should get us some free stuff as the community builds smart additions to the frameworks we're using.

The tech that does it

File-based routing in "meta-frameworks" like Next.js and the new Sveltekit covers the most important feature we want: creating pages on the fly so we can split out the right number of pages and embeds for a project.

Sveltekit is in beta, but it has all the features we'd need already to build multi-page projects and split embeds for more flexibility for clients. To use it, we'd need to embrace Svelte as a team.

Several of the staff already have some level of familiarity with Svelte. Writing simple projects in it is much closer to the way staff currently write code compared to React, the only other viable option for us. It's also been well tested on projects from simple graphics to large elections apps and has wide support among newsnerds and devs, so we can be sure we won't dead-end in Yet Another JS Framework for a few years yet.

How we do it

We already have a working rig, so I think we build this one in parallel without creating any bottlenecks for the team. Once it's ready, we can bring staff online individually with projects that aren't especially deadline sensitive until we get a critical mass and can start to sunset the existing rig.

Non-modern browser support -- IE11

IE11 is into end-of-life, with support from Microsoft 365 dropping last year and most other mainstream support ending in 4 months. Global use is also under 1%.

If we drop it, we can start using JavaScript modules, which will significantly decrease the overhead for bundling and increase page speed.

RNGS archives/editions structure

Imagine a project that has a single page for graphics.reuters.com and two embeds published in two locales.

RNGS archives/editions

Here's a minimal example of the edition structure:

๐Ÿ“ public.zip
interactive/
  - index.html
  - embeds/
    - en/
      - chart/
        index.html
      - map/
        index.html
    - de/
      - chart/
        index.html
      - map/
        index.html

๐Ÿ“ media-en-chart.zip
media-interactive/
  - _gfxpreview.png
  - README.txt
  - host/
    - index.html

๐Ÿ“ media-en-map.zip
media-interactive/
  - _gfxpreview.png
  - README.txt
  - host/
    - index.html

๐Ÿ“ media-de-chart.zip
media-interactive/
  - _gfxpreview.png
  - README.txt
  - host/
    - index.html

๐Ÿ“ media-de-map.zip
media-interactive/
  - _gfxpreview.png
  - README.txt
  - host/
    - index.html

๐Ÿ“ media-code.zip
media-interactive/
  - _gfxpreview.png
  - app.zip
  - README.txt

public archive

All publicly hosted files go into a single archive, public.zip.

The archive only includes HTML documents. All page assets -- js, css, imgs -- are published to a separate CDN. That lets us absolutely reference them for easier self-hosting without needing to re-route relative src paths when the folder structure changes in the embeds.

media archives

๐Ÿ“ media-en-map.zip
media-interactive/
  - _gfxpreview.png
  - README.txt
  - host/
    - index.html
  • _gfxpreview.png is a screen-grab of the embeddable graphic, generated during the publish process.
  • README.txt includes the pym.js embed code referencing the page published in the public.zip/interactive archive.
  • host/index.html is a duplication of the HTML document for the embed published in the public.zip/interactive archive.

code archive

๐Ÿ“ media-code.zip
media-interactive/
  - _gfxpreview.png
  - app.zip
  - README.txt
  • _gfxpreview.png is the page's share card.
  • app.zip is the git archive of the entire development project.
  • README.txt includes instructions on how to start up the development server, customise src files and build a dist/ directory that can be uploaded to client's servers.

Consider softening eslint rules

Via husky hooks, eslint will now stop commits for errors like eqeqeq and no-unused-vars.

I think we should consider softening these and maybe a few others to warnings.

W3C markup validation

It's a good practice to have websites that pass W3C validation. Helps with cross-platform compliance, accessibility and SEO

Nice to have -

Sample from one of our web pages built with sveltekit
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.